]> git.sesse.net Git - casparcg/commitdiff
Removed old dependencies. Revert to old revision if you need them.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 6 Dec 2011 23:26:35 +0000 (23:26 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 6 Dec 2011 23:26:35 +0000 (23:26 +0000)
212 files changed:
WTL80/CPL.TXT [deleted file]
WTL80/include/atlapp.h [deleted file]
WTL80/include/atlcrack.h [deleted file]
WTL80/include/atlctrls.h [deleted file]
WTL80/include/atlctrlw.h [deleted file]
WTL80/include/atlctrlx.h [deleted file]
WTL80/include/atlddx.h [deleted file]
WTL80/include/atldlgs.h [deleted file]
WTL80/include/atlfind.h [deleted file]
WTL80/include/atlframe.h [deleted file]
WTL80/include/atlgdi.h [deleted file]
WTL80/include/atlmisc.h [deleted file]
WTL80/include/atlprint.h [deleted file]
WTL80/include/atlres.h [deleted file]
WTL80/include/atlresce.h [deleted file]
WTL80/include/atlscrl.h [deleted file]
WTL80/include/atlsplit.h [deleted file]
WTL80/include/atltheme.h [deleted file]
WTL80/include/atluser.h [deleted file]
WTL80/include/atlwince.h [deleted file]
WTL80/include/atlwinx.h [deleted file]
WTL80/readme.htm [deleted file]
boost_1_44_0.7z [deleted file]
ffmpeg 0.5/include/changelog.txt [deleted file]
ffmpeg 0.5/include/ffmpeg/adler32.h [deleted file]
ffmpeg 0.5/include/ffmpeg/avcodec.h [deleted file]
ffmpeg 0.5/include/ffmpeg/avformat.h [deleted file]
ffmpeg 0.5/include/ffmpeg/avio.h [deleted file]
ffmpeg 0.5/include/ffmpeg/avstring.h [deleted file]
ffmpeg 0.5/include/ffmpeg/avutil.h [deleted file]
ffmpeg 0.5/include/ffmpeg/base64.h [deleted file]
ffmpeg 0.5/include/ffmpeg/common.h [deleted file]
ffmpeg 0.5/include/ffmpeg/fifo.h [deleted file]
ffmpeg 0.5/include/ffmpeg/integer.h [deleted file]
ffmpeg 0.5/include/ffmpeg/intfloat_readwrite.h [deleted file]
ffmpeg 0.5/include/ffmpeg/log.h [deleted file]
ffmpeg 0.5/include/ffmpeg/lzo.h [deleted file]
ffmpeg 0.5/include/ffmpeg/mathematics.h [deleted file]
ffmpeg 0.5/include/ffmpeg/md5.h [deleted file]
ffmpeg 0.5/include/ffmpeg/mem.h [deleted file]
ffmpeg 0.5/include/ffmpeg/opt.h [deleted file]
ffmpeg 0.5/include/ffmpeg/random.h [deleted file]
ffmpeg 0.5/include/ffmpeg/rational.h [deleted file]
ffmpeg 0.5/include/ffmpeg/rgb2rgb.h [deleted file]
ffmpeg 0.5/include/ffmpeg/rtp.h [deleted file]
ffmpeg 0.5/include/ffmpeg/rtsp.h [deleted file]
ffmpeg 0.5/include/ffmpeg/rtspcodes.h [deleted file]
ffmpeg 0.5/include/ffmpeg/swscale.h [deleted file]
ffmpeg 0.5/include/inttypes.h [deleted file]
ffmpeg 0.5/include/stdint.h [deleted file]
ffmpeg 0.5/lib/avcodec-51.dll [deleted file]
ffmpeg 0.5/lib/avcodec-51.lib [deleted file]
ffmpeg 0.5/lib/avformat-51.dll [deleted file]
ffmpeg 0.5/lib/avformat-51.lib [deleted file]
ffmpeg 0.5/lib/avutil-49.dll [deleted file]
ffmpeg 0.5/lib/avutil-49.lib [deleted file]
ffmpeg 0.6/complete_config [deleted file]
ffmpeg 0.6/include/changelog.txt [deleted file]
ffmpeg 0.6/include/inttypes.h [deleted file]
ffmpeg 0.6/include/libavcodec/avcodec.h [deleted file]
ffmpeg 0.6/include/libavcodec/avfft.h [deleted file]
ffmpeg 0.6/include/libavcodec/dxva2.h [deleted file]
ffmpeg 0.6/include/libavcodec/opt.h [deleted file]
ffmpeg 0.6/include/libavcodec/vaapi.h [deleted file]
ffmpeg 0.6/include/libavcodec/vdpau.h [deleted file]
ffmpeg 0.6/include/libavcodec/xvmc.h [deleted file]
ffmpeg 0.6/include/libavdevice/avdevice.h [deleted file]
ffmpeg 0.6/include/libavformat/avformat.h [deleted file]
ffmpeg 0.6/include/libavformat/avio.h [deleted file]
ffmpeg 0.6/include/libavutil/adler32.h [deleted file]
ffmpeg 0.6/include/libavutil/attributes.h [deleted file]
ffmpeg 0.6/include/libavutil/avconfig.h [deleted file]
ffmpeg 0.6/include/libavutil/avstring.h [deleted file]
ffmpeg 0.6/include/libavutil/avutil.h [deleted file]
ffmpeg 0.6/include/libavutil/base64.h [deleted file]
ffmpeg 0.6/include/libavutil/common.h [deleted file]
ffmpeg 0.6/include/libavutil/crc.h [deleted file]
ffmpeg 0.6/include/libavutil/error.h [deleted file]
ffmpeg 0.6/include/libavutil/fifo.h [deleted file]
ffmpeg 0.6/include/libavutil/intfloat_readwrite.h [deleted file]
ffmpeg 0.6/include/libavutil/log.h [deleted file]
ffmpeg 0.6/include/libavutil/lzo.h [deleted file]
ffmpeg 0.6/include/libavutil/mathematics.h [deleted file]
ffmpeg 0.6/include/libavutil/md5.h [deleted file]
ffmpeg 0.6/include/libavutil/mem.h [deleted file]
ffmpeg 0.6/include/libavutil/pixdesc.h [deleted file]
ffmpeg 0.6/include/libavutil/pixfmt.h [deleted file]
ffmpeg 0.6/include/libavutil/rational.h [deleted file]
ffmpeg 0.6/include/libavutil/sha1.h [deleted file]
ffmpeg 0.6/include/libpostproc/postprocess.h [deleted file]
ffmpeg 0.6/include/libswscale/swscale.h [deleted file]
ffmpeg 0.6/include/stdint.h [deleted file]
ffmpeg 0.6/lib/avcodec-52.def [deleted file]
ffmpeg 0.6/lib/avcodec-52.dll [deleted file]
ffmpeg 0.6/lib/avcodec-52.exp [deleted file]
ffmpeg 0.6/lib/avcodec-52.lib [deleted file]
ffmpeg 0.6/lib/avcore-0.dll [deleted file]
ffmpeg 0.6/lib/avdevice-52.def [deleted file]
ffmpeg 0.6/lib/avdevice-52.dll [deleted file]
ffmpeg 0.6/lib/avdevice-52.exp [deleted file]
ffmpeg 0.6/lib/avdevice-52.lib [deleted file]
ffmpeg 0.6/lib/avformat-52.def [deleted file]
ffmpeg 0.6/lib/avformat-52.dll [deleted file]
ffmpeg 0.6/lib/avformat-52.exp [deleted file]
ffmpeg 0.6/lib/avformat-52.lib [deleted file]
ffmpeg 0.6/lib/avutil-50.def [deleted file]
ffmpeg 0.6/lib/avutil-50.dll [deleted file]
ffmpeg 0.6/lib/avutil-50.exp [deleted file]
ffmpeg 0.6/lib/avutil-50.lib [deleted file]
ffmpeg 0.6/lib/postproc-51.def [deleted file]
ffmpeg 0.6/lib/postproc-51.dll [deleted file]
ffmpeg 0.6/lib/postproc-51.exp [deleted file]
ffmpeg 0.6/lib/postproc-51.lib [deleted file]
ffmpeg 0.6/lib/swscale-0.def [deleted file]
ffmpeg 0.6/lib/swscale-0.dll [deleted file]
ffmpeg 0.6/lib/swscale-0.exp [deleted file]
ffmpeg 0.6/lib/swscale-0.lib [deleted file]
ffmpeg 0.6/samples/libavfilter_sample.txt [deleted file]
ffmpeg 0.7/README.txt [deleted file]
ffmpeg 0.7/doc/developer.html [deleted file]
ffmpeg 0.7/doc/faq.html [deleted file]
ffmpeg 0.7/doc/ffmpeg.html [deleted file]
ffmpeg 0.7/doc/ffplay.html [deleted file]
ffmpeg 0.7/doc/ffprobe.html [deleted file]
ffmpeg 0.7/doc/general.html [deleted file]
ffmpeg 0.7/doc/libavfilter.html [deleted file]
ffmpeg 0.7/include/inttypes.h [deleted file]
ffmpeg 0.7/include/libavcodec/avcodec.h [deleted file]
ffmpeg 0.7/include/libavcodec/avfft.h [deleted file]
ffmpeg 0.7/include/libavcodec/dxva2.h [deleted file]
ffmpeg 0.7/include/libavcodec/opt.h [deleted file]
ffmpeg 0.7/include/libavcodec/vaapi.h [deleted file]
ffmpeg 0.7/include/libavcodec/vdpau.h [deleted file]
ffmpeg 0.7/include/libavcodec/version.h [deleted file]
ffmpeg 0.7/include/libavcodec/xvmc.h [deleted file]
ffmpeg 0.7/include/libavdevice/avdevice.h [deleted file]
ffmpeg 0.7/include/libavfilter/avcodec.h [deleted file]
ffmpeg 0.7/include/libavfilter/avfilter.h [deleted file]
ffmpeg 0.7/include/libavfilter/avfiltergraph.h [deleted file]
ffmpeg 0.7/include/libavfilter/vsrc_buffer.h [deleted file]
ffmpeg 0.7/include/libavformat/avformat.h [deleted file]
ffmpeg 0.7/include/libavformat/avio.h [deleted file]
ffmpeg 0.7/include/libavformat/version.h [deleted file]
ffmpeg 0.7/include/libavutil/adler32.h [deleted file]
ffmpeg 0.7/include/libavutil/aes.h [deleted file]
ffmpeg 0.7/include/libavutil/attributes.h [deleted file]
ffmpeg 0.7/include/libavutil/audioconvert.h [deleted file]
ffmpeg 0.7/include/libavutil/avassert.h [deleted file]
ffmpeg 0.7/include/libavutil/avconfig.h [deleted file]
ffmpeg 0.7/include/libavutil/avstring.h [deleted file]
ffmpeg 0.7/include/libavutil/avutil.h [deleted file]
ffmpeg 0.7/include/libavutil/base64.h [deleted file]
ffmpeg 0.7/include/libavutil/bswap.h [deleted file]
ffmpeg 0.7/include/libavutil/common.h [deleted file]
ffmpeg 0.7/include/libavutil/cpu.h [deleted file]
ffmpeg 0.7/include/libavutil/crc.h [deleted file]
ffmpeg 0.7/include/libavutil/dict.h [deleted file]
ffmpeg 0.7/include/libavutil/error.h [deleted file]
ffmpeg 0.7/include/libavutil/eval.h [deleted file]
ffmpeg 0.7/include/libavutil/fifo.h [deleted file]
ffmpeg 0.7/include/libavutil/file.h [deleted file]
ffmpeg 0.7/include/libavutil/imgutils.h [deleted file]
ffmpeg 0.7/include/libavutil/intfloat_readwrite.h [deleted file]
ffmpeg 0.7/include/libavutil/intreadwrite.h [deleted file]
ffmpeg 0.7/include/libavutil/lfg.h [deleted file]
ffmpeg 0.7/include/libavutil/log.h [deleted file]
ffmpeg 0.7/include/libavutil/lzo.h [deleted file]
ffmpeg 0.7/include/libavutil/mathematics.h [deleted file]
ffmpeg 0.7/include/libavutil/md5.h [deleted file]
ffmpeg 0.7/include/libavutil/mem.h [deleted file]
ffmpeg 0.7/include/libavutil/opt.h [deleted file]
ffmpeg 0.7/include/libavutil/parseutils.h [deleted file]
ffmpeg 0.7/include/libavutil/pixdesc.h [deleted file]
ffmpeg 0.7/include/libavutil/pixfmt.h [deleted file]
ffmpeg 0.7/include/libavutil/random_seed.h [deleted file]
ffmpeg 0.7/include/libavutil/rational.h [deleted file]
ffmpeg 0.7/include/libavutil/samplefmt.h [deleted file]
ffmpeg 0.7/include/libavutil/sha.h [deleted file]
ffmpeg 0.7/include/libpostproc/postprocess.h [deleted file]
ffmpeg 0.7/include/libswscale/swscale.h [deleted file]
ffmpeg 0.7/lib/avcodec-53.dll [deleted file]
ffmpeg 0.7/lib/avcodec.lib [deleted file]
ffmpeg 0.7/lib/avdevice-53.dll [deleted file]
ffmpeg 0.7/lib/avdevice.lib [deleted file]
ffmpeg 0.7/lib/avfilter-2.dll [deleted file]
ffmpeg 0.7/lib/avfilter.lib [deleted file]
ffmpeg 0.7/lib/avformat-53.dll [deleted file]
ffmpeg 0.7/lib/avformat.lib [deleted file]
ffmpeg 0.7/lib/avutil-51.dll [deleted file]
ffmpeg 0.7/lib/avutil.lib [deleted file]
ffmpeg 0.7/lib/postproc-51.dll [deleted file]
ffmpeg 0.7/lib/postproc.lib [deleted file]
ffmpeg 0.7/lib/swscale-0.dll [deleted file]
ffmpeg 0.7/lib/swscale.lib [deleted file]
ffmpeg 0.7/licenses/bzip2.txt [deleted file]
ffmpeg 0.7/licenses/ffmpeg.txt [deleted file]
ffmpeg 0.7/licenses/freetype.txt [deleted file]
ffmpeg 0.7/licenses/frei0r.txt [deleted file]
ffmpeg 0.7/licenses/gsm.txt [deleted file]
ffmpeg 0.7/licenses/lame.txt [deleted file]
ffmpeg 0.7/licenses/libvpx.txt [deleted file]
ffmpeg 0.7/licenses/opencore-amr.txt [deleted file]
ffmpeg 0.7/licenses/openjpeg.txt [deleted file]
ffmpeg 0.7/licenses/rtmp.txt [deleted file]
ffmpeg 0.7/licenses/schroedinger.txt [deleted file]
ffmpeg 0.7/licenses/speex.txt [deleted file]
ffmpeg 0.7/licenses/theora.txt [deleted file]
ffmpeg 0.7/licenses/vorbis.txt [deleted file]
ffmpeg 0.7/licenses/x264.txt [deleted file]
ffmpeg 0.7/licenses/xavs.txt [deleted file]
ffmpeg 0.7/licenses/xvid.txt [deleted file]
ffmpeg 0.7/licenses/zlib.txt [deleted file]

diff --git a/WTL80/CPL.TXT b/WTL80/CPL.TXT
deleted file mode 100644 (file)
index e887791..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-Common Public License Version 1.0\r
-\r
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\r
-\r
-\r
-1. DEFINITIONS \r
-\r
-"Contribution" means:\r
-\r
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and \r
-\r
-b) in the case of each subsequent Contributor:\r
-\r
-i) changes to the Program, and\r
-\r
-ii) additions to the Program;\r
-\r
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.\r
-\r
-"Contributor" means any person or entity that distributes the Program. \r
-\r
-"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.\r
-\r
-"Program" means the Contributions distributed in accordance with this Agreement. \r
-\r
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. \r
-\r
-\r
-2. GRANT OF RIGHTS\r
-\r
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.\r
-\r
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.\r
-\r
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.\r
-\r
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.\r
-\r
-\r
-3. REQUIREMENTS \r
-\r
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: \r
-\r
-a) it complies with the terms and conditions of this Agreement; and\r
-\r
-b) its license agreement:\r
-\r
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; \r
-\r
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; \r
-\r
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and \r
-\r
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. \r
-\r
-When the Program is made available in source code form:\r
-\r
-a) it must be made available under this Agreement; and\r
-\r
-b) a copy of this Agreement must be included with each copy of the Program. \r
-\r
-Contributors may not remove or alter any copyright notices contained within the Program.\r
-\r
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. \r
-\r
-\r
-4. COMMERCIAL DISTRIBUTION \r
-\r
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. \r
-\r
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. \r
-\r
-\r
-5. NO WARRANTY\r
-\r
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. \r
-\r
-\r
-6. DISCLAIMER OF LIABILITY \r
-\r
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \r
-\r
-\r
-7. GENERAL\r
-\r
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. \r
-\r
-If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.\r
-\r
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. \r
-\r
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. \r
-\r
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.\r
diff --git a/WTL80/include/atlapp.h b/WTL80/include/atlapp.h
deleted file mode 100644 (file)
index b62e097..0000000
+++ /dev/null
@@ -1,1688 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLAPP_H__\r
-#define __ATLAPP_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLBASE_H__\r
-       #error atlapp.h requires atlbase.h to be included first\r
-#endif\r
-\r
-#ifndef _WIN32_WCE\r
-  #if (WINVER < 0x0400)\r
-       #error WTL requires Windows version 4.0 or higher\r
-  #endif\r
-\r
-  #if (_WIN32_IE < 0x0300)\r
-       #error WTL requires IE version 3.0 or higher\r
-  #endif\r
-#endif\r
-\r
-#ifdef _ATL_NO_COMMODULE\r
-       #error WTL requires that _ATL_NO_COMMODULE is not defined\r
-#endif // _ATL_NO_COMMODULE\r
-\r
-#if defined(_WIN32_WCE) && defined(_ATL_MIN_CRT)\r
-       #pragma message("Warning: WTL for Windows CE doesn't use _ATL_MIN_CRT")\r
-#endif // defined(_WIN32_WCE) && defined(_ATL_MIN_CRT)\r
-\r
-#include <limits.h>\r
-#if !defined(_ATL_MIN_CRT) && defined(_MT) && !defined(_WIN32_WCE)\r
-  #include <process.h> // for _beginthreadex\r
-#endif\r
-\r
-#if (_ATL_VER < 0x0800) && !defined(_DEBUG)\r
-  #include <stdio.h>\r
-#endif\r
-\r
-#include <commctrl.h>\r
-#ifndef _WIN32_WCE\r
-#pragma comment(lib, "comctl32.lib")\r
-#endif // !_WIN32_WCE\r
-\r
-#ifndef _WIN32_WCE\r
-  #include "atlres.h"\r
-#else // CE specific\r
-  #include "atlresce.h"\r
-#endif // _WIN32_WCE\r
-\r
-// We need to disable this warning because of template class arguments\r
-#pragma warning(disable: 4127)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// WTL version number\r
-\r
-#define _WTL_VER       0x0800\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CMessageFilter\r
-// CIdleHandler\r
-// CMessageLoop\r
-//\r
-// CAppModule\r
-// CServerAppModule\r
-//\r
-// Global functions:\r
-//   AtlGetDefaultGuiFont()\r
-//   AtlCreateBoldFont()\r
-//   AtlInitCommonControls()\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Global support for Windows CE\r
-\r
-#ifdef _WIN32_WCE\r
-\r
-#ifndef SW_SHOWDEFAULT\r
-  #define SW_SHOWDEFAULT       SW_SHOWNORMAL\r
-#endif // !SW_SHOWDEFAULT\r
-\r
-// These get's OR-ed in a constant and will have no effect.\r
-// Defining them reduces the number of #ifdefs required for CE.\r
-#define LR_DEFAULTSIZE      0\r
-#define LR_LOADFROMFILE     0\r
-\r
-#ifndef SM_CXCURSOR\r
-  #define SM_CXCURSOR             13\r
-#endif\r
-#ifndef SM_CYCURSOR\r
-  #define SM_CYCURSOR             14\r
-#endif\r
-\r
-inline BOOL IsMenu(HMENU hMenu)\r
-{\r
-       MENUITEMINFO mii = { sizeof(MENUITEMINFO) };\r
-       ::SetLastError(0);\r
-       BOOL bRet = ::GetMenuItemInfo(hMenu, 0, TRUE, &mii);\r
-       if(!bRet)\r
-               bRet = (::GetLastError() != ERROR_INVALID_MENU_HANDLE) ? TRUE : FALSE;\r
-       return bRet;\r
-}\r
-\r
-#if (_WIN32_WCE >= 410)\r
-extern "C" void WINAPI ListView_SetItemSpacing(HWND hwndLV, int iHeight);\r
-#endif // (_WIN32_WCE >= 410)\r
-\r
-inline int MulDiv(IN int nNumber, IN int nNumerator, IN int nDenominator)\r
-{\r
-       __int64 multiple = nNumber * nNumerator;\r
-       return static_cast<int>(multiple / nDenominator);\r
-}\r
-\r
-#if (_ATL_VER >= 0x0800)\r
-\r
-#ifndef _WTL_KEEP_WS_OVERLAPPEDWINDOW\r
-  #ifdef WS_OVERLAPPEDWINDOW\r
-    #undef WS_OVERLAPPEDWINDOW\r
-    #define WS_OVERLAPPEDWINDOW        0\r
-  #endif // WS_OVERLAPPEDWINDOW\r
-#endif // !_WTL_KEEP_WS_OVERLAPPEDWINDOW\r
-\r
-#ifndef RDW_FRAME\r
-  #define RDW_FRAME    0\r
-#endif // !RDW_FRAME\r
-\r
-#ifndef WM_WINDOWPOSCHANGING\r
-  #define WM_WINDOWPOSCHANGING 0\r
-#endif // !WM_WINDOWPOSCHANGING\r
-\r
-#define FreeResource(x)\r
-#define UnlockResource(x)\r
-\r
-namespace ATL\r
-{\r
-  inline HRESULT CComModule::RegisterClassObjects(DWORD /*dwClsContext*/, DWORD /*dwFlags*/) throw()\r
-  { return E_NOTIMPL; }\r
-  inline HRESULT CComModule::RevokeClassObjects() throw()\r
-  { return E_NOTIMPL; }\r
-}; // namespace ATL\r
-\r
-#ifndef lstrlenW\r
-  #define lstrlenW     (int)ATL::lstrlenW\r
-#endif // lstrlenW\r
-\r
-inline int WINAPI lstrlenA(LPCSTR lpszString)\r
-{ return ATL::lstrlenA(lpszString); }\r
-\r
-#ifdef lstrcpyn\r
-  #undef lstrcpyn\r
-  #define lstrcpyn     ATL::lstrcpynW\r
-#endif // lstrcpyn\r
-\r
-#ifndef SetWindowLongPtrW\r
-  inline LONG_PTR tmp_SetWindowLongPtrW( HWND hWnd, int nIndex, LONG_PTR dwNewLong )\r
-  {\r
-       return( ::SetWindowLongW( hWnd, nIndex, LONG( dwNewLong ) ) );\r
-  }\r
-  #define SetWindowLongPtrW tmp_SetWindowLongPtrW\r
-#endif\r
-\r
-#ifndef GetWindowLongPtrW\r
-  inline LONG_PTR tmp_GetWindowLongPtrW( HWND hWnd, int nIndex )\r
-  {\r
-       return( ::GetWindowLongW( hWnd, nIndex ) );\r
-  }\r
-  #define GetWindowLongPtrW tmp_GetWindowLongPtrW\r
-#endif\r
-\r
-#ifndef LongToPtr\r
-  #define LongToPtr(x) ((void*)x)\r
-#endif\r
-\r
-#ifndef PtrToInt\r
-  #define PtrToInt( p ) ((INT)(INT_PTR) (p) )\r
-#endif\r
-\r
-#else // !(_ATL_VER >= 0x0800)\r
-\r
-#ifdef lstrlenW\r
-  #undef lstrlenW\r
-  #define lstrlenW (int)::wcslen\r
-#endif // lstrlenW\r
-\r
-#define lstrlenA (int)strlen\r
-\r
-#ifndef lstrcpyn\r
-  inline LPTSTR lstrcpyn(LPTSTR lpstrDest, LPCTSTR lpstrSrc, int nLength)\r
-  {\r
-       if(lpstrDest == NULL || lpstrSrc == NULL || nLength <= 0)\r
-               return NULL;\r
-       int nLen = min(lstrlen(lpstrSrc), nLength - 1);\r
-       LPTSTR lpstrRet = (LPTSTR)memcpy(lpstrDest, lpstrSrc, nLen * sizeof(TCHAR));\r
-       lpstrDest[nLen] = 0;\r
-       return lpstrRet;\r
-  }\r
-#endif // !lstrcpyn\r
-\r
-#ifndef lstrcpynW\r
-  inline LPWSTR lstrcpynW(LPWSTR lpstrDest, LPCWSTR lpstrSrc, int nLength)\r
-  {\r
-       return lstrcpyn(lpstrDest, lpstrSrc, nLength);   // WinCE is Unicode only\r
-  }\r
-#endif // !lstrcpynW\r
-\r
-#ifndef lstrcpynA\r
-  inline LPSTR lstrcpynA(LPSTR lpstrDest, LPCSTR lpstrSrc, int nLength)\r
-  {\r
-       if(lpstrDest == NULL || lpstrSrc == NULL || nLength <= 0)\r
-               return NULL;\r
-       int nLen = min(lstrlenA(lpstrSrc), nLength - 1);\r
-       LPSTR lpstrRet = (LPSTR)memcpy(lpstrDest, lpstrSrc, nLen * sizeof(char));\r
-       lpstrDest[nLen] = 0;\r
-       return lpstrRet;\r
-  }\r
-#endif // !lstrcpyn\r
-\r
-#ifdef TrackPopupMenu\r
-  #undef TrackPopupMenu\r
-#endif // TrackPopupMenu\r
-\r
-#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd) \\r
-static CWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static CWndClassInfo wc = \\r
-       { \\r
-               { style, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName }, \\r
-               NULL, NULL, IDC_ARROW, TRUE, 0, _T("") \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#ifndef _MAX_FNAME\r
-  #define _MAX_FNAME   _MAX_PATH\r
-#endif // _MAX_FNAME\r
-\r
-#if (_WIN32_WCE < 400)\r
-  #define MAKEINTATOM(i)  (LPTSTR)((ULONG_PTR)((WORD)(i)))\r
-#endif // (_WIN32_WCE < 400)\r
-\r
-#if (_WIN32_WCE < 410)\r
-  #define WHEEL_PAGESCROLL                (UINT_MAX)\r
-  #define WHEEL_DELTA                     120\r
-#endif // (_WIN32_WCE < 410)\r
-\r
-#ifdef DrawIcon\r
-  #undef DrawIcon\r
-#endif\r
-\r
-#ifndef VARCMP_LT\r
-  #define VARCMP_LT   0\r
-#endif\r
-#ifndef VARCMP_EQ\r
-  #define VARCMP_EQ   1\r
-#endif\r
-#ifndef VARCMP_GT\r
-  #define VARCMP_GT   2\r
-#endif\r
-#ifndef VARCMP_NULL\r
-  #define VARCMP_NULL 3\r
-#endif\r
-\r
-#ifndef RDW_ALLCHILDREN\r
-  #define RDW_ALLCHILDREN   0\r
-#endif\r
-\r
-#endif // !(_ATL_VER >= 0x0800)\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Global support for using original VC++ 6.0 headers with WTL\r
-\r
-#ifndef _ATL_NO_OLD_HEADERS_WIN64\r
-#if !defined(_WIN64) && (_ATL_VER < 0x0700)\r
-\r
-  #ifndef PSM_INSERTPAGE\r
-    #define PSM_INSERTPAGE          (WM_USER + 119)\r
-  #endif // !PSM_INSERTPAGE\r
-\r
-  #ifndef GetClassLongPtr\r
-    #define GetClassLongPtrA   GetClassLongA\r
-    #define GetClassLongPtrW   GetClassLongW\r
-    #ifdef UNICODE\r
-      #define GetClassLongPtr  GetClassLongPtrW\r
-    #else\r
-      #define GetClassLongPtr  GetClassLongPtrA\r
-    #endif // !UNICODE\r
-  #endif // !GetClassLongPtr\r
-\r
-  #ifndef GCLP_HICONSM\r
-    #define GCLP_HICONSM        (-34)\r
-  #endif // !GCLP_HICONSM\r
-\r
-  #ifndef GetWindowLongPtr\r
-    #define GetWindowLongPtrA   GetWindowLongA\r
-    #define GetWindowLongPtrW   GetWindowLongW\r
-    #ifdef UNICODE\r
-      #define GetWindowLongPtr  GetWindowLongPtrW\r
-    #else\r
-      #define GetWindowLongPtr  GetWindowLongPtrA\r
-    #endif // !UNICODE\r
-  #endif // !GetWindowLongPtr\r
-\r
-  #ifndef SetWindowLongPtr\r
-    #define SetWindowLongPtrA   SetWindowLongA\r
-    #define SetWindowLongPtrW   SetWindowLongW\r
-    #ifdef UNICODE\r
-      #define SetWindowLongPtr  SetWindowLongPtrW\r
-    #else\r
-      #define SetWindowLongPtr  SetWindowLongPtrA\r
-    #endif // !UNICODE\r
-  #endif // !SetWindowLongPtr\r
-\r
-  #ifndef GWLP_WNDPROC\r
-    #define GWLP_WNDPROC        (-4)\r
-  #endif\r
-  #ifndef GWLP_HINSTANCE\r
-    #define GWLP_HINSTANCE      (-6)\r
-  #endif\r
-  #ifndef GWLP_HWNDPARENT\r
-    #define GWLP_HWNDPARENT     (-8)\r
-  #endif\r
-  #ifndef GWLP_USERDATA\r
-    #define GWLP_USERDATA       (-21)\r
-  #endif\r
-  #ifndef GWLP_ID\r
-    #define GWLP_ID             (-12)\r
-  #endif\r
-\r
-  #ifndef DWLP_MSGRESULT\r
-    #define DWLP_MSGRESULT  0\r
-  #endif\r
-\r
-  typedef long LONG_PTR;\r
-  typedef unsigned long ULONG_PTR;\r
-  typedef ULONG_PTR DWORD_PTR;\r
-\r
-  #ifndef HandleToUlong\r
-    #define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )\r
-  #endif\r
-  #ifndef HandleToLong\r
-    #define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )\r
-  #endif\r
-  #ifndef LongToHandle\r
-    #define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))\r
-  #endif\r
-  #ifndef PtrToUlong\r
-    #define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )\r
-  #endif\r
-  #ifndef PtrToLong\r
-    #define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )\r
-  #endif\r
-  #ifndef PtrToUint\r
-    #define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )\r
-  #endif\r
-  #ifndef PtrToInt\r
-    #define PtrToInt( p ) ((INT)(INT_PTR) (p) )\r
-  #endif\r
-  #ifndef PtrToUshort\r
-    #define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )\r
-  #endif\r
-  #ifndef PtrToShort\r
-    #define PtrToShort( p ) ((short)(LONG_PTR)(p) )\r
-  #endif\r
-  #ifndef IntToPtr\r
-    #define IntToPtr( i )    ((VOID *)(INT_PTR)((int)i))\r
-  #endif\r
-  #ifndef UIntToPtr\r
-    #define UIntToPtr( ui )  ((VOID *)(UINT_PTR)((unsigned int)ui))\r
-  #endif\r
-  #ifndef LongToPtr\r
-    #define LongToPtr( l )   ((VOID *)(LONG_PTR)((long)l))\r
-  #endif\r
-  #ifndef ULongToPtr\r
-    #define ULongToPtr( ul )  ((VOID *)(ULONG_PTR)((unsigned long)ul))\r
-  #endif\r
-\r
-#endif // !defined(_WIN64) && (_ATL_VER < 0x0700)\r
-#endif // !_ATL_NO_OLD_HEADERS_WIN64\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Global support for SecureHelper functions\r
-\r
-#ifndef _TRUNCATE\r
-  #define _TRUNCATE ((size_t)-1)\r
-#endif\r
-\r
-#ifndef _ERRCODE_DEFINED\r
-  #define _ERRCODE_DEFINED\r
-  typedef int errno_t;\r
-#endif\r
-\r
-#ifndef _SECURECRT_ERRCODE_VALUES_DEFINED\r
-  #define _SECURECRT_ERRCODE_VALUES_DEFINED\r
-  #define EINVAL          22\r
-  #define STRUNCATE       80\r
-#endif\r
-\r
-#ifndef _countof\r
-  #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Miscellaneous global support\r
-\r
-// define useful macros from winuser.h\r
-#ifndef IS_INTRESOURCE\r
-  #define IS_INTRESOURCE(_r) (((ULONG_PTR)(_r) >> 16) == 0)\r
-#endif // IS_INTRESOURCE\r
-\r
-// protect template members from windowsx.h macros\r
-#ifdef _INC_WINDOWSX\r
-  #undef SubclassWindow\r
-#endif // _INC_WINDOWSX\r
-\r
-// define useful macros from windowsx.h\r
-#ifndef GET_X_LPARAM\r
-  #define GET_X_LPARAM(lParam) ((int)(short)LOWORD(lParam))\r
-#endif\r
-#ifndef GET_Y_LPARAM\r
-  #define GET_Y_LPARAM(lParam) ((int)(short)HIWORD(lParam))\r
-#endif\r
-\r
-// Dummy structs for compiling with /CLR\r
-#if (_MSC_VER >= 1300) && defined(_MANAGED)\r
-  __if_not_exists(_IMAGELIST::_IMAGELIST) { struct _IMAGELIST { }; }\r
-  __if_not_exists(_TREEITEM::_TREEITEM) { struct _TREEITEM { }; }\r
-  __if_not_exists(_PSP::_PSP) { struct _PSP { }; }\r
-#endif\r
-\r
-// Define ATLVERIFY macro for ATL3\r
-#if (_ATL_VER < 0x0700)\r
-  #ifndef ATLVERIFY\r
-    #ifdef _DEBUG\r
-      #define ATLVERIFY(expr) ATLASSERT(expr)\r
-    #else\r
-      #define ATLVERIFY(expr) (expr)\r
-    #endif // DEBUG\r
-  #endif // ATLVERIFY\r
-#endif // (_ATL_VER < 0x0700)\r
-\r
-// Forward declaration for ATL3 fix\r
-#if (_ATL_VER < 0x0700) && defined(_ATL_DLL) && !defined(_WIN32_WCE)\r
-  namespace ATL { HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor); };\r
-#endif\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-#if (_ATL_VER >= 0x0700)\r
-  DECLARE_TRACE_CATEGORY(atlTraceUI);\r
-  #ifdef _DEBUG\r
-    __declspec(selectany) ATL::CTraceCategory atlTraceUI(_T("atlTraceUI"));\r
-  #endif // _DEBUG\r
-#else // !(_ATL_VER >= 0x0700)\r
-  enum wtlTraceFlags\r
-  {\r
-       atlTraceUI = 0x10000000\r
-  };\r
-#endif // !(_ATL_VER >= 0x0700)\r
-\r
-// Windows version helper\r
-inline bool AtlIsOldWindows()\r
-{\r
-       OSVERSIONINFO ovi = { 0 };\r
-       ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\r
-       BOOL bRet = ::GetVersionEx(&ovi);\r
-       return (!bRet || !((ovi.dwMajorVersion >= 5) || (ovi.dwMajorVersion == 4 && ovi.dwMinorVersion >= 90)));\r
-}\r
-\r
-// default GUI font helper\r
-inline HFONT AtlGetDefaultGuiFont()\r
-{\r
-#ifndef _WIN32_WCE\r
-       return (HFONT)::GetStockObject(DEFAULT_GUI_FONT);\r
-#else // CE specific\r
-       return (HFONT)::GetStockObject(SYSTEM_FONT);\r
-#endif // _WIN32_WCE\r
-}\r
-\r
-// bold font helper (NOTE: Caller owns the font, and should destroy it when done using it)\r
-inline HFONT AtlCreateBoldFont(HFONT hFont = NULL)\r
-{\r
-       if(hFont == NULL)\r
-               hFont = AtlGetDefaultGuiFont();\r
-       ATLASSERT(hFont != NULL);\r
-       HFONT hFontBold = NULL;\r
-       LOGFONT lf = { 0 };\r
-       if(::GetObject(hFont, sizeof(LOGFONT), &lf) == sizeof(LOGFONT))\r
-       {\r
-               lf.lfWeight = FW_BOLD;\r
-               hFontBold =  ::CreateFontIndirect(&lf);\r
-               ATLASSERT(hFontBold != NULL);\r
-       }\r
-       else\r
-       {\r
-               ATLASSERT(FALSE);\r
-       }\r
-       return hFontBold;\r
-}\r
-\r
-// Common Controls initialization helper\r
-inline BOOL AtlInitCommonControls(DWORD dwFlags)\r
-{\r
-       INITCOMMONCONTROLSEX iccx = { sizeof(INITCOMMONCONTROLSEX), dwFlags };\r
-       BOOL bRet = ::InitCommonControlsEx(&iccx);\r
-       ATLASSERT(bRet);\r
-       return bRet;\r
-}\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// RunTimeHelper - helper functions for Windows version and structure sizes\r
-\r
-// Not for Windows CE\r
-#if defined(_WIN32_WCE) && !defined(_WTL_NO_RUNTIME_STRUCT_SIZE)\r
-  #define _WTL_NO_RUNTIME_STRUCT_SIZE\r
-#endif\r
-\r
-#ifndef _WTL_NO_RUNTIME_STRUCT_SIZE\r
-\r
-#ifndef _SIZEOF_STRUCT\r
-  #define _SIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))\r
-#endif\r
-\r
-#if (_WIN32_WINNT >= 0x0600) && !defined(REBARBANDINFO_V6_SIZE)\r
-  #define REBARBANDINFO_V6_SIZE   _SIZEOF_STRUCT(REBARBANDINFO, cxHeader)\r
-#endif // (_WIN32_WINNT >= 0x0600) && !defined(REBARBANDINFO_V6_SIZE)\r
-\r
-#if (_WIN32_WINNT >= 0x0600) && !defined(LVGROUP_V5_SIZE)\r
-  #define LVGROUP_V5_SIZE   _SIZEOF_STRUCT(LVGROUP, uAlign)\r
-#endif // (_WIN32_WINNT >= 0x0600) && !defined(LVGROUP_V5_SIZE)\r
-\r
-#if (_WIN32_WINNT >= 0x0600) && !defined(LVTILEINFO_V5_SIZE)\r
-  #define LVTILEINFO_V5_SIZE   _SIZEOF_STRUCT(LVTILEINFO, puColumns)\r
-#endif // (_WIN32_WINNT >= 0x0600) && !defined(LVTILEINFO_V5_SIZE)\r
-\r
-#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN) && !defined(MCHITTESTINFO_V1_SIZE)\r
-  #define MCHITTESTINFO_V1_SIZE   _SIZEOF_STRUCT(MCHITTESTINFO, st)\r
-#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN) && !defined(MCHITTESTINFO_V1_SIZE)\r
-\r
-#if !defined(_WIN32_WCE) && (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)\r
-  #define NONCLIENTMETRICS_V1_SIZE   _SIZEOF_STRUCT(NONCLIENTMETRICS, lfMessageFont)\r
-#endif // !defined(_WIN32_WCE) && (WINVER >= 0x0600) && !defined(NONCLIENTMETRICS_V1_SIZE)\r
-\r
-#endif // !_WTL_NO_RUNTIME_STRUCT_SIZE\r
-\r
-namespace RunTimeHelper\r
-{\r
-#ifndef _WIN32_WCE\r
-       inline bool IsCommCtrl6()\r
-       {\r
-               DWORD dwMajor = 0, dwMinor = 0;\r
-               HRESULT hRet = ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);\r
-               return (SUCCEEDED(hRet) && (dwMajor >= 6));\r
-       }\r
-\r
-       inline bool IsVista()\r
-       {\r
-               OSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };\r
-               BOOL bRet = ::GetVersionEx(&ovi);\r
-               return ((bRet != FALSE) && (ovi.dwMajorVersion >= 6));\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       inline int SizeOf_REBARBANDINFO()\r
-       {\r
-               int nSize = sizeof(REBARBANDINFO);\r
-#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\r
-               if(!(IsVista() && IsCommCtrl6()))\r
-                       nSize = REBARBANDINFO_V6_SIZE;\r
-#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\r
-               return nSize;\r
-       }\r
-\r
-#if (_WIN32_WINNT >= 0x501)\r
-       inline int SizeOf_LVGROUP()\r
-       {\r
-               int nSize = sizeof(LVGROUP);\r
-#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\r
-               if(!IsVista())\r
-                       nSize = LVGROUP_V5_SIZE;\r
-#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\r
-               return nSize;\r
-       }\r
-\r
-       inline int SizeOf_LVTILEINFO()\r
-       {\r
-               int nSize = sizeof(LVTILEINFO);\r
-#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\r
-               if(!IsVista())\r
-                       nSize = LVTILEINFO_V5_SIZE;\r
-#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (_WIN32_WINNT >= 0x0600)\r
-               return nSize;\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x501)\r
-\r
-       inline int SizeOf_MCHITTESTINFO()\r
-       {\r
-               int nSize = sizeof(MCHITTESTINFO);\r
-#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-               if(!(IsVista() && IsCommCtrl6()))\r
-                       nSize = MCHITTESTINFO_V1_SIZE;\r
-#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-               return nSize;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       inline int SizeOf_NONCLIENTMETRICS()\r
-       {\r
-               int nSize = sizeof(NONCLIENTMETRICS);\r
-#if !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (WINVER >= 0x0600)\r
-               if(!IsVista())\r
-                       nSize = NONCLIENTMETRICS_V1_SIZE;\r
-#endif // !defined(_WTL_NO_RUNTIME_STRUCT_SIZE) && (WINVER >= 0x0600)\r
-               return nSize;\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// ModuleHelper - helper functions for ATL3 and ATL7 module classes\r
-\r
-namespace ModuleHelper\r
-{\r
-       inline HINSTANCE GetModuleInstance()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               return ATL::_AtlBaseModule.GetModuleInstance();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               return ATL::_pModule->GetModuleInstance();\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-\r
-       inline HINSTANCE GetResourceInstance()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               return ATL::_AtlBaseModule.GetResourceInstance();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               return ATL::_pModule->GetResourceInstance();\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-\r
-       inline void AddCreateWndData(ATL::_AtlCreateWndData* pData, void* pObject)\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               ATL::_AtlWinModule.AddCreateWndData(pData, pObject);\r
-#else // !(_ATL_VER >= 0x0700)\r
-               ATL::_pModule->AddCreateWndData(pData, pObject);\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-\r
-       inline void* ExtractCreateWndData()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               return ATL::_AtlWinModule.ExtractCreateWndData();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               return ATL::_pModule->ExtractCreateWndData();\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// SecureHelper - helper functions for VS2005 secure CRT\r
-\r
-namespace SecureHelper\r
-{\r
-       inline void strcpyA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc)\r
-       {\r
-#if _SECURE_ATL\r
-               ATL::Checked::strcpy_s(lpstrDest, cchDest, lpstrSrc);\r
-#else\r
-               if(cchDest > (size_t)lstrlenA(lpstrSrc))\r
-                       ATLVERIFY(lstrcpyA(lpstrDest, lpstrSrc) != NULL);\r
-               else\r
-                       ATLASSERT(FALSE);\r
-#endif\r
-       }\r
-\r
-       inline void strcpyW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc)\r
-       {\r
-#if _SECURE_ATL\r
-               ATL::Checked::wcscpy_s(lpstrDest, cchDest, lpstrSrc);\r
-#else\r
-               if(cchDest > (size_t)lstrlenW(lpstrSrc))\r
-                       ATLVERIFY(lstrcpyW(lpstrDest, lpstrSrc) != NULL);\r
-               else\r
-                       ATLASSERT(FALSE);\r
-#endif\r
-       }\r
-\r
-       inline void strcpy_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc)\r
-       {\r
-#ifdef _UNICODE\r
-               strcpyW_x(lpstrDest, cchDest, lpstrSrc);\r
-#else\r
-               strcpyA_x(lpstrDest, cchDest, lpstrSrc);\r
-#endif\r
-       }\r
-\r
-       inline errno_t strncpyA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc, size_t cchCount)\r
-       {\r
-#if _SECURE_ATL\r
-               return ATL::Checked::strncpy_s(lpstrDest, cchDest, lpstrSrc, cchCount);\r
-#else\r
-               errno_t nRet = 0;\r
-               if(lpstrDest == NULL || cchDest == 0 || lpstrSrc == NULL)\r
-               {\r
-                       nRet = EINVAL;\r
-               }\r
-               else if(cchCount == _TRUNCATE)\r
-               {\r
-                       cchCount = min(cchDest - 1, size_t(lstrlenA(lpstrSrc)));\r
-                       nRet = STRUNCATE;\r
-               }\r
-               else if(cchDest <= cchCount)\r
-               {\r
-                       lpstrDest[0] = 0;\r
-                       nRet = EINVAL;\r
-               }\r
-               if(nRet == 0 || nRet == STRUNCATE)\r
-                       nRet = (lstrcpynA(lpstrDest, lpstrSrc, (int)cchCount + 1) != NULL) ? nRet : EINVAL;\r
-               ATLASSERT(nRet == 0 || nRet == STRUNCATE);\r
-               return nRet;\r
-#endif\r
-       }\r
-\r
-       inline errno_t strncpyW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc, size_t cchCount)\r
-       {\r
-#if _SECURE_ATL\r
-               return ATL::Checked::wcsncpy_s(lpstrDest, cchDest, lpstrSrc, cchCount);\r
-#else\r
-               errno_t nRet = 0;\r
-               if(lpstrDest == NULL || cchDest == 0 || lpstrSrc == NULL)\r
-               {\r
-                       nRet = EINVAL;\r
-               }\r
-               else if(cchCount == _TRUNCATE)\r
-               {\r
-                       cchCount = min(cchDest - 1, size_t(lstrlenW(lpstrSrc)));\r
-                       nRet = STRUNCATE;\r
-               }\r
-               else if(cchDest <= cchCount)\r
-               {\r
-                       lpstrDest[0] = 0;\r
-                       nRet = EINVAL;\r
-               }\r
-               if(nRet == 0 || nRet == STRUNCATE)\r
-                       nRet = (lstrcpynW(lpstrDest, lpstrSrc, (int)cchCount + 1) != NULL) ? nRet : EINVAL;\r
-               ATLASSERT(nRet == 0 || nRet == STRUNCATE);\r
-               return nRet;\r
-#endif\r
-       }\r
-\r
-       inline errno_t strncpy_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc, size_t cchCount)\r
-       {\r
-#ifdef _UNICODE\r
-               return strncpyW_x(lpstrDest, cchDest, lpstrSrc, cchCount);\r
-#else\r
-               return strncpyA_x(lpstrDest, cchDest, lpstrSrc, cchCount);\r
-#endif\r
-       }\r
-\r
-       inline void strcatA_x(char* lpstrDest, size_t cchDest, const char* lpstrSrc)\r
-       {\r
-#if _SECURE_ATL\r
-               ATL::Checked::strcat_s(lpstrDest, cchDest, lpstrSrc);\r
-#else\r
-               if(cchDest > (size_t)lstrlenA(lpstrSrc))\r
-                       ATLVERIFY(lstrcatA(lpstrDest, lpstrSrc) != NULL);\r
-               else\r
-                       ATLASSERT(FALSE);\r
-#endif\r
-       }\r
-\r
-       inline void strcatW_x(wchar_t* lpstrDest, size_t cchDest, const wchar_t* lpstrSrc)\r
-       {\r
-#if _SECURE_ATL\r
-               ATL::Checked::wcscat_s(lpstrDest, cchDest, lpstrSrc);\r
-#else\r
-               if(cchDest > (size_t)lstrlenW(lpstrSrc))\r
-                       ATLVERIFY(lstrcatW(lpstrDest, lpstrSrc) != NULL);\r
-               else\r
-                       ATLASSERT(FALSE);\r
-#endif\r
-       }\r
-\r
-       inline void strcat_x(LPTSTR lpstrDest, size_t cchDest, LPCTSTR lpstrSrc)\r
-       {\r
-#ifdef _UNICODE\r
-               strcatW_x(lpstrDest, cchDest, lpstrSrc);\r
-#else\r
-               strcatA_x(lpstrDest, cchDest, lpstrSrc);\r
-#endif\r
-       }\r
-\r
-       inline void memcpy_x(void* pDest, size_t cbDest, const void* pSrc, size_t cbSrc)\r
-       {\r
-#if _SECURE_ATL\r
-               ATL::Checked::memcpy_s(pDest, cbDest, pSrc, cbSrc);\r
-#else\r
-               if(cbDest >= cbSrc)\r
-                       memcpy(pDest, pSrc, cbSrc);\r
-               else\r
-                       ATLASSERT(FALSE);\r
-#endif\r
-       }\r
-\r
-       inline void memmove_x(void* pDest, size_t cbDest, const void* pSrc, size_t cbSrc)\r
-       {\r
-#if _SECURE_ATL\r
-               ATL::Checked::memmove_s(pDest, cbDest, pSrc, cbSrc);\r
-#else\r
-               if(cbDest >= cbSrc)\r
-                       memmove(pDest, pSrc, cbSrc);\r
-               else\r
-                       ATLASSERT(FALSE);\r
-#endif\r
-       }\r
-\r
-       inline int vsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, va_list args)\r
-       {\r
-#if _SECURE_ATL && !defined(_ATL_MIN_CRT) && !defined(_WIN32_WCE)\r
-               return _vstprintf_s(lpstrBuff, cchBuff, lpstrFormat, args);\r
-#else\r
-               cchBuff;   // Avoid unused argument warning\r
-               return _vstprintf(lpstrBuff, lpstrFormat, args);\r
-#endif\r
-       }\r
-\r
-       inline int wvsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, va_list args)\r
-       {\r
-#if _SECURE_ATL && !defined(_ATL_MIN_CRT) && !defined(_WIN32_WCE)\r
-               return _vstprintf_s(lpstrBuff, cchBuff, lpstrFormat, args);\r
-#else\r
-               cchBuff;   // Avoid unused argument warning\r
-               return ::wvsprintf(lpstrBuff, lpstrFormat, args);\r
-#endif\r
-       }\r
-\r
-       inline int sprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, ...)\r
-       {\r
-               va_list args;\r
-               va_start(args, lpstrFormat);\r
-               int nRes = vsprintf_x(lpstrBuff, cchBuff, lpstrFormat, args);\r
-               va_end(args);\r
-               return nRes;\r
-       }\r
-\r
-       inline int wsprintf_x(LPTSTR lpstrBuff, size_t cchBuff, LPCTSTR lpstrFormat, ...)\r
-       {\r
-               va_list args;\r
-               va_start(args, lpstrFormat);\r
-               int nRes = wvsprintf_x(lpstrBuff, cchBuff, lpstrFormat, args);\r
-               va_end(args);\r
-               return nRes;\r
-       }\r
-}; // namespace SecureHelper\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMessageFilter - Interface for message filter support\r
-\r
-class CMessageFilter\r
-{\r
-public:\r
-       virtual BOOL PreTranslateMessage(MSG* pMsg) = 0;\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CIdleHandler - Interface for idle processing\r
-\r
-class CIdleHandler\r
-{\r
-public:\r
-       virtual BOOL OnIdle() = 0;\r
-};\r
-\r
-#ifndef _ATL_NO_OLD_NAMES\r
-  // for compatilibility with old names only\r
-  typedef CIdleHandler CUpdateUIObject;\r
-  #define DoUpdate OnIdle\r
-#endif // !_ATL_NO_OLD_NAMES\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMessageLoop - message loop implementation\r
-\r
-class CMessageLoop\r
-{\r
-public:\r
-       ATL::CSimpleArray<CMessageFilter*> m_aMsgFilter;\r
-       ATL::CSimpleArray<CIdleHandler*> m_aIdleHandler;\r
-       MSG m_msg;\r
-\r
-// Message filter operations\r
-       BOOL AddMessageFilter(CMessageFilter* pMessageFilter)\r
-       {\r
-               return m_aMsgFilter.Add(pMessageFilter);\r
-       }\r
-\r
-       BOOL RemoveMessageFilter(CMessageFilter* pMessageFilter)\r
-       {\r
-               return m_aMsgFilter.Remove(pMessageFilter);\r
-       }\r
-\r
-// Idle handler operations\r
-       BOOL AddIdleHandler(CIdleHandler* pIdleHandler)\r
-       {\r
-               return m_aIdleHandler.Add(pIdleHandler);\r
-       }\r
-\r
-       BOOL RemoveIdleHandler(CIdleHandler* pIdleHandler)\r
-       {\r
-               return m_aIdleHandler.Remove(pIdleHandler);\r
-       }\r
-\r
-#ifndef _ATL_NO_OLD_NAMES\r
-       // for compatilibility with old names only\r
-       BOOL AddUpdateUI(CIdleHandler* pIdleHandler)\r
-       {\r
-               ATLTRACE2(atlTraceUI, 0, _T("CUpdateUIObject and AddUpdateUI are deprecated. Please change your code to use CIdleHandler and OnIdle\n"));\r
-               return AddIdleHandler(pIdleHandler);\r
-       }\r
-\r
-       BOOL RemoveUpdateUI(CIdleHandler* pIdleHandler)\r
-       {\r
-               ATLTRACE2(atlTraceUI, 0, _T("CUpdateUIObject and RemoveUpdateUI are deprecated. Please change your code to use CIdleHandler and OnIdle\n"));\r
-               return RemoveIdleHandler(pIdleHandler);\r
-       }\r
-#endif // !_ATL_NO_OLD_NAMES\r
-\r
-// message loop\r
-       int Run()\r
-       {\r
-               BOOL bDoIdle = TRUE;\r
-               int nIdleCount = 0;\r
-               BOOL bRet;\r
-\r
-               for(;;)\r
-               {\r
-                       while(bDoIdle && !::PeekMessage(&m_msg, NULL, 0, 0, PM_NOREMOVE))\r
-                       {\r
-                               if(!OnIdle(nIdleCount++))\r
-                                       bDoIdle = FALSE;\r
-                       }\r
-\r
-                       bRet = ::GetMessage(&m_msg, NULL, 0, 0);\r
-\r
-                       if(bRet == -1)\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("::GetMessage returned -1 (error)\n"));\r
-                               continue;   // error, don't process\r
-                       }\r
-                       else if(!bRet)\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("CMessageLoop::Run - exiting\n"));\r
-                               break;   // WM_QUIT, exit message loop\r
-                       }\r
-\r
-                       if(!PreTranslateMessage(&m_msg))\r
-                       {\r
-                               ::TranslateMessage(&m_msg);\r
-                               ::DispatchMessage(&m_msg);\r
-                       }\r
-\r
-                       if(IsIdleMessage(&m_msg))\r
-                       {\r
-                               bDoIdle = TRUE;\r
-                               nIdleCount = 0;\r
-                       }\r
-               }\r
-\r
-               return (int)m_msg.wParam;\r
-       }\r
-\r
-       static BOOL IsIdleMessage(MSG* pMsg)\r
-       {\r
-               // These messages should NOT cause idle processing\r
-               switch(pMsg->message)\r
-               {\r
-               case WM_MOUSEMOVE:\r
-#ifndef _WIN32_WCE\r
-               case WM_NCMOUSEMOVE:\r
-#endif // !_WIN32_WCE\r
-               case WM_PAINT:\r
-               case 0x0118:    // WM_SYSTIMER (caret blink)\r
-                       return FALSE;\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-// Overrideables\r
-       // Override to change message filtering\r
-       virtual BOOL PreTranslateMessage(MSG* pMsg)\r
-       {\r
-               // loop backwards\r
-               for(int i = m_aMsgFilter.GetSize() - 1; i >= 0; i--)\r
-               {\r
-                       CMessageFilter* pMessageFilter = m_aMsgFilter[i];\r
-                       if(pMessageFilter != NULL && pMessageFilter->PreTranslateMessage(pMsg))\r
-                               return TRUE;\r
-               }\r
-               return FALSE;   // not translated\r
-       }\r
-\r
-       // override to change idle processing\r
-       virtual BOOL OnIdle(int /*nIdleCount*/)\r
-       {\r
-               for(int i = 0; i < m_aIdleHandler.GetSize(); i++)\r
-               {\r
-                       CIdleHandler* pIdleHandler = m_aIdleHandler[i];\r
-                       if(pIdleHandler != NULL)\r
-                               pIdleHandler->OnIdle();\r
-               }\r
-               return FALSE;   // don't continue\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStaticDataInitCriticalSectionLock and CWindowCreateCriticalSectionLock\r
-// internal classes to manage critical sections for both ATL3 and ATL7\r
-\r
-class CStaticDataInitCriticalSectionLock\r
-{\r
-public:\r
-#if (_ATL_VER >= 0x0700)\r
-       ATL::CComCritSecLock<ATL::CComCriticalSection> m_cslock;\r
-\r
-       CStaticDataInitCriticalSectionLock() : m_cslock(ATL::_pAtlModule->m_csStaticDataInitAndTypeInfo, false)\r
-       { }\r
-#endif // (_ATL_VER >= 0x0700)\r
-\r
-       HRESULT Lock()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               return m_cslock.Lock();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               ::EnterCriticalSection(&ATL::_pModule->m_csStaticDataInit);\r
-               return S_OK;\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-\r
-       void Unlock()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               m_cslock.Unlock();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               ::LeaveCriticalSection(&ATL::_pModule->m_csStaticDataInit);\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-};\r
-\r
-\r
-class CWindowCreateCriticalSectionLock\r
-{\r
-public:\r
-#if (_ATL_VER >= 0x0700)\r
-       ATL::CComCritSecLock<ATL::CComCriticalSection> m_cslock;\r
-\r
-       CWindowCreateCriticalSectionLock() : m_cslock(ATL::_AtlWinModule.m_csWindowCreate, false)\r
-       { }\r
-#endif // (_ATL_VER >= 0x0700)\r
-\r
-       HRESULT Lock()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               return m_cslock.Lock();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               ::EnterCriticalSection(&ATL::_pModule->m_csWindowCreate);\r
-               return S_OK;\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-\r
-       void Unlock()\r
-       {\r
-#if (_ATL_VER >= 0x0700)\r
-               m_cslock.Unlock();\r
-#else // !(_ATL_VER >= 0x0700)\r
-               ::LeaveCriticalSection(&ATL::_pModule->m_csWindowCreate);\r
-#endif // !(_ATL_VER >= 0x0700)\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTempBuffer - helper class for stack allocations for ATL3\r
-\r
-#ifndef _WTL_STACK_ALLOC_THRESHOLD\r
-  #define _WTL_STACK_ALLOC_THRESHOLD   512\r
-#endif\r
-\r
-#if (_ATL_VER >= 0x0700)\r
-\r
-using ATL::CTempBuffer;\r
-\r
-#else // !(_ATL_VER >= 0x0700)\r
-\r
-#ifndef SIZE_MAX\r
-  #ifdef _WIN64 \r
-    #define SIZE_MAX _UI64_MAX\r
-  #else\r
-    #define SIZE_MAX UINT_MAX\r
-  #endif\r
-#endif\r
-\r
-#pragma warning(disable: 4284)   // warning for operator ->\r
-\r
-template<typename T, int t_nFixedBytes = 128>\r
-class CTempBuffer\r
-{\r
-public:\r
-       CTempBuffer() : m_p(NULL)\r
-       {\r
-       }\r
-\r
-       CTempBuffer(size_t nElements) : m_p(NULL)\r
-       {\r
-               Allocate(nElements);\r
-       }\r
-\r
-       ~CTempBuffer()\r
-       {\r
-               if(m_p != reinterpret_cast<T*>(m_abFixedBuffer))\r
-                       free(m_p);\r
-       }\r
-\r
-       operator T*() const\r
-       {\r
-               return m_p;\r
-       }\r
-\r
-       T* operator ->() const\r
-       {\r
-               ATLASSERT(m_p != NULL);\r
-               return m_p;\r
-       }\r
-\r
-       T* Allocate(size_t nElements)\r
-       {\r
-               ATLASSERT(nElements <= (SIZE_MAX / sizeof(T)));\r
-               return AllocateBytes(nElements * sizeof(T));\r
-       }\r
-\r
-       T* AllocateBytes(size_t nBytes)\r
-       {\r
-               ATLASSERT(m_p == NULL);\r
-               if(nBytes > t_nFixedBytes)\r
-                       m_p = static_cast<T*>(malloc(nBytes));\r
-               else\r
-                       m_p = reinterpret_cast<T*>(m_abFixedBuffer);\r
-\r
-               return m_p;\r
-       }\r
-\r
-private:\r
-       T* m_p;\r
-       BYTE m_abFixedBuffer[t_nFixedBytes];\r
-};\r
-\r
-#pragma warning(default: 4284)\r
-\r
-#endif // !(_ATL_VER >= 0x0700)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppModule - module class for an application\r
-\r
-class CAppModule : public ATL::CComModule\r
-{\r
-public:\r
-       DWORD m_dwMainThreadID;\r
-       ATL::CSimpleMap<DWORD, CMessageLoop*>* m_pMsgLoopMap;\r
-       ATL::CSimpleArray<HWND>* m_pSettingChangeNotify;\r
-\r
-// Overrides of CComModule::Init and Term\r
-       HRESULT Init(ATL::_ATL_OBJMAP_ENTRY* pObjMap, HINSTANCE hInstance, const GUID* pLibID = NULL)\r
-       {\r
-               HRESULT hRet = CComModule::Init(pObjMap, hInstance, pLibID);\r
-               if(FAILED(hRet))\r
-                       return hRet;\r
-\r
-               m_dwMainThreadID = ::GetCurrentThreadId();\r
-               typedef ATL::CSimpleMap<DWORD, CMessageLoop*>   _mapClass;\r
-               m_pMsgLoopMap = NULL;\r
-               ATLTRY(m_pMsgLoopMap = new _mapClass);\r
-               if(m_pMsgLoopMap == NULL)\r
-                       return E_OUTOFMEMORY;\r
-               m_pSettingChangeNotify = NULL;\r
-\r
-               return hRet;\r
-       }\r
-\r
-       void Term()\r
-       {\r
-               TermSettingChangeNotify();\r
-               delete m_pMsgLoopMap;\r
-               CComModule::Term();\r
-       }\r
-\r
-// Message loop map methods\r
-       BOOL AddMessageLoop(CMessageLoop* pMsgLoop)\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::AddMessageLoop.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               ATLASSERT(pMsgLoop != NULL);\r
-               ATLASSERT(m_pMsgLoopMap->Lookup(::GetCurrentThreadId()) == NULL);   // not in map yet\r
-\r
-               BOOL bRet = m_pMsgLoopMap->Add(::GetCurrentThreadId(), pMsgLoop);\r
-\r
-               lock.Unlock();\r
-\r
-               return bRet;\r
-       }\r
-\r
-       BOOL RemoveMessageLoop()\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::RemoveMessageLoop.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               BOOL bRet = m_pMsgLoopMap->Remove(::GetCurrentThreadId());\r
-\r
-               lock.Unlock();\r
-\r
-               return bRet;\r
-       }\r
-\r
-       CMessageLoop* GetMessageLoop(DWORD dwThreadID = ::GetCurrentThreadId()) const\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::GetMessageLoop.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return NULL;\r
-               }\r
-\r
-               CMessageLoop* pLoop =  m_pMsgLoopMap->Lookup(dwThreadID);\r
-\r
-               lock.Unlock();\r
-\r
-               return pLoop;\r
-       }\r
-\r
-// Setting change notify methods\r
-       // Note: Call this from the main thread for MSDI apps\r
-       BOOL InitSettingChangeNotify(DLGPROC pfnDlgProc = _SettingChangeDlgProc)\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::InitSettingChangeNotify.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               if(m_pSettingChangeNotify == NULL)\r
-               {\r
-                       typedef ATL::CSimpleArray<HWND>   _notifyClass;\r
-                       ATLTRY(m_pSettingChangeNotify = new _notifyClass);\r
-                       ATLASSERT(m_pSettingChangeNotify != NULL);\r
-               }\r
-\r
-               BOOL bRet = (m_pSettingChangeNotify != NULL);\r
-               if(bRet && m_pSettingChangeNotify->GetSize() == 0)\r
-               {\r
-                       // init everything\r
-                       _ATL_EMPTY_DLGTEMPLATE templ;\r
-                       HWND hNtfWnd = ::CreateDialogIndirect(GetModuleInstance(), &templ, NULL, pfnDlgProc);\r
-                       ATLASSERT(::IsWindow(hNtfWnd));\r
-                       if(::IsWindow(hNtfWnd))\r
-                       {\r
-// need conditional code because types don't match in winuser.h\r
-#ifdef _WIN64\r
-                               ::SetWindowLongPtr(hNtfWnd, GWLP_USERDATA, (LONG_PTR)this);\r
-#else\r
-                               ::SetWindowLongPtr(hNtfWnd, GWLP_USERDATA, PtrToLong(this));\r
-#endif\r
-                               bRet = m_pSettingChangeNotify->Add(hNtfWnd);\r
-                       }\r
-                       else\r
-                       {\r
-                               bRet = FALSE;\r
-                       }\r
-               }\r
-\r
-               lock.Unlock();\r
-\r
-               return bRet;\r
-       }\r
-\r
-       void TermSettingChangeNotify()\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::TermSettingChangeNotify.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return;\r
-               }\r
-\r
-               if(m_pSettingChangeNotify != NULL && m_pSettingChangeNotify->GetSize() > 0)\r
-                       ::DestroyWindow((*m_pSettingChangeNotify)[0]);\r
-               delete m_pSettingChangeNotify;\r
-               m_pSettingChangeNotify = NULL;\r
-\r
-               lock.Unlock();\r
-       }\r
-\r
-       BOOL AddSettingChangeNotify(HWND hWnd)\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::AddSettingChangeNotify.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               ATLASSERT(::IsWindow(hWnd));\r
-               BOOL bRet = FALSE;\r
-               if(InitSettingChangeNotify() != FALSE)\r
-                       bRet = m_pSettingChangeNotify->Add(hWnd);\r
-\r
-               lock.Unlock();\r
-\r
-               return bRet;\r
-       }\r
-\r
-       BOOL RemoveSettingChangeNotify(HWND hWnd)\r
-       {\r
-               CStaticDataInitCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CAppModule::RemoveSettingChangeNotify.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               BOOL bRet = FALSE;\r
-               if(m_pSettingChangeNotify != NULL)\r
-                       bRet = m_pSettingChangeNotify->Remove(hWnd);\r
-\r
-               lock.Unlock();\r
-\r
-               return bRet;\r
-       }\r
-\r
-// Implementation - setting change notify dialog template and dialog procedure\r
-       struct _ATL_EMPTY_DLGTEMPLATE : DLGTEMPLATE\r
-       {\r
-               _ATL_EMPTY_DLGTEMPLATE()\r
-               {\r
-                       memset(this, 0, sizeof(_ATL_EMPTY_DLGTEMPLATE));\r
-                       style = WS_POPUP;\r
-               }\r
-               WORD wMenu, wClass, wTitle;\r
-       };\r
-\r
-#ifdef _WIN64\r
-       static INT_PTR CALLBACK _SettingChangeDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-#else\r
-       static BOOL CALLBACK _SettingChangeDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-#endif\r
-       {\r
-               if(uMsg == WM_SETTINGCHANGE)\r
-               {\r
-// need conditional code because types don't match in winuser.h\r
-#ifdef _WIN64\r
-                       CAppModule* pModule = (CAppModule*)::GetWindowLongPtr(hWnd, GWLP_USERDATA);\r
-#else\r
-                       CAppModule* pModule = (CAppModule*)LongToPtr(::GetWindowLongPtr(hWnd, GWLP_USERDATA));\r
-#endif\r
-                       ATLASSERT(pModule != NULL);\r
-                       ATLASSERT(pModule->m_pSettingChangeNotify != NULL);\r
-                       const UINT uTimeout = 1500;   // ms\r
-                       for(int i = 1; i < pModule->m_pSettingChangeNotify->GetSize(); i++)\r
-                       {\r
-#if !defined(_WIN32_WCE)\r
-                               ::SendMessageTimeout((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam, SMTO_ABORTIFHUNG, uTimeout, NULL);\r
-#elif(_WIN32_WCE >= 400) // CE specific\r
-                               ::SendMessageTimeout((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam, SMTO_NORMAL, uTimeout, NULL);\r
-#else // _WIN32_WCE < 400 specific\r
-                               uTimeout;\r
-                               ::SendMessage((*pModule->m_pSettingChangeNotify)[i], uMsg, wParam, lParam);\r
-#endif\r
-                       }\r
-                       return TRUE;\r
-               }\r
-               return FALSE;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CServerAppModule - module class for a COM server application\r
-\r
-class CServerAppModule : public CAppModule\r
-{\r
-public:\r
-       HANDLE m_hEventShutdown;\r
-       bool m_bActivity;\r
-       DWORD m_dwTimeOut;\r
-       DWORD m_dwPause;\r
-\r
-// Override of CAppModule::Init\r
-       HRESULT Init(ATL::_ATL_OBJMAP_ENTRY* pObjMap, HINSTANCE hInstance, const GUID* pLibID = NULL)\r
-       {\r
-               m_dwTimeOut = 5000;\r
-               m_dwPause = 1000;\r
-               return CAppModule::Init(pObjMap, hInstance, pLibID);\r
-       }\r
-\r
-       void Term()\r
-       {\r
-               if(m_hEventShutdown != NULL && ::CloseHandle(m_hEventShutdown))\r
-                       m_hEventShutdown = NULL;\r
-               CAppModule::Term();\r
-       }\r
-\r
-// COM Server methods\r
-       LONG Unlock()\r
-       {\r
-               LONG lRet = CComModule::Unlock();\r
-               if(lRet == 0)\r
-               {\r
-                       m_bActivity = true;\r
-                       ::SetEvent(m_hEventShutdown); // tell monitor that we transitioned to zero\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-       void MonitorShutdown()\r
-       {\r
-               for(;;)\r
-               {\r
-                       ::WaitForSingleObject(m_hEventShutdown, INFINITE);\r
-                       DWORD dwWait = 0;\r
-                       do\r
-                       {\r
-                               m_bActivity = false;\r
-                               dwWait = ::WaitForSingleObject(m_hEventShutdown, m_dwTimeOut);\r
-                       }\r
-                       while(dwWait == WAIT_OBJECT_0);\r
-                       // timed out\r
-                       if(!m_bActivity && m_nLockCnt == 0) // if no activity let's really bail\r
-                       {\r
-#if ((_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM)) && defined(_ATL_FREE_THREADED) && !defined(_WIN32_WCE)\r
-                               ::CoSuspendClassObjects();\r
-                               if(!m_bActivity && m_nLockCnt == 0)\r
-#endif\r
-                                       break;\r
-                       }\r
-               }\r
-               // This handle should be valid now. If it isn't, \r
-               // check if _Module.Term was called first (it shouldn't)\r
-               if(::CloseHandle(m_hEventShutdown))\r
-                       m_hEventShutdown = NULL;\r
-               ::PostThreadMessage(m_dwMainThreadID, WM_QUIT, 0, 0);\r
-       }\r
-\r
-       bool StartMonitor()\r
-       {\r
-               m_hEventShutdown = ::CreateEvent(NULL, false, false, NULL);\r
-               if(m_hEventShutdown == NULL)\r
-                       return false;\r
-               DWORD dwThreadID = 0;\r
-#if !defined(_ATL_MIN_CRT) && defined(_MT) && !defined(_WIN32_WCE)\r
-               HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, (UINT (WINAPI*)(void*))MonitorProc, this, 0, (UINT*)&dwThreadID);\r
-#else\r
-               HANDLE hThread = ::CreateThread(NULL, 0, MonitorProc, this, 0, &dwThreadID);\r
-#endif\r
-               bool bRet = (hThread != NULL);\r
-               if(bRet)\r
-                       ::CloseHandle(hThread);\r
-               return bRet;\r
-       }\r
-\r
-       static DWORD WINAPI MonitorProc(void* pv)\r
-       {\r
-               CServerAppModule* p = (CServerAppModule*)pv;\r
-               p->MonitorShutdown();\r
-               return 0;\r
-       }\r
-\r
-#if (_ATL_VER < 0x0700)\r
-       // search for an occurence of string p2 in string p1\r
-       static LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)\r
-       {\r
-               while(p1 != NULL && *p1 != NULL)\r
-               {\r
-                       LPCTSTR p = p2;\r
-                       while(p != NULL && *p != NULL)\r
-                       {\r
-                               if(*p1 == *p)\r
-                                       return ::CharNext(p1);\r
-                               p = ::CharNext(p);\r
-                       }\r
-                       p1 = ::CharNext(p1);\r
-               }\r
-               return NULL;\r
-       }\r
-#endif // (_ATL_VER < 0x0700)\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CString forward reference (enables CString use in atluser.h and atlgdi.h)\r
-\r
-#if defined(_WTL_FORWARD_DECLARE_CSTRING) && !defined(_WTL_USE_CSTRING)\r
-  #define _WTL_USE_CSTRING\r
-#endif // defined(_WTL_FORWARD_DECLARE_CSTRING) && !defined(_WTL_USE_CSTRING)\r
-\r
-#ifdef _WTL_USE_CSTRING\r
-  class CString;   // forward declaration (include atlmisc.h for the whole class)\r
-#endif // _WTL_USE_CSTRING\r
-\r
-// CString namespace\r
-#ifndef _CSTRING_NS\r
-  #ifdef __ATLSTR_H__\r
-    #define _CSTRING_NS        ATL\r
-  #else\r
-    #define _CSTRING_NS        WTL\r
-  #endif\r
-#endif // _CSTRING_NS\r
-\r
-// Type classes namespace\r
-#ifndef _WTYPES_NS\r
-  #ifdef __ATLTYPES_H__\r
-    #define _WTYPES_NS\r
-  #else\r
-    #define _WTYPES_NS WTL\r
-  #endif\r
-#endif // _WTYPES_NS\r
-\r
-}; // namespace WTL\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// General DLL version helpers (excluded from atlbase.h if _ATL_DLL is defined)\r
-\r
-#if (_ATL_VER < 0x0700) && defined(_ATL_DLL) && !defined(_WIN32_WCE)\r
-\r
-namespace ATL\r
-{\r
-\r
-inline HRESULT AtlGetDllVersion(HINSTANCE hInstDLL, DLLVERSIONINFO* pDllVersionInfo)\r
-{\r
-       ATLASSERT(pDllVersionInfo != NULL);\r
-       if(pDllVersionInfo == NULL)\r
-               return E_INVALIDARG;\r
-\r
-       // We must get this function explicitly because some DLLs don't implement it.\r
-       DLLGETVERSIONPROC pfnDllGetVersion = (DLLGETVERSIONPROC)::GetProcAddress(hInstDLL, "DllGetVersion");\r
-       if(pfnDllGetVersion == NULL)\r
-               return E_NOTIMPL;\r
-\r
-       return (*pfnDllGetVersion)(pDllVersionInfo);\r
-}\r
-\r
-inline HRESULT AtlGetDllVersion(LPCTSTR lpstrDllName, DLLVERSIONINFO* pDllVersionInfo)\r
-{\r
-       HINSTANCE hInstDLL = ::LoadLibrary(lpstrDllName);\r
-       if(hInstDLL == NULL)\r
-               return E_FAIL;\r
-       HRESULT hRet = AtlGetDllVersion(hInstDLL, pDllVersionInfo);\r
-       ::FreeLibrary(hInstDLL);\r
-       return hRet;\r
-}\r
-\r
-// Common Control Versions:\r
-//   Win95/WinNT 4.0    maj=4 min=00\r
-//   IE 3.x     maj=4 min=70\r
-//   IE 4.0     maj=4 min=71\r
-inline HRESULT AtlGetCommCtrlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)\r
-{\r
-       ATLASSERT(pdwMajor != NULL && pdwMinor != NULL);\r
-       if(pdwMajor == NULL || pdwMinor == NULL)\r
-               return E_INVALIDARG;\r
-\r
-       DLLVERSIONINFO dvi;\r
-       ::ZeroMemory(&dvi, sizeof(dvi));\r
-       dvi.cbSize = sizeof(dvi);\r
-       HRESULT hRet = AtlGetDllVersion(_T("comctl32.dll"), &dvi);\r
-\r
-       if(SUCCEEDED(hRet))\r
-       {\r
-               *pdwMajor = dvi.dwMajorVersion;\r
-               *pdwMinor = dvi.dwMinorVersion;\r
-       }\r
-       else if(hRet == E_NOTIMPL)\r
-       {\r
-               // If DllGetVersion is not there, then the DLL is a version\r
-               // previous to the one shipped with IE 3.x\r
-               *pdwMajor = 4;\r
-               *pdwMinor = 0;\r
-               hRet = S_OK;\r
-       }\r
-\r
-       return hRet;\r
-}\r
-\r
-// Shell Versions:\r
-//   Win95/WinNT 4.0                    maj=4 min=00\r
-//   IE 3.x, IE 4.0 without Web Integrated Desktop  maj=4 min=00\r
-//   IE 4.0 with Web Integrated Desktop         maj=4 min=71\r
-//   IE 4.01 with Web Integrated Desktop        maj=4 min=72\r
-inline HRESULT AtlGetShellVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)\r
-{\r
-       ATLASSERT(pdwMajor != NULL && pdwMinor != NULL);\r
-       if(pdwMajor == NULL || pdwMinor == NULL)\r
-               return E_INVALIDARG;\r
-\r
-       DLLVERSIONINFO dvi;\r
-       ::ZeroMemory(&dvi, sizeof(dvi));\r
-       dvi.cbSize = sizeof(dvi);\r
-       HRESULT hRet = AtlGetDllVersion(_T("shell32.dll"), &dvi);\r
-\r
-       if(SUCCEEDED(hRet))\r
-       {\r
-               *pdwMajor = dvi.dwMajorVersion;\r
-               *pdwMinor = dvi.dwMinorVersion;\r
-       }\r
-       else if(hRet == E_NOTIMPL)\r
-       {\r
-               // If DllGetVersion is not there, then the DLL is a version\r
-               // previous to the one shipped with IE 4.x\r
-               *pdwMajor = 4;\r
-               *pdwMinor = 0;\r
-               hRet = S_OK;\r
-       }\r
-\r
-       return hRet;\r
-}\r
-\r
-}; // namespace ATL\r
-\r
-#endif // (_ATL_VER < 0x0700) && defined(_ATL_DLL) && !defined(_WIN32_WCE)\r
-\r
-\r
-// These are always included\r
-#include "atlwinx.h"\r
-#include "atluser.h"\r
-#include "atlgdi.h"\r
-\r
-#ifndef _WTL_NO_AUTOMATIC_NAMESPACE\r
-using namespace WTL;\r
-#endif // !_WTL_NO_AUTOMATIC_NAMESPACE\r
-\r
-#endif // __ATLAPP_H__\r
diff --git a/WTL80/include/atlcrack.h b/WTL80/include/atlcrack.h
deleted file mode 100644 (file)
index f92b35a..0000000
+++ /dev/null
@@ -1,2380 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLCRACK_H__\r
-#define __ATLCRACK_H__\r
-\r
-#pragma once\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Message map macro for cracked handlers\r
-\r
-// Note about message maps with cracked handlers:\r
-// For ATL 3.0, a message map using cracked handlers MUST use BEGIN_MSG_MAP_EX.\r
-// For ATL 7.0 or higher, you can use BEGIN_MSG_MAP for CWindowImpl/CDialogImpl derived classes,\r
-// but must use BEGIN_MSG_MAP_EX for classes that don't derive from CWindowImpl/CDialogImpl.\r
-\r
-#define BEGIN_MSG_MAP_EX(theClass) \\r
-public: \\r
-       BOOL m_bMsgHandled; \\r
-       /* "handled" management for cracked handlers */ \\r
-       BOOL IsMsgHandled() const \\r
-       { \\r
-               return m_bMsgHandled; \\r
-       } \\r
-       void SetMsgHandled(BOOL bHandled) \\r
-       { \\r
-               m_bMsgHandled = bHandled; \\r
-       } \\r
-       BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID = 0) \\r
-       { \\r
-               BOOL bOldMsgHandled = m_bMsgHandled; \\r
-               BOOL bRet = _ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, dwMsgMapID); \\r
-               m_bMsgHandled = bOldMsgHandled; \\r
-               return bRet; \\r
-       } \\r
-       BOOL _ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID) \\r
-       { \\r
-               BOOL bHandled = TRUE; \\r
-               hWnd; \\r
-               uMsg; \\r
-               wParam; \\r
-               lParam; \\r
-               lResult; \\r
-               bHandled; \\r
-               switch(dwMsgMapID) \\r
-               { \\r
-               case 0:\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Standard Windows message macros\r
-\r
-// int OnCreate(LPCREATESTRUCT lpCreateStruct)\r
-#define MSG_WM_CREATE(func) \\r
-       if (uMsg == WM_CREATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((LPCREATESTRUCT)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam)\r
-#define MSG_WM_INITDIALOG(func) \\r
-       if (uMsg == WM_INITDIALOG) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HWND)wParam, lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnCopyData(CWindow wnd, PCOPYDATASTRUCT pCopyDataStruct)\r
-#define MSG_WM_COPYDATA(func) \\r
-       if (uMsg == WM_COPYDATA) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HWND)wParam, (PCOPYDATASTRUCT)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDestroy()\r
-#define MSG_WM_DESTROY(func) \\r
-       if (uMsg == WM_DESTROY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMove(CPoint ptPos)\r
-#define MSG_WM_MOVE(func) \\r
-       if (uMsg == WM_MOVE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(_WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSize(UINT nType, CSize size)\r
-#define MSG_WM_SIZE(func) \\r
-       if (uMsg == WM_SIZE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnActivate(UINT nState, BOOL bMinimized, CWindow wndOther)\r
-#define MSG_WM_ACTIVATE(func) \\r
-       if (uMsg == WM_ACTIVATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)LOWORD(wParam), (BOOL)HIWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSetFocus(CWindow wndOld)\r
-#define MSG_WM_SETFOCUS(func) \\r
-       if (uMsg == WM_SETFOCUS) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnKillFocus(CWindow wndFocus)\r
-#define MSG_WM_KILLFOCUS(func) \\r
-       if (uMsg == WM_KILLFOCUS) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnEnable(BOOL bEnable)\r
-#define MSG_WM_ENABLE(func) \\r
-       if (uMsg == WM_ENABLE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPaint(CDCHandle dc)\r
-#define MSG_WM_PAINT(func) \\r
-       if (uMsg == WM_PAINT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HDC)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnClose()\r
-#define MSG_WM_CLOSE(func) \\r
-       if (uMsg == WM_CLOSE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnQueryEndSession(UINT nSource, UINT uLogOff)\r
-#define MSG_WM_QUERYENDSESSION(func) \\r
-       if (uMsg == WM_QUERYENDSESSION) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)wParam, (UINT)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnQueryOpen()\r
-#define MSG_WM_QUERYOPEN(func) \\r
-       if (uMsg == WM_QUERYOPEN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnEraseBkgnd(CDCHandle dc)\r
-#define MSG_WM_ERASEBKGND(func) \\r
-       if (uMsg == WM_ERASEBKGND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSysColorChange()\r
-#define MSG_WM_SYSCOLORCHANGE(func) \\r
-       if (uMsg == WM_SYSCOLORCHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnEndSession(BOOL bEnding, UINT uLogOff)\r
-#define MSG_WM_ENDSESSION(func) \\r
-       if (uMsg == WM_ENDSESSION) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam, (UINT)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnShowWindow(BOOL bShow, UINT nStatus)\r
-#define MSG_WM_SHOWWINDOW(func) \\r
-       if (uMsg == WM_SHOWWINDOW) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam, (int)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnCtlColorEdit(CDCHandle dc, CEdit edit)\r
-#define MSG_WM_CTLCOLOREDIT(func) \\r
-       if (uMsg == WM_CTLCOLOREDIT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnCtlColorListBox(CDCHandle dc, CListBox listBox)\r
-#define MSG_WM_CTLCOLORLISTBOX(func) \\r
-       if (uMsg == WM_CTLCOLORLISTBOX) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnCtlColorBtn(CDCHandle dc, CButton button)\r
-#define MSG_WM_CTLCOLORBTN(func) \\r
-       if (uMsg == WM_CTLCOLORBTN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnCtlColorDlg(CDCHandle dc, CWindow wnd)\r
-#define MSG_WM_CTLCOLORDLG(func) \\r
-       if (uMsg == WM_CTLCOLORDLG) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnCtlColorScrollBar(CDCHandle dc, CScrollBar scrollBar)\r
-#define MSG_WM_CTLCOLORSCROLLBAR(func) \\r
-       if (uMsg == WM_CTLCOLORSCROLLBAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnCtlColorStatic(CDCHandle dc, CStatic wndStatic)\r
-#define MSG_WM_CTLCOLORSTATIC(func) \\r
-       if (uMsg == WM_CTLCOLORSTATIC) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSettingChange(UINT uFlags, LPCTSTR lpszSection)\r
-#define MSG_WM_SETTINGCHANGE(func) \\r
-       if (uMsg == WM_SETTINGCHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPCTSTR)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDevModeChange(LPCTSTR lpDeviceName)\r
-#define MSG_WM_DEVMODECHANGE(func) \\r
-       if (uMsg == WM_DEVMODECHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((LPCTSTR)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnActivateApp(BOOL bActive, DWORD dwThreadID)\r
-#define MSG_WM_ACTIVATEAPP(func) \\r
-       if (uMsg == WM_ACTIVATEAPP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam, (DWORD)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnFontChange()\r
-#define MSG_WM_FONTCHANGE(func) \\r
-       if (uMsg == WM_FONTCHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnTimeChange()\r
-#define MSG_WM_TIMECHANGE(func) \\r
-       if (uMsg == WM_TIMECHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCancelMode()\r
-#define MSG_WM_CANCELMODE(func) \\r
-       if (uMsg == WM_CANCELMODE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnSetCursor(CWindow wnd, UINT nHitTest, UINT message)\r
-#define MSG_WM_SETCURSOR(func) \\r
-       if (uMsg == WM_SETCURSOR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnMouseActivate(CWindow wndTopLevel, UINT nHitTest, UINT message)\r
-#define MSG_WM_MOUSEACTIVATE(func) \\r
-       if (uMsg == WM_MOUSEACTIVATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnChildActivate()\r
-#define MSG_WM_CHILDACTIVATE(func) \\r
-       if (uMsg == WM_CHILDACTIVATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnGetMinMaxInfo(LPMINMAXINFO lpMMI)\r
-#define MSG_WM_GETMINMAXINFO(func) \\r
-       if (uMsg == WM_GETMINMAXINFO) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((LPMINMAXINFO)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnIconEraseBkgnd(CDCHandle dc)\r
-#define MSG_WM_ICONERASEBKGND(func) \\r
-       if (uMsg == WM_ICONERASEBKGND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HDC)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSpoolerStatus(UINT nStatus, UINT nJobs)\r
-#define MSG_WM_SPOOLERSTATUS(func) \\r
-       if (uMsg == WM_SPOOLERSTATUS) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (UINT)LOWORD(lParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)\r
-#define MSG_WM_DRAWITEM(func) \\r
-       if (uMsg == WM_DRAWITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPDRAWITEMSTRUCT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)\r
-#define MSG_WM_MEASUREITEM(func) \\r
-       if (uMsg == WM_MEASUREITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPMEASUREITEMSTRUCT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDeleteItem(int nIDCtl, LPDELETEITEMSTRUCT lpDeleteItemStruct)\r
-#define MSG_WM_DELETEITEM(func) \\r
-       if (uMsg == WM_DELETEITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPDELETEITEMSTRUCT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-//int OnCharToItem(UINT nChar, UINT nIndex, CListBox listBox)\r
-#define MSG_WM_CHARTOITEM(func) \\r
-       if (uMsg == WM_CHARTOITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnVKeyToItem(UINT nKey, UINT nIndex, CListBox listBox)\r
-#define MSG_WM_VKEYTOITEM(func) \\r
-       if (uMsg == WM_VKEYTOITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HCURSOR OnQueryDragIcon()\r
-#define MSG_WM_QUERYDRAGICON(func) \\r
-       if (uMsg == WM_QUERYDRAGICON) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnCompareItem(int nIDCtl, LPCOMPAREITEMSTRUCT lpCompareItemStruct)\r
-#define MSG_WM_COMPAREITEM(func) \\r
-       if (uMsg == WM_COMPAREITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)wParam, (LPCOMPAREITEMSTRUCT)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCompacting(UINT nCpuTime)\r
-#define MSG_WM_COMPACTING(func) \\r
-       if (uMsg == WM_COMPACTING) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct)\r
-#define MSG_WM_NCCREATE(func) \\r
-       if (uMsg == WM_NCCREATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((LPCREATESTRUCT)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcDestroy()\r
-#define MSG_WM_NCDESTROY(func) \\r
-       if (uMsg == WM_NCDESTROY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNcCalcSize(BOOL bCalcValidRects, LPARAM lParam)\r
-#define MSG_WM_NCCALCSIZE(func) \\r
-       if (uMsg == WM_NCCALCSIZE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((BOOL)wParam, lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// UINT OnNcHitTest(CPoint point)\r
-#define MSG_WM_NCHITTEST(func) \\r
-       if (uMsg == WM_NCHITTEST) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func(_WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcPaint(CRgn rgn)\r
-#define MSG_WM_NCPAINT(func) \\r
-       if (uMsg == WM_NCPAINT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HRGN)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnNcActivate(BOOL bActive)\r
-#define MSG_WM_NCACTIVATE(func) \\r
-       if (uMsg == WM_NCACTIVATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((BOOL)wParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// UINT OnGetDlgCode(LPMSG lpMsg)\r
-#define MSG_WM_GETDLGCODE(func) \\r
-       if (uMsg == WM_GETDLGCODE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((LPMSG)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcMouseMove(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCMOUSEMOVE(func) \\r
-       if (uMsg == WM_NCMOUSEMOVE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcLButtonDown(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCLBUTTONDOWN(func) \\r
-       if (uMsg == WM_NCLBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcLButtonUp(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCLBUTTONUP(func) \\r
-       if (uMsg == WM_NCLBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcLButtonDblClk(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCLBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_NCLBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcRButtonDown(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCRBUTTONDOWN(func) \\r
-       if (uMsg == WM_NCRBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcRButtonUp(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCRBUTTONUP(func) \\r
-       if (uMsg == WM_NCRBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcRButtonDblClk(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCRBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_NCRBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcMButtonDown(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCMBUTTONDOWN(func) \\r
-       if (uMsg == WM_NCMBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcMButtonUp(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCMBUTTONUP(func) \\r
-       if (uMsg == WM_NCMBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNcMButtonDblClk(UINT nHitTest, CPoint point)\r
-#define MSG_WM_NCMBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_NCMBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_KEYDOWN(func) \\r
-       if (uMsg == WM_KEYDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_KEYUP(func) \\r
-       if (uMsg == WM_KEYUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_CHAR(func) \\r
-       if (uMsg == WM_CHAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDeadChar(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_DEADCHAR(func) \\r
-       if (uMsg == WM_DEADCHAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_SYSKEYDOWN(func) \\r
-       if (uMsg == WM_SYSKEYDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_SYSKEYUP(func) \\r
-       if (uMsg == WM_SYSKEYUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_SYSCHAR(func) \\r
-       if (uMsg == WM_SYSCHAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSysDeadChar(UINT nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_SYSDEADCHAR(func) \\r
-       if (uMsg == WM_SYSDEADCHAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSysCommand(UINT nID, LPARAM lParam)\r
-#define MSG_WM_SYSCOMMAND(func) \\r
-       if (uMsg == WM_SYSCOMMAND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnTCard(UINT idAction, DWORD dwActionData)\r
-#define MSG_WM_TCARD(func) \\r
-       if (uMsg == WM_TCARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (DWORD)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnTimer(UINT_PTR nIDEvent)\r
-#define MSG_WM_TIMER(func) \\r
-       if (uMsg == WM_TIMER) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT_PTR)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\r
-#define MSG_WM_HSCROLL(func) \\r
-       if (uMsg == WM_HSCROLL) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\r
-#define MSG_WM_VSCROLL(func) \\r
-       if (uMsg == WM_VSCROLL) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnInitMenu(CMenu menu)\r
-#define MSG_WM_INITMENU(func) \\r
-       if (uMsg == WM_INITMENU) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HMENU)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnInitMenuPopup(CMenu menuPopup, UINT nIndex, BOOL bSysMenu)\r
-#define MSG_WM_INITMENUPOPUP(func) \\r
-       if (uMsg == WM_INITMENUPOPUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HMENU)wParam, (UINT)LOWORD(lParam), (BOOL)HIWORD(lParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMenuSelect(UINT nItemID, UINT nFlags, CMenu menu)\r
-#define MSG_WM_MENUSELECT(func) \\r
-       if (uMsg == WM_MENUSELECT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HMENU)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu menu)\r
-#define MSG_WM_MENUCHAR(func) \\r
-       if (uMsg == WM_MENUCHAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((TCHAR)LOWORD(wParam), (UINT)HIWORD(wParam), (HMENU)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNotify(int idCtrl, LPNMHDR pnmh)\r
-#define MSG_WM_NOTIFY(func) \\r
-       if (uMsg == WM_NOTIFY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnEnterIdle(UINT nWhy, CWindow wndWho)\r
-#define MSG_WM_ENTERIDLE(func) \\r
-       if (uMsg == WM_ENTERIDLE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMouseMove(UINT nFlags, CPoint point)\r
-#define MSG_WM_MOUSEMOVE(func) \\r
-       if (uMsg == WM_MOUSEMOVE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)\r
-#define MSG_WM_MOUSEWHEEL(func) \\r
-       if (uMsg == WM_MOUSEWHEEL) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)LOWORD(wParam), (short)HIWORD(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnLButtonDown(UINT nFlags, CPoint point)\r
-#define MSG_WM_LBUTTONDOWN(func) \\r
-       if (uMsg == WM_LBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnLButtonUp(UINT nFlags, CPoint point)\r
-#define MSG_WM_LBUTTONUP(func) \\r
-       if (uMsg == WM_LBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnLButtonDblClk(UINT nFlags, CPoint point)\r
-#define MSG_WM_LBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_LBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnRButtonDown(UINT nFlags, CPoint point)\r
-#define MSG_WM_RBUTTONDOWN(func) \\r
-       if (uMsg == WM_RBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnRButtonUp(UINT nFlags, CPoint point)\r
-#define MSG_WM_RBUTTONUP(func) \\r
-       if (uMsg == WM_RBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnRButtonDblClk(UINT nFlags, CPoint point)\r
-#define MSG_WM_RBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_RBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMButtonDown(UINT nFlags, CPoint point)\r
-#define MSG_WM_MBUTTONDOWN(func) \\r
-       if (uMsg == WM_MBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMButtonUp(UINT nFlags, CPoint point)\r
-#define MSG_WM_MBUTTONUP(func) \\r
-       if (uMsg == WM_MBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMButtonDblClk(UINT nFlags, CPoint point)\r
-#define MSG_WM_MBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_MBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnParentNotify(UINT message, UINT nChildID, LPARAM lParam)\r
-#define MSG_WM_PARENTNOTIFY(func) \\r
-       if (uMsg == WM_PARENTNOTIFY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMDIActivate(CWindow wndActivate, CWindow wndDeactivate)\r
-#define MSG_WM_MDIACTIVATE(func) \\r
-       if (uMsg == WM_MDIACTIVATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnRenderFormat(UINT nFormat)\r
-#define MSG_WM_RENDERFORMAT(func) \\r
-       if (uMsg == WM_RENDERFORMAT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnRenderAllFormats()\r
-#define MSG_WM_RENDERALLFORMATS(func) \\r
-       if (uMsg == WM_RENDERALLFORMATS) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDestroyClipboard()\r
-#define MSG_WM_DESTROYCLIPBOARD(func) \\r
-       if (uMsg == WM_DESTROYCLIPBOARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDrawClipboard()\r
-#define MSG_WM_DRAWCLIPBOARD(func) \\r
-       if (uMsg == WM_DRAWCLIPBOARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPaintClipboard(CWindow wndViewer, const LPPAINTSTRUCT lpPaintStruct)\r
-#define MSG_WM_PAINTCLIPBOARD(func) \\r
-       if (uMsg == WM_PAINTCLIPBOARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, (const LPPAINTSTRUCT)::GlobalLock((HGLOBAL)lParam)); \\r
-               ::GlobalUnlock((HGLOBAL)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnVScrollClipboard(CWindow wndViewer, UINT nSBCode, UINT nPos)\r
-#define MSG_WM_VSCROLLCLIPBOARD(func) \\r
-       if (uMsg == WM_VSCROLLCLIPBOARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnContextMenu(CWindow wnd, CPoint point)\r
-#define MSG_WM_CONTEXTMENU(func) \\r
-       if (uMsg == WM_CONTEXTMENU) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSizeClipboard(CWindow wndViewer, const LPRECT lpRect)\r
-#define MSG_WM_SIZECLIPBOARD(func) \\r
-       if (uMsg == WM_SIZECLIPBOARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, (const LPRECT)::GlobalLock((HGLOBAL)lParam)); \\r
-               ::GlobalUnlock((HGLOBAL)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnAskCbFormatName(UINT nMaxCount, LPTSTR lpszString)\r
-#define MSG_WM_ASKCBFORMATNAME(func) \\r
-       if (uMsg == WM_ASKCBFORMATNAME) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((DWORD)wParam, (LPTSTR)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnChangeCbChain(CWindow wndRemove, CWindow wndAfter)\r
-#define MSG_WM_CHANGECBCHAIN(func) \\r
-       if (uMsg == WM_CHANGECBCHAIN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnHScrollClipboard(CWindow wndViewer, UINT nSBCode, UINT nPos)\r
-#define MSG_WM_HSCROLLCLIPBOARD(func) \\r
-       if (uMsg == WM_HSCROLLCLIPBOARD) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnQueryNewPalette()\r
-#define MSG_WM_QUERYNEWPALETTE(func) \\r
-       if (uMsg == WM_QUERYNEWPALETTE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPaletteChanged(CWindow wndFocus)\r
-#define MSG_WM_PALETTECHANGED(func) \\r
-       if (uMsg == WM_PALETTECHANGED) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPaletteIsChanging(CWindow wndPalChg)\r
-#define MSG_WM_PALETTEISCHANGING(func) \\r
-       if (uMsg == WM_PALETTEISCHANGING) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDropFiles(HDROP hDropInfo)\r
-#define MSG_WM_DROPFILES(func) \\r
-       if (uMsg == WM_DROPFILES) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HDROP)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnWindowPosChanging(LPWINDOWPOS lpWndPos)\r
-#define MSG_WM_WINDOWPOSCHANGING(func) \\r
-       if (uMsg == WM_WINDOWPOSCHANGING) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((LPWINDOWPOS)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnWindowPosChanged(LPWINDOWPOS lpWndPos)\r
-#define MSG_WM_WINDOWPOSCHANGED(func) \\r
-       if (uMsg == WM_WINDOWPOSCHANGED) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((LPWINDOWPOS)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnExitMenuLoop(BOOL fIsTrackPopupMenu)\r
-#define MSG_WM_EXITMENULOOP(func) \\r
-       if (uMsg == WM_EXITMENULOOP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnEnterMenuLoop(BOOL fIsTrackPopupMenu)\r
-#define MSG_WM_ENTERMENULOOP(func) \\r
-       if (uMsg == WM_ENTERMENULOOP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct)\r
-#define MSG_WM_STYLECHANGED(func) \\r
-       if (uMsg == WM_STYLECHANGED) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPSTYLESTRUCT)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnStyleChanging(int nStyleType, LPSTYLESTRUCT lpStyleStruct)\r
-#define MSG_WM_STYLECHANGING(func) \\r
-       if (uMsg == WM_STYLECHANGING) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPSTYLESTRUCT)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSizing(UINT fwSide, LPRECT pRect)\r
-#define MSG_WM_SIZING(func) \\r
-       if (uMsg == WM_SIZING) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPRECT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMoving(UINT fwSide, LPRECT pRect)\r
-#define MSG_WM_MOVING(func) \\r
-       if (uMsg == WM_MOVING) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPRECT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCaptureChanged(CWindow wnd)\r
-#define MSG_WM_CAPTURECHANGED(func) \\r
-       if (uMsg == WM_CAPTURECHANGED) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnDeviceChange(UINT nEventType, DWORD dwData)\r
-#define MSG_WM_DEVICECHANGE(func) \\r
-       if (uMsg == WM_DEVICECHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)wParam, (DWORD)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCommand(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define MSG_WM_COMMAND(func) \\r
-       if (uMsg == WM_COMMAND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDisplayChange(UINT uBitsPerPixel, CSize sizeScreen)\r
-#define MSG_WM_DISPLAYCHANGE(func) \\r
-       if (uMsg == WM_DISPLAYCHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, _WTYPES_NS::CSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnEnterSizeMove()\r
-#define MSG_WM_ENTERSIZEMOVE(func) \\r
-       if (uMsg == WM_ENTERSIZEMOVE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnExitSizeMove()\r
-#define MSG_WM_EXITSIZEMOVE(func) \\r
-       if (uMsg == WM_EXITSIZEMOVE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HFONT OnGetFont()\r
-#define MSG_WM_GETFONT(func) \\r
-       if (uMsg == WM_GETFONT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnGetHotKey()\r
-#define MSG_WM_GETHOTKEY(func) \\r
-       if (uMsg == WM_GETHOTKEY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HICON OnGetIcon()\r
-#define MSG_WM_GETICON(func) \\r
-       if (uMsg == WM_GETICON) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)wParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnGetText(int cchTextMax, LPTSTR lpszText)\r
-#define MSG_WM_GETTEXT(func) \\r
-       if (uMsg == WM_GETTEXT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((int)wParam, (LPTSTR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnGetTextLength()\r
-#define MSG_WM_GETTEXTLENGTH(func) \\r
-       if (uMsg == WM_GETTEXTLENGTH) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnHelp(LPHELPINFO lpHelpInfo)\r
-#define MSG_WM_HELP(func) \\r
-       if (uMsg == WM_HELP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((LPHELPINFO)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnHotKey(int nHotKeyID, UINT uModifiers, UINT uVirtKey)\r
-#define MSG_WM_HOTKEY(func) \\r
-       if (uMsg == WM_HOTKEY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((int)wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnInputLangChange(DWORD dwCharSet, HKL hKbdLayout)\r
-#define MSG_WM_INPUTLANGCHANGE(func) \\r
-       if (uMsg == WM_INPUTLANGCHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((DWORD)wParam, (HKL)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnInputLangChangeRequest(BOOL bSysCharSet, HKL hKbdLayout)\r
-#define MSG_WM_INPUTLANGCHANGEREQUEST(func) \\r
-       if (uMsg == WM_INPUTLANGCHANGEREQUEST) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam, (HKL)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNextDlgCtl(BOOL bHandle, WPARAM wCtlFocus)\r
-#define MSG_WM_NEXTDLGCTL(func) \\r
-       if (uMsg == WM_NEXTDLGCTL) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)LOWORD(lParam), wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNextMenu(int nVirtKey, LPMDINEXTMENU lpMdiNextMenu)\r
-#define MSG_WM_NEXTMENU(func) \\r
-       if (uMsg == WM_NEXTMENU) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((int)wParam, (LPMDINEXTMENU)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnNotifyFormat(CWindow wndFrom, int nCommand)\r
-#define MSG_WM_NOTIFYFORMAT(func) \\r
-       if (uMsg == WM_NOTIFYFORMAT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HWND)wParam, (int)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// BOOL OnPowerBroadcast(DWORD dwPowerEvent, DWORD dwData)\r
-#define MSG_WM_POWERBROADCAST(func) \\r
-       if (uMsg == WM_POWERBROADCAST) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((DWORD)wParam, (DWORD)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPrint(CDCHandle dc, UINT uFlags)\r
-#define MSG_WM_PRINT(func) \\r
-       if (uMsg == WM_PRINT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HDC)wParam, (UINT)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPrintClient(CDCHandle dc, UINT uFlags)\r
-#define MSG_WM_PRINTCLIENT(func) \\r
-       if (uMsg == WM_PRINTCLIENT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HDC)wParam, (UINT)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnRasDialEvent(RASCONNSTATE rasconnstate, DWORD dwError)\r
-#define MSG_WM_RASDIALEVENT(func) \\r
-       if (uMsg == WM_RASDIALEVENT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((RASCONNSTATE)wParam, (DWORD)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSetFont(CFont font, BOOL bRedraw)\r
-#define MSG_WM_SETFONT(func) \\r
-       if (uMsg == WM_SETFONT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((HFONT)wParam, (BOOL)LOWORD(lParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnSetHotKey(int nVirtKey, UINT uFlags)\r
-#define MSG_WM_SETHOTKEY(func) \\r
-       if (uMsg == WM_SETHOTKEY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((int)LOBYTE(LOWORD(wParam)), (UINT)HIBYTE(LOWORD(wParam))); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HICON OnSetIcon(UINT uType, HICON hIcon)\r
-#define MSG_WM_SETICON(func) \\r
-       if (uMsg == WM_SETICON) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)wParam, (HICON)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnSetRedraw(BOOL bRedraw)\r
-#define MSG_WM_SETREDRAW(func) \\r
-       if (uMsg == WM_SETREDRAW) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((BOOL)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnSetText(LPCTSTR lpstrText)\r
-#define MSG_WM_SETTEXT(func) \\r
-       if (uMsg == WM_SETTEXT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((LPCTSTR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnUserChanged()\r
-#define MSG_WM_USERCHANGED(func) \\r
-       if (uMsg == WM_USERCHANGED) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// New NT4 & NT5 messages\r
-\r
-#if(_WIN32_WINNT >= 0x0400)\r
-\r
-// void OnMouseHover(WPARAM wParam, CPoint ptPos)\r
-#define MSG_WM_MOUSEHOVER(func) \\r
-       if (uMsg == WM_MOUSEHOVER) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(wParam, _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMouseLeave()\r
-#define MSG_WM_MOUSELEAVE(func) \\r
-       if (uMsg == WM_MOUSELEAVE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#endif /* _WIN32_WINNT >= 0x0400 */\r
-\r
-#if(WINVER >= 0x0500)\r
-\r
-// void OnMenuRButtonUp(WPARAM wParam, CMenu menu)\r
-#define MSG_WM_MENURBUTTONUP(func) \\r
-       if (uMsg == WM_MENURBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(wParam, (HMENU)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnMenuDrag(WPARAM wParam, CMenu menu)\r
-#define MSG_WM_MENUDRAG(func) \\r
-       if (uMsg == WM_MENUDRAG) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func(wParam, (HMENU)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnMenuGetObject(PMENUGETOBJECTINFO info)\r
-#define MSG_WM_MENUGETOBJECT(func) \\r
-       if (uMsg == WM_MENUGETOBJECT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((PMENUGETOBJECTINFO)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnUnInitMenuPopup(UINT nID, CMenu menu)\r
-#define MSG_WM_UNINITMENUPOPUP(func) \\r
-       if (uMsg == WM_UNINITMENUPOPUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(lParam), (HMENU)wParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnMenuCommand(WPARAM nIndex, CMenu menu)\r
-#define MSG_WM_MENUCOMMAND(func) \\r
-       if (uMsg == WM_MENUCOMMAND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(wParam, (HMENU)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#endif /* WINVER >= 0x0500 */\r
-\r
-#if(_WIN32_WINNT >= 0x0500)\r
-\r
-// BOOL OnAppCommand(CWindow wndFocus, short cmd, WORD uDevice, int dwKeys)\r
-#define MSG_WM_APPCOMMAND(func) \\r
-       if (uMsg == WM_APPCOMMAND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HWND)wParam, GET_APPCOMMAND_LPARAM(lParam), GET_DEVICE_LPARAM(lParam), GET_KEYSTATE_LPARAM(lParam)); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNCXButtonDown(int fwButton, short nHittest, CPoint ptPos)\r
-#define MSG_WM_NCXBUTTONDOWN(func) \\r
-       if (uMsg == WM_NCXBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNCXButtonUp(int fwButton, short nHittest, CPoint ptPos)\r
-#define MSG_WM_NCXBUTTONUP(func) \\r
-       if (uMsg == WM_NCXBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnNCXButtonDblClk(int fwButton, short nHittest, CPoint ptPos)\r
-#define MSG_WM_NCXBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_NCXBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_XBUTTON_WPARAM(wParam), GET_NCHITTEST_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnXButtonDown(int fwButton, int dwKeys, CPoint ptPos)\r
-#define MSG_WM_XBUTTONDOWN(func) \\r
-       if (uMsg == WM_XBUTTONDOWN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnXButtonUp(int fwButton, int dwKeys, CPoint ptPos)\r
-#define MSG_WM_XBUTTONUP(func) \\r
-       if (uMsg == WM_XBUTTONUP) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnXButtonDblClk(int fwButton, int dwKeys, CPoint ptPos)\r
-#define MSG_WM_XBUTTONDBLCLK(func) \\r
-       if (uMsg == WM_XBUTTONDBLCLK) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_XBUTTON_WPARAM(wParam), GET_KEYSTATE_WPARAM(wParam), _WTYPES_NS::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnChangeUIState(WORD nAction, WORD nState)\r
-#define MSG_WM_CHANGEUISTATE(func) \\r
-       if (uMsg == WM_CHANGEUISTATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(LOWORD(wParam), HIWORD(wParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnUpdateUIState(WORD nAction, WORD nState)\r
-#define MSG_WM_UPDATEUISTATE(func) \\r
-       if (uMsg == WM_UPDATEUISTATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(LOWORD(wParam), HIWORD(wParam)); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnQueryUIState()\r
-#define MSG_WM_QUERYUISTATE(func) \\r
-       if (uMsg == WM_QUERYUISTATE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#endif // (_WIN32_WINNT >= 0x0500)\r
-\r
-#if(_WIN32_WINNT >= 0x0501)\r
-\r
-// void OnInput(WPARAM RawInputCode, HRAWINPUT hRawInput)\r
-#define MSG_WM_INPUT(func) \\r
-       if (uMsg == WM_INPUT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(GET_RAWINPUT_CODE_WPARAM(wParam), (HRAWINPUT)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnUniChar(TCHAR nChar, UINT nRepCnt, UINT nFlags)\r
-#define MSG_WM_UNICHAR(func) \\r
-       if (uMsg == WM_UNICHAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((TCHAR)wParam, (UINT)lParam & 0xFFFF, (UINT)((lParam & 0xFFFF0000) >> 16)); \\r
-               if(IsMsgHandled()) \\r
-               { \\r
-                       lResult = (wParam == UNICODE_NOCHAR) ? TRUE : FALSE; \\r
-                       return TRUE; \\r
-               } \\r
-       }\r
-\r
-// void OnWTSSessionChange(WPARAM nStatusCode, PWTSSESSION_NOTIFICATION nSessionID)\r
-#define MSG_WM_WTSSESSION_CHANGE(func) \\r
-       if (uMsg == WM_WTSSESSION_CHANGE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(wParam, (PWTSSESSION_NOTIFICATION)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// OnThemeChanged()\r
-#define MSG_WM_THEMECHANGED(func) \\r
-       if (uMsg == WM_THEMECHANGED) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#endif /* _WIN32_WINNT >= 0x0501 */\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// ATL defined messages\r
-\r
-// BOOL OnForwardMsg(LPMSG Msg, DWORD nUserData)\r
-#define MSG_WM_FORWARDMSG(func) \\r
-       if (uMsg == WM_FORWARDMSG) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((LPMSG)lParam, (DWORD)wParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Dialog specific messages\r
-\r
-// LRESULT OnDMGetDefID()\r
-#define MSG_DM_GETDEFID(func) \\r
-       if (uMsg == DM_GETDEFID) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func(); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDMSetDefID(UINT DefID)\r
-#define MSG_DM_SETDEFID(func) \\r
-       if (uMsg == DM_SETDEFID) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnDMReposition()\r
-#define MSG_DM_REPOSITION(func) \\r
-       if (uMsg == DM_REPOSITION) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Reflected messages\r
-\r
-// void OnReflectedCommand(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define MSG_OCM_COMMAND(func) \\r
-       if (uMsg == OCM_COMMAND) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedNotify(int idCtrl, LPNMHDR pnmh)\r
-#define MSG_OCM_NOTIFY(func) \\r
-       if (uMsg == OCM_NOTIFY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedParentNotify(UINT message, UINT nChildID, LPARAM lParam)\r
-#define MSG_OCM_PARENTNOTIFY(func) \\r
-       if (uMsg == OCM_PARENTNOTIFY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)\r
-#define MSG_OCM_DRAWITEM(func) \\r
-       if (uMsg == OCM_DRAWITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPDRAWITEMSTRUCT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)\r
-#define MSG_OCM_MEASUREITEM(func) \\r
-       if (uMsg == OCM_MEASUREITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPMEASUREITEMSTRUCT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnReflectedCompareItem(int nIDCtl, LPCOMPAREITEMSTRUCT lpCompareItemStruct)\r
-#define MSG_OCM_COMPAREITEM(func) \\r
-       if (uMsg == OCM_COMPAREITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)wParam, (LPCOMPAREITEMSTRUCT)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedDeleteItem(int nIDCtl, LPDELETEITEMSTRUCT lpDeleteItemStruct)\r
-#define MSG_OCM_DELETEITEM(func) \\r
-       if (uMsg == OCM_DELETEITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)wParam, (LPDELETEITEMSTRUCT)lParam); \\r
-               lResult = TRUE; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// int OnReflectedVKeyToItem(UINT nKey, UINT nIndex, CListBox listBox)\r
-#define MSG_OCM_VKEYTOITEM(func) \\r
-       if (uMsg == OCM_VKEYTOITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-//int OnReflectedCharToItem(UINT nChar, UINT nIndex, CListBox listBox)\r
-#define MSG_OCM_CHARTOITEM(func) \\r
-       if (uMsg == OCM_CHARTOITEM) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedHScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\r
-#define MSG_OCM_HSCROLL(func) \\r
-       if (uMsg == OCM_HSCROLL) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedVScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar)\r
-#define MSG_OCM_VSCROLL(func) \\r
-       if (uMsg == OCM_VSCROLL) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((int)LOWORD(wParam), (short)HIWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnReflectedCtlColorEdit(CDCHandle dc, CEdit edit)\r
-#define MSG_OCM_CTLCOLOREDIT(func) \\r
-       if (uMsg == OCM_CTLCOLOREDIT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnReflectedCtlColorListBox(CDCHandle dc, CListBox listBox)\r
-#define MSG_OCM_CTLCOLORLISTBOX(func) \\r
-       if (uMsg == OCM_CTLCOLORLISTBOX) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnReflectedCtlColorBtn(CDCHandle dc, CButton button)\r
-#define MSG_OCM_CTLCOLORBTN(func) \\r
-       if (uMsg == OCM_CTLCOLORBTN) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnReflectedCtlColorDlg(CDCHandle dc, CWindow wnd)\r
-#define MSG_OCM_CTLCOLORDLG(func) \\r
-       if (uMsg == OCM_CTLCOLORDLG) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnReflectedCtlColorScrollBar(CDCHandle dc, CScrollBar scrollBar)\r
-#define MSG_OCM_CTLCOLORSCROLLBAR(func) \\r
-       if (uMsg == OCM_CTLCOLORSCROLLBAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// HBRUSH OnReflectedCtlColorStatic(CDCHandle dc, CStatic wndStatic)\r
-#define MSG_OCM_CTLCOLORSTATIC(func) \\r
-       if (uMsg == OCM_CTLCOLORSTATIC) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = (LRESULT)func((HDC)wParam, (HWND)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Edit specific messages\r
-\r
-// void OnClear()\r
-#define MSG_WM_CLEAR(func) \\r
-       if (uMsg == WM_CLEAR) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCopy()\r
-#define MSG_WM_COPY(func) \\r
-       if (uMsg == WM_COPY) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCut()\r
-#define MSG_WM_CUT(func) \\r
-       if (uMsg == WM_CUT) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnPaste()\r
-#define MSG_WM_PASTE(func) \\r
-       if (uMsg == WM_PASTE) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnUndo()\r
-#define MSG_WM_UNDO(func) \\r
-       if (uMsg == WM_UNDO) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func(); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Generic message handlers\r
-\r
-// LRESULT OnMessageHandlerEX(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-#define MESSAGE_HANDLER_EX(msg, func) \\r
-       if(uMsg == msg) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func(uMsg, wParam, lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnMessageRangeHandlerEX(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-#define MESSAGE_RANGE_HANDLER_EX(msgFirst, msgLast, func) \\r
-       if(uMsg >= msgFirst && uMsg <= msgLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func(uMsg, wParam, lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Commands and notifications\r
-\r
-// void OnCommandHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define COMMAND_HANDLER_EX(id, code, func) \\r
-       if (uMsg == WM_COMMAND && code == HIWORD(wParam) && id == LOWORD(wParam)) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define COMMAND_ID_HANDLER_EX(id, func) \\r
-       if (uMsg == WM_COMMAND && id == LOWORD(wParam)) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCommandCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define COMMAND_CODE_HANDLER_EX(code, func) \\r
-       if (uMsg == WM_COMMAND && code == HIWORD(wParam)) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNotifyHandlerEX(LPNMHDR pnmh)\r
-#define NOTIFY_HANDLER_EX(id, cd, func) \\r
-       if (uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code && id == ((LPNMHDR)lParam)->idFrom) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNotifyIDHandlerEX(LPNMHDR pnmh)\r
-#define NOTIFY_ID_HANDLER_EX(id, func) \\r
-       if (uMsg == WM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNotifyCodeHandlerEX(LPNMHDR pnmh)\r
-#define NOTIFY_CODE_HANDLER_EX(cd, func) \\r
-       if (uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCommandRangeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define COMMAND_RANGE_HANDLER_EX(idFirst, idLast, func) \\r
-       if(uMsg == WM_COMMAND && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnCommandRangeCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define COMMAND_RANGE_CODE_HANDLER_EX(idFirst, idLast, code, func) \\r
-       if(uMsg == WM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNotifyRangeHandlerEX(LPNMHDR pnmh)\r
-#define NOTIFY_RANGE_HANDLER_EX(idFirst, idLast, func) \\r
-       if(uMsg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnNotifyRangeCodeHandlerEX(LPNMHDR pnmh)\r
-#define NOTIFY_RANGE_CODE_HANDLER_EX(idFirst, idLast, cd, func) \\r
-       if(uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedCommandHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define REFLECTED_COMMAND_HANDLER_EX(id, code, func) \\r
-       if (uMsg == OCM_COMMAND && code == HIWORD(wParam) && id == LOWORD(wParam)) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define REFLECTED_COMMAND_ID_HANDLER_EX(id, func) \\r
-       if (uMsg == OCM_COMMAND && id == LOWORD(wParam)) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedCommandCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define REFLECTED_COMMAND_CODE_HANDLER_EX(code, func) \\r
-       if (uMsg == OCM_COMMAND && code == HIWORD(wParam)) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedNotifyHandlerEX(LPNMHDR pnmh)\r
-#define REFLECTED_NOTIFY_HANDLER_EX(id, cd, func) \\r
-       if (uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code && id == ((LPNMHDR)lParam)->idFrom) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedNotifyIDHandlerEX(LPNMHDR pnmh)\r
-#define REFLECTED_NOTIFY_ID_HANDLER_EX(id, func) \\r
-       if (uMsg == OCM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedNotifyCodeHandlerEX(LPNMHDR pnmh)\r
-#define REFLECTED_NOTIFY_CODE_HANDLER_EX(cd, func) \\r
-       if (uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedCommandRangeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define REFLECTED_COMMAND_RANGE_HANDLER_EX(idFirst, idLast, func) \\r
-       if(uMsg == OCM_COMMAND && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// void OnReflectedCommandRangeCodeHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)\r
-#define REFLECTED_COMMAND_RANGE_CODE_HANDLER_EX(idFirst, idLast, code, func) \\r
-       if(uMsg == OCM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               func((UINT)HIWORD(wParam), (int)LOWORD(wParam), (HWND)lParam); \\r
-               lResult = 0; \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedNotifyRangeHandlerEX(LPNMHDR pnmh)\r
-#define REFLECTED_NOTIFY_RANGE_HANDLER_EX(idFirst, idLast, func) \\r
-       if(uMsg == OCM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-// LRESULT OnReflectedNotifyRangeCodeHandlerEX(LPNMHDR pnmh)\r
-#define REFLECTED_NOTIFY_RANGE_CODE_HANDLER_EX(idFirst, idLast, cd, func) \\r
-       if(uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               SetMsgHandled(TRUE); \\r
-               lResult = func((LPNMHDR)lParam); \\r
-               if(IsMsgHandled()) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#endif // __ATLCRACK_H__\r
diff --git a/WTL80/include/atlctrls.h b/WTL80/include/atlctrls.h
deleted file mode 100644 (file)
index 338f51d..0000000
+++ /dev/null
@@ -1,10039 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLCTRLS_H__\r
-#define __ATLCTRLS_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlctrls.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atlctrls.h requires atlwin.h to be included first\r
-#endif\r
-\r
-#if (_WIN32_IE < 0x0300)\r
-       #error atlctrls.h requires IE Version 3.0 or higher\r
-#endif\r
-\r
-#ifndef _WIN32_WCE\r
-  #include <richedit.h>\r
-  #include <richole.h>\r
-#elif defined(WIN32_PLATFORM_WFSP) && !defined(_WINUSERM_H_)\r
-  #include <winuserm.h>\r
-#endif // !_WIN32_WCE\r
-\r
-// protect template members from windowsx.h macros\r
-#ifdef _INC_WINDOWSX\r
-  #undef GetNextSibling\r
-  #undef GetPrevSibling\r
-#endif // _INC_WINDOWSX\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CStaticT<TBase> - CStatic\r
-// CButtonT<TBase> - CButton\r
-// CListBoxT<TBase> - CListBox\r
-// CComboBoxT<TBase> - CComboBox\r
-// CEditT<TBase> - CEdit\r
-// CEditCommands<T>\r
-// CScrollBarT<TBase> - CScrollBar\r
-//\r
-// CImageList\r
-// CListViewCtrlT<TBase> - CListViewCtrl\r
-// CTreeViewCtrlT<TBase> - CTreeViewCtrl\r
-// CTreeItemT<TBase> - CTreeItem\r
-// CTreeViewCtrlExT<TBase> - CTreeViewCtrlEx\r
-// CHeaderCtrlT<TBase> - CHeaderCtrl\r
-// CToolBarCtrlT<TBase> - CToolBarCtrl\r
-// CStatusBarCtrlT<TBase> - CStatusBarCtrl\r
-// CTabCtrlT<TBase> - CTabCtrl\r
-// CToolInfo\r
-// CToolTipCtrlT<TBase> - CToolTipCtrl\r
-// CTrackBarCtrlT<TBase> - CTrackBarCtrl\r
-// CUpDownCtrlT<TBase> - CUpDownCtrl\r
-// CProgressBarCtrlT<TBase> - CProgressBarCtrl\r
-// CHotKeyCtrlT<TBase> - CHotKeyCtrl\r
-// CAnimateCtrlT<TBase> - CAnimateCtrl\r
-// CRichEditCtrlT<TBase> - CRichEditCtrl\r
-// CRichEditCommands<T>\r
-// CDragListBoxT<TBase> - CDragListBox\r
-// CDragListNotifyImpl<T>\r
-// CReBarCtrlT<TBase> - CReBarCtrl\r
-// CComboBoxExT<TBase> - CComboBoxEx\r
-// CDateTimePickerCtrlT<TBase> - CDateTimePickerCtrl\r
-// CMonthCalendarCtrlT<TBase> - CMonthCalendarCtrl\r
-// CFlatScrollBarImpl<T>\r
-// CFlatScrollBarT<TBase> - CFlatScrollBar\r
-// CIPAddressCtrlT<TBase> - CIPAddressCtrl\r
-// CPagerCtrlT<TBase> - CPagerCtrl\r
-// CLinkCtrlT<TBase> - CLinkCtrl\r
-//\r
-// CCustomDraw<T>\r
-//\r
-// CCECommandBarCtrlT<TBase> - CCECommandBarCtrl\r
-// CCECommandBandsCtrlT<TBase> - CCECommandBandsCtrl\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-// These are wrapper classes for Windows standard and common controls.\r
-// To implement a window based on a control, use following:\r
-// Example: Implementing a window based on a list box\r
-//\r
-// class CMyListBox : CWindowImpl<CMyListBox, CListBox>\r
-// {\r
-// public:\r
-//      BEGIN_MSG_MAP(CMyListBox)\r
-//          // put your message handler entries here\r
-//      END_MSG_MAP()\r
-// };\r
-\r
-\r
-\r
-// --- Standard Windows controls ---\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStatic - client side for a Windows STATIC control\r
-\r
-template <class TBase>\r
-class CStaticT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CStaticT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CStaticT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return _T("STATIC");\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HICON GetIcon() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HICON)::SendMessage(m_hWnd, STM_GETICON, 0, 0L);\r
-       }\r
-\r
-       HICON SetIcon(HICON hIcon)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HICON)::SendMessage(m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L);\r
-       }\r
-\r
-       HENHMETAFILE GetEnhMetaFile() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HENHMETAFILE)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_ENHMETAFILE, 0L);\r
-       }\r
-\r
-       HENHMETAFILE SetEnhMetaFile(HENHMETAFILE hMetaFile)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HENHMETAFILE)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_ENHMETAFILE, (LPARAM)hMetaFile);\r
-       }\r
-#else // CE specific\r
-       HICON GetIcon() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HICON)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_ICON, 0L);\r
-       }\r
-\r
-       HICON SetIcon(HICON hIcon)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HICON)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);\r
-       }\r
-#endif // _WIN32_WCE\r
-\r
-       CBitmapHandle GetBitmap() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_BITMAP, 0L));\r
-       }\r
-\r
-       CBitmapHandle SetBitmap(HBITMAP hBitmap)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));\r
-       }\r
-\r
-       HCURSOR GetCursor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HCURSOR)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_CURSOR, 0L);\r
-       }\r
-\r
-       HCURSOR SetCursor(HCURSOR hCursor)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HCURSOR)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor);\r
-       }\r
-};\r
-\r
-typedef CStaticT<ATL::CWindow>   CStatic;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CButton - client side for a Windows BUTTON control\r
-\r
-template <class TBase>\r
-class CButtonT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CButtonT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CButtonT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return _T("BUTTON");\r
-       }\r
-\r
-       UINT GetState() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, BM_GETSTATE, 0, 0L);\r
-       }\r
-\r
-       void SetState(BOOL bHighlight)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, BM_SETSTATE, bHighlight, 0L);\r
-       }\r
-\r
-       int GetCheck() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, BM_GETCHECK, 0, 0L);\r
-       }\r
-\r
-       void SetCheck(int nCheck)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, BM_SETCHECK, nCheck, 0L);\r
-       }\r
-\r
-       UINT GetButtonStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::GetWindowLong(m_hWnd, GWL_STYLE) & 0xFFFF;\r
-       }\r
-\r
-       void SetButtonStyle(UINT nStyle, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, BM_SETSTYLE, nStyle, (LPARAM)bRedraw);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HICON GetIcon() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HICON)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_ICON, 0L);\r
-       }\r
-\r
-       HICON SetIcon(HICON hIcon)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HICON)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);\r
-       }\r
-\r
-       CBitmapHandle GetBitmap() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_BITMAP, 0L));\r
-       }\r
-\r
-       CBitmapHandle SetBitmap(HBITMAP hBitmap)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CBitmapHandle((HBITMAP)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap));\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       BOOL GetIdealSize(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_GETIDEALSIZE, 0, (LPARAM)lpSize);\r
-       }\r
-\r
-       BOOL GetImageList(PBUTTON_IMAGELIST pButtonImagelist) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_GETIMAGELIST, 0, (LPARAM)pButtonImagelist);\r
-       }\r
-\r
-       BOOL SetImageList(PBUTTON_IMAGELIST pButtonImagelist)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_SETIMAGELIST, 0, (LPARAM)pButtonImagelist);\r
-       }\r
-\r
-       BOOL GetTextMargin(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_GETTEXTMARGIN, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL SetTextMargin(LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_SETTEXTMARGIN, 0, (LPARAM)lpRect);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (WINVER >= 0x0600)\r
-       void SetDontClick(BOOL bDontClick)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, BM_SETDONTCLICK, (WPARAM)bDontClick, 0L);\r
-       }\r
-#endif // (WINVER >= 0x0600)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       BOOL SetDropDownState(BOOL bDropDown)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_SETDROPDOWNSTATE, (WPARAM)bDropDown, 0L);\r
-       }\r
-\r
-       BOOL GetSplitInfo(PBUTTON_SPLITINFO pSplitInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_GETSPLITINFO, 0, (LPARAM)pSplitInfo);\r
-       }\r
-\r
-       BOOL SetSplitInfo(PBUTTON_SPLITINFO pSplitInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (BS_SPLITBUTTON | BS_DEFSPLITBUTTON)) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_SETSPLITINFO, 0, (LPARAM)pSplitInfo);\r
-       }\r
-\r
-       int GetNoteLength() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);\r
-               return (int)::SendMessage(m_hWnd, BCM_GETNOTELENGTH, 0, 0L);\r
-       }\r
-\r
-       BOOL GetNote(LPWSTR lpstrNoteText, int cchNoteText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_GETNOTE, cchNoteText, (LPARAM)lpstrNoteText);\r
-       }\r
-\r
-       BOOL SetNote(LPCWSTR lpstrNoteText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (BS_COMMANDLINK | BS_DEFCOMMANDLINK)) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, BCM_SETNOTE, 0, (LPARAM)lpstrNoteText);\r
-       }\r
-\r
-       LRESULT SetElevationRequiredState(BOOL bSet)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::SendMessage(m_hWnd, BCM_SETSHIELD, 0, (LPARAM)bSet);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-// Operations\r
-       void Click()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, BM_CLICK, 0, 0L);\r
-       }\r
-};\r
-\r
-typedef CButtonT<ATL::CWindow>   CButton;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CListBox - client side for a Windows LISTBOX control\r
-\r
-template <class TBase>\r
-class CListBoxT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CListBoxT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CListBoxT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return _T("LISTBOX");\r
-       }\r
-\r
-       // for entire listbox\r
-       int GetCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETCOUNT, 0, 0L);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int SetCount(int cItems)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(((GetStyle() & LBS_NODATA) != 0) && ((GetStyle() & LBS_HASSTRINGS) == 0));\r
-               return (int)::SendMessage(m_hWnd, LB_SETCOUNT, cItems, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int GetHorizontalExtent() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETHORIZONTALEXTENT, 0, 0L);\r
-       }\r
-\r
-       void SetHorizontalExtent(int cxExtent)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0L);\r
-       }\r
-\r
-       int GetTopIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETTOPINDEX, 0, 0L);\r
-       }\r
-\r
-       int SetTopIndex(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_SETTOPINDEX, nIndex, 0L);\r
-       }\r
-\r
-       LCID GetLocale() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LCID)::SendMessage(m_hWnd, LB_GETLOCALE, 0, 0L);\r
-       }\r
-\r
-       LCID SetLocale(LCID nNewLocale)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LCID)::SendMessage(m_hWnd, LB_SETLOCALE, (WPARAM)nNewLocale, 0L);\r
-       }\r
-\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-       DWORD GetListBoxInfo() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#if (_WIN32_WINNT >= 0x0501)\r
-               return (DWORD)::SendMessage(m_hWnd, LB_GETLISTBOXINFO, 0, 0L);\r
-#else // !(_WIN32_WINNT >= 0x0501)\r
-               return ::GetListBoxInfo(m_hWnd);\r
-#endif // !(_WIN32_WINNT >= 0x0501)\r
-       }\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-       // for single-selection listboxes\r
-       int GetCurSel() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);\r
-               return (int)::SendMessage(m_hWnd, LB_GETCURSEL, 0, 0L);\r
-       }\r
-\r
-       int SetCurSel(int nSelect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);\r
-               return (int)::SendMessage(m_hWnd, LB_SETCURSEL, nSelect, 0L);\r
-       }\r
-\r
-       // for multiple-selection listboxes\r
-       int GetSel(int nIndex) const           // also works for single-selection\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETSEL, nIndex, 0L);\r
-       }\r
-\r
-       int SetSel(int nIndex, BOOL bSelect = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\r
-               return (int)::SendMessage(m_hWnd, LB_SETSEL, bSelect, nIndex);\r
-       }\r
-\r
-       int GetSelCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\r
-               return (int)::SendMessage(m_hWnd, LB_GETSELCOUNT, 0, 0L);\r
-       }\r
-\r
-       int GetSelItems(int nMaxItems, LPINT rgIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\r
-               return (int)::SendMessage(m_hWnd, LB_GETSELITEMS, nMaxItems, (LPARAM)rgIndex);\r
-       }\r
-\r
-       int GetAnchorIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\r
-               return (int)::SendMessage(m_hWnd, LB_GETANCHORINDEX, 0, 0L);\r
-       }\r
-\r
-       void SetAnchorIndex(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\r
-               ::SendMessage(m_hWnd, LB_SETANCHORINDEX, nIndex, 0L);\r
-       }\r
-\r
-       int GetCaretIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETCARETINDEX, 0, 0);\r
-       }\r
-\r
-       int SetCaretIndex(int nIndex, BOOL bScroll = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0));\r
-       }\r
-\r
-       // for listbox items\r
-       DWORD_PTR GetItemData(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD_PTR)::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0L);\r
-       }\r
-\r
-       int SetItemData(int nIndex, DWORD_PTR dwItemData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_SETITEMDATA, nIndex, (LPARAM)dwItemData);\r
-       }\r
-\r
-       void* GetItemDataPtr(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (void*)::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0L);\r
-       }\r
-\r
-       int SetItemDataPtr(int nIndex, void* pData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItemData(nIndex, (DWORD_PTR)pData);\r
-       }\r
-\r
-       int GetItemRect(int nIndex, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETITEMRECT, nIndex, (LPARAM)lpRect);\r
-       }\r
-\r
-       int GetText(int nIndex, LPTSTR lpszBuffer) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETTEXT, nIndex, (LPARAM)lpszBuffer);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-#ifdef _OLEAUTO_H_\r
-       BOOL GetTextBSTR(int nIndex, BSTR& bstrText) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrText == NULL);\r
-\r
-               int nLen = GetTextLen(nIndex);\r
-               if(nLen == LB_ERR)\r
-                       return FALSE;\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrText = buff.Allocate(nLen + 1);\r
-               if(lpstrText == NULL)\r
-                       return FALSE;\r
-\r
-               if(GetText(nIndex, lpstrText) == LB_ERR)\r
-                       return FALSE;\r
-\r
-               bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // _OLEAUTO_H_\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetText(int nIndex, _CSTRING_NS::CString& strText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int cchLen = GetTextLen(nIndex);\r
-               if(cchLen == LB_ERR)\r
-                       return LB_ERR;\r
-               int nRet = LB_ERR;\r
-               LPTSTR lpstr = strText.GetBufferSetLength(cchLen);\r
-               if(lpstr != NULL)\r
-               {\r
-                       nRet = GetText(nIndex, lpstr);\r
-                       strText.ReleaseBuffer();\r
-               }\r
-               return nRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       int GetTextLen(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETTEXTLEN, nIndex, 0L);\r
-       }\r
-\r
-       int GetItemHeight(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L);\r
-       }\r
-\r
-       int SetItemHeight(int nIndex, UINT cyItemHeight)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));\r
-       }\r
-\r
-       // Settable only attributes\r
-       void SetColumnWidth(int cxWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0L);\r
-       }\r
-\r
-       BOOL SetTabStops(int nTabStops, LPINT rgTabStops)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LBS_USETABSTOPS) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);\r
-       }\r
-\r
-       BOOL SetTabStops()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LBS_USETABSTOPS) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 0, 0L);\r
-       }\r
-\r
-       BOOL SetTabStops(const int& cxEachStop)    // takes an 'int'\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LBS_USETABSTOPS) != 0);\r
-               return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);\r
-       }\r
-\r
-// Operations\r
-       int InitStorage(int nItems, UINT nBytes)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_INITSTORAGE, (WPARAM)nItems, nBytes);\r
-       }\r
-\r
-       void ResetContent()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LB_RESETCONTENT, 0, 0L);\r
-       }\r
-\r
-       UINT ItemFromPoint(POINT pt, BOOL& bOutside) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dw = (DWORD)::SendMessage(m_hWnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));\r
-               bOutside = (BOOL)HIWORD(dw);\r
-               return (UINT)LOWORD(dw);\r
-       }\r
-\r
-       // manipulating listbox items\r
-       int AddString(LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem);\r
-       }\r
-\r
-       int DeleteString(UINT nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0L);\r
-       }\r
-\r
-       int InsertString(int nIndex, LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int Dir(UINT attr, LPCTSTR lpszWildCard)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_DIR, attr, (LPARAM)lpszWildCard);\r
-       }\r
-\r
-       int AddFile(LPCTSTR lpstrFileName)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_ADDFILE, 0, (LPARAM)lpstrFileName);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // selection helpers\r
-       int FindString(int nStartAfter, LPCTSTR lpszItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_FINDSTRING, nStartAfter, (LPARAM)lpszItem);\r
-       }\r
-\r
-       int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);\r
-       }\r
-\r
-       int SelectString(int nStartAfter, LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LB_SELECTSTRING, nStartAfter, (LPARAM)lpszItem);\r
-       }\r
-\r
-       int SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) != 0);\r
-               ATLASSERT(nFirstItem <= nLastItem);\r
-               return bSelect ? (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nFirstItem, nLastItem) : (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nLastItem, nFirstItem);\r
-       }\r
-\r
-#ifdef WIN32_PLATFORM_WFSP   // SmartPhone only messages\r
-       DWORD GetInputMode(BOOL bCurrentMode = TRUE)\r
-       {\r
-               return SendMessage(LB_GETINPUTMODE, 0, (LPARAM)bCurrentMode);\r
-       }\r
-\r
-       BOOL SetInputMode(DWORD dwMode)\r
-       {\r
-               return SendMessage(LB_SETINPUTMODE, 0, (LPARAM)dwMode);\r
-       }\r
-#endif // WIN32_PLATFORM_WFSP\r
-};\r
-\r
-typedef CListBoxT<ATL::CWindow>   CListBox;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CComboBox - client side for a Windows COMBOBOX control\r
-\r
-#ifndef WIN32_PLATFORM_WFSP   // No COMBOBOX on SmartPhones\r
-\r
-template <class TBase>\r
-class CComboBoxT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CComboBoxT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CComboBoxT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return _T("COMBOBOX");\r
-       }\r
-\r
-       // for entire combo box\r
-       int GetCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETCOUNT, 0, 0L);\r
-       }\r
-\r
-       int GetCurSel() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETCURSEL, 0, 0L);\r
-       }\r
-\r
-       int SetCurSel(int nSelect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SETCURSEL, nSelect, 0L);\r
-       }\r
-\r
-       LCID GetLocale() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LCID)::SendMessage(m_hWnd, CB_GETLOCALE, 0, 0L);\r
-       }\r
-\r
-       LCID SetLocale(LCID nNewLocale)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LCID)::SendMessage(m_hWnd, CB_SETLOCALE, (WPARAM)nNewLocale, 0L);\r
-       }\r
-\r
-       int GetTopIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETTOPINDEX, 0, 0L);\r
-       }\r
-\r
-       int SetTopIndex(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SETTOPINDEX, nIndex, 0L);\r
-       }\r
-\r
-       UINT GetHorizontalExtent() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, CB_GETHORIZONTALEXTENT, 0, 0L);\r
-       }\r
-\r
-       void SetHorizontalExtent(UINT nExtent)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, CB_SETHORIZONTALEXTENT, nExtent, 0L);\r
-       }\r
-\r
-       int GetDroppedWidth() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETDROPPEDWIDTH, 0, 0L);\r
-       }\r
-\r
-       int SetDroppedWidth(UINT nWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SETDROPPEDWIDTH, nWidth, 0L);\r
-       }\r
-\r
-#if ((WINVER >= 0x0500) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))\r
-       BOOL GetComboBoxInfo(PCOMBOBOXINFO pComboBoxInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#if ((_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))\r
-               return (BOOL)::SendMessage(m_hWnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)pComboBoxInfo);\r
-#else // !((_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))\r
-               return ::GetComboBoxInfo(m_hWnd, pComboBoxInfo);\r
-#endif // !((_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))\r
-       }\r
-#endif // ((WINVER >= 0x0500) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 420))\r
-\r
-       // for edit control\r
-       DWORD GetEditSel() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, CB_GETEDITSEL, 0, 0L);\r
-       }\r
-\r
-       BOOL SetEditSel(int nStartChar, int nEndChar)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar));\r
-       }\r
-\r
-       // for combobox item\r
-       DWORD_PTR GetItemData(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD_PTR)::SendMessage(m_hWnd, CB_GETITEMDATA, nIndex, 0L);\r
-       }\r
-\r
-       int SetItemData(int nIndex, DWORD_PTR dwItemData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SETITEMDATA, nIndex, (LPARAM)dwItemData);\r
-       }\r
-\r
-       void* GetItemDataPtr(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (void*)GetItemData(nIndex);\r
-       }\r
-\r
-       int SetItemDataPtr(int nIndex, void* pData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItemData(nIndex, (DWORD_PTR)pData);\r
-       }\r
-\r
-       int GetLBText(int nIndex, LPTSTR lpszText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETLBTEXT, nIndex, (LPARAM)lpszText);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetLBTextBSTR(int nIndex, BSTR& bstrText) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrText == NULL);\r
-\r
-               int nLen = GetLBTextLen(nIndex);\r
-               if(nLen == CB_ERR)\r
-                       return FALSE;\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrText = buff.Allocate(nLen + 1);\r
-               if(lpstrText == NULL)\r
-                       return FALSE;\r
-\r
-               if(GetLBText(nIndex, lpstrText) == CB_ERR)\r
-                       return FALSE;\r
-\r
-               bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetLBText(int nIndex, _CSTRING_NS::CString& strText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int cchLen = GetLBTextLen(nIndex);\r
-               if(cchLen == CB_ERR)\r
-                       return CB_ERR;\r
-               int nRet = CB_ERR;\r
-               LPTSTR lpstr = strText.GetBufferSetLength(cchLen);\r
-               if(lpstr != NULL)\r
-               {\r
-                       nRet = GetLBText(nIndex, lpstr);\r
-                       strText.ReleaseBuffer();\r
-               }\r
-               return nRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       int GetLBTextLen(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETLBTEXTLEN, nIndex, 0L);\r
-       }\r
-\r
-       int GetItemHeight(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L);\r
-       }\r
-\r
-       int SetItemHeight(int nIndex, UINT cyItemHeight)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0));\r
-       }\r
-\r
-       BOOL GetExtendedUI() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_GETEXTENDEDUI, 0, 0L);\r
-       }\r
-\r
-       int SetExtendedUI(BOOL bExtended = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L);\r
-       }\r
-\r
-       void GetDroppedControlRect(LPRECT lprect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)lprect);\r
-       }\r
-\r
-       BOOL GetDroppedState() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_GETDROPPEDSTATE, 0, 0L);\r
-       }\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       int GetMinVisible() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_GETMINVISIBLE, 0, 0L);\r
-       }\r
-\r
-       BOOL SetMinVisible(int nMinVisible)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_SETMINVISIBLE, nMinVisible, 0L);\r
-       }\r
-\r
-       // Vista only\r
-       BOOL GetCueBannerText(LPWSTR lpwText, int cchText) const\r
-       {\r
-#ifndef CB_GETCUEBANNER\r
-               const UINT CB_GETCUEBANNER = (CBM_FIRST + 4);\r
-#endif\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_GETCUEBANNER, (WPARAM)lpwText, cchText);\r
-       }\r
-\r
-       // Vista only\r
-       BOOL SetCueBannerText(LPCWSTR lpcwText)\r
-       {\r
-#ifndef CB_SETCUEBANNER\r
-               const UINT CB_SETCUEBANNER = (CBM_FIRST + 3);\r
-#endif\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_SETCUEBANNER, 0, (LPARAM)lpcwText);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-// Operations\r
-       int InitStorage(int nItems, UINT nBytes)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_INITSTORAGE, (WPARAM)nItems, nBytes);\r
-       }\r
-\r
-       void ResetContent()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, CB_RESETCONTENT, 0, 0L);\r
-       }\r
-\r
-       // for edit control\r
-       BOOL LimitText(int nMaxChars)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CB_LIMITTEXT, nMaxChars, 0L);\r
-       }\r
-\r
-       // for drop-down combo boxes\r
-       void ShowDropDown(BOOL bShowIt = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0L);\r
-       }\r
-\r
-       // manipulating listbox items\r
-       int AddString(LPCTSTR lpszString)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString);\r
-       }\r
-\r
-       int DeleteString(UINT nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0L);\r
-       }\r
-\r
-       int InsertString(int nIndex, LPCTSTR lpszString)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_INSERTSTRING, nIndex, (LPARAM)lpszString);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int Dir(UINT attr, LPCTSTR lpszWildCard)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_DIR, attr, (LPARAM)lpszWildCard);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // selection helpers\r
-       int FindString(int nStartAfter, LPCTSTR lpszString) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_FINDSTRING, nStartAfter, (LPARAM)lpszString);\r
-       }\r
-\r
-       int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind);\r
-       }\r
-\r
-       int SelectString(int nStartAfter, LPCTSTR lpszString)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CB_SELECTSTRING, nStartAfter, (LPARAM)lpszString);\r
-       }\r
-\r
-       // Clipboard operations\r
-       void Clear()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);\r
-       }\r
-\r
-       void Copy()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_COPY, 0, 0L);\r
-       }\r
-\r
-       void Cut()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CUT, 0, 0L);\r
-       }\r
-\r
-       void Paste()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);\r
-       }\r
-};\r
-\r
-typedef CComboBoxT<ATL::CWindow>   CComboBox;\r
-\r
-#endif // !WIN32_PLATFORM_WFSP\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CEdit - client side for a Windows EDIT control\r
-\r
-template <class TBase>\r
-class CEditT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CEditT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CEditT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return _T("EDIT");\r
-       }\r
-\r
-       BOOL CanUndo() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0L);\r
-       }\r
-\r
-       int GetLineCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetModify() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0L);\r
-       }\r
-\r
-       void SetModify(BOOL bModified = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0L);\r
-       }\r
-\r
-       void GetRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       DWORD GetSel() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETSEL, 0, 0L);\r
-       }\r
-\r
-       void GetSel(int& nStartChar, int& nEndChar) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HLOCAL GetHandle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HLOCAL)::SendMessage(m_hWnd, EM_GETHANDLE, 0, 0L);\r
-       }\r
-\r
-       void SetHandle(HLOCAL hBuffer)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETHANDLE, (WPARAM)hBuffer, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       DWORD GetMargins() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETMARGINS, 0, 0L);\r
-       }\r
-\r
-       void SetMargins(UINT nLeft, UINT nRight)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETMARGINS, EC_LEFTMARGIN|EC_RIGHTMARGIN, MAKELONG(nLeft, nRight));\r
-       }\r
-\r
-       UINT GetLimitText() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETLIMITTEXT, 0, 0L);\r
-       }\r
-\r
-       void SetLimitText(UINT nMax)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETLIMITTEXT, nMax, 0L);\r
-       }\r
-\r
-       POINT PosFromChar(UINT nChar) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_POSFROMCHAR, nChar, 0);\r
-               POINT point = { GET_X_LPARAM(dwRet), GET_Y_LPARAM(dwRet) };\r
-               return point;\r
-       }\r
-\r
-       int CharFromPos(POINT pt, int* pLine = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_CHARFROMPOS, 0, MAKELPARAM(pt.x, pt.y));\r
-               if(pLine != NULL)\r
-                       *pLine = (int)(short)HIWORD(dwRet);\r
-               return (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-       // NOTE: first word in lpszBuffer must contain the size of the buffer!\r
-       int GetLine(int nIndex, LPTSTR lpszBuffer) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\r
-       }\r
-\r
-       int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               *(LPWORD)lpszBuffer = (WORD)nMaxLength;\r
-               return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\r
-       }\r
-\r
-       TCHAR GetPasswordChar() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (TCHAR)::SendMessage(m_hWnd, EM_GETPASSWORDCHAR, 0, 0L);\r
-       }\r
-\r
-       void SetPasswordChar(TCHAR ch)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETPASSWORDCHAR, ch, 0L);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       EDITWORDBREAKPROC GetWordBreakProc() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (EDITWORDBREAKPROC)::SendMessage(m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);\r
-       }\r
-\r
-       void SetWordBreakProc(EDITWORDBREAKPROC ewbprc)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int GetFirstVisibleLine() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetThumb() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & ES_MULTILINE) != 0);\r
-               return (int)::SendMessage(m_hWnd, EM_GETTHUMB, 0, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL SetReadOnly(BOOL bReadOnly = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L);\r
-       }\r
-\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-       UINT GetImeStatus(UINT uStatus) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETIMESTATUS, uStatus, 0L);\r
-       }\r
-\r
-       UINT SetImeStatus(UINT uStatus, UINT uData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_SETIMESTATUS, uStatus, uData);\r
-       }\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       BOOL GetCueBannerText(LPCWSTR lpstrText, int cchText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_GETCUEBANNER, (WPARAM)lpstrText, cchText);\r
-       }\r
-\r
-       // bKeepWithFocus - Vista only\r
-       BOOL SetCueBannerText(LPCWSTR lpstrText, BOOL bKeepWithFocus = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCUEBANNER, (WPARAM)bKeepWithFocus, (LPARAM)(lpstrText));\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-// Operations\r
-       void EmptyUndoBuffer()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);\r
-       }\r
-\r
-       BOOL FmtLines(BOOL bAddEOL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_FMTLINES, bAddEOL, 0L);\r
-       }\r
-\r
-       void LimitText(int nChars = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_LIMITTEXT, nChars, 0L);\r
-       }\r
-\r
-       int LineFromChar(int nIndex = -1) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_LINEFROMCHAR, nIndex, 0L);\r
-       }\r
-\r
-       int LineIndex(int nLine = -1) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0L);\r
-       }\r
-\r
-       int LineLength(int nLine = -1) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0L);\r
-       }\r
-\r
-       void LineScroll(int nLines, int nChars = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines);\r
-       }\r
-\r
-       void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);\r
-       }\r
-\r
-       void SetRect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       void SetRectNP(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETRECTNP, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       void SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETSEL, LOWORD(dwSelection), HIWORD(dwSelection));\r
-               if(!bNoScroll)\r
-                       ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);\r
-       }\r
-\r
-       void SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETSEL, nStartChar, nEndChar);\r
-               if(!bNoScroll)\r
-                       ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);\r
-       }\r
-\r
-       void SetSelAll(BOOL bNoScroll = FALSE)\r
-       {\r
-               SetSel(0, -1, bNoScroll);\r
-       }\r
-\r
-       void SetSelNone(BOOL bNoScroll = FALSE)\r
-       {\r
-               SetSel(-1, 0, bNoScroll);\r
-       }\r
-\r
-       BOOL SetTabStops(int nTabStops, LPINT rgTabStops)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);\r
-       }\r
-\r
-       BOOL SetTabStops()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0L);\r
-       }\r
-\r
-       BOOL SetTabStops(const int& cxEachStop)    // takes an 'int'\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);\r
-       }\r
-\r
-       void ScrollCaret()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);\r
-       }\r
-\r
-       int Scroll(int nScrollAction)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & ES_MULTILINE) != 0);\r
-               LRESULT lRet = ::SendMessage(m_hWnd, EM_SCROLL, nScrollAction, 0L);\r
-               if(!(BOOL)HIWORD(lRet))\r
-                       return -1;   // failed\r
-               return (int)(short)LOWORD(lRet);\r
-               \r
-       }\r
-\r
-       void InsertText(int nInsertAfterChar, LPCTSTR lpstrText, BOOL bNoScroll = FALSE, BOOL bCanUndo = FALSE)\r
-       {\r
-               SetSel(nInsertAfterChar, nInsertAfterChar, bNoScroll);\r
-               ReplaceSel(lpstrText, bCanUndo);\r
-       }\r
-\r
-       void AppendText(LPCTSTR lpstrText, BOOL bNoScroll = FALSE, BOOL bCanUndo = FALSE)\r
-       {\r
-               InsertText(GetWindowTextLength(), lpstrText, bNoScroll, bCanUndo);\r
-       }\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       BOOL ShowBalloonTip(PEDITBALLOONTIP pEditBaloonTip)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SHOWBALLOONTIP, 0, (LPARAM)pEditBaloonTip);\r
-       }\r
-\r
-       BOOL HideBalloonTip()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_HIDEBALLOONTIP, 0, 0L);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       DWORD GetHilite() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETHILITE, 0, 0L);\r
-       }\r
-\r
-       void GetHilite(int& nStartChar, int& nEndChar) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_GETHILITE, 0, 0L);\r
-               nStartChar = (int)(short)LOWORD(dwRet);\r
-               nEndChar = (int)(short)HIWORD(dwRet);\r
-       }\r
-\r
-       void SetHilite(int nStartChar, int nEndChar)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETHILITE, nStartChar, nEndChar);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-       // Clipboard operations\r
-       BOOL Undo()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0L);\r
-       }\r
-\r
-       void Clear()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);\r
-       }\r
-\r
-       void Copy()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_COPY, 0, 0L);\r
-       }\r
-\r
-       void Cut()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CUT, 0, 0L);\r
-       }\r
-\r
-       void Paste()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);\r
-       }\r
-\r
-#ifdef WIN32_PLATFORM_WFSP   // SmartPhone only messages\r
-       DWORD GetExtendedStyle()\r
-       {\r
-               return SendMessage(EM_GETEXTENDEDSTYLE);\r
-       }\r
-\r
-       DWORD SetExtendedStyle(DWORD dwMask, DWORD dwExStyle)\r
-       {\r
-               return SendMessage(EM_SETEXTENDEDSTYLE, (WPARAM)dwMask, (LPARAM)dwExStyle);\r
-       }\r
-\r
-       DWORD GetInputMode(BOOL bCurrentMode = TRUE)\r
-       {\r
-               return SendMessage(EM_GETINPUTMODE, 0, (LPARAM)bCurrentMode);\r
-       }\r
-\r
-       BOOL SetInputMode(DWORD dwMode)\r
-       {\r
-               return SendMessage(EM_SETINPUTMODE, 0, (LPARAM)dwMode);\r
-       }\r
-\r
-       BOOL SetSymbols(LPCTSTR szSymbols)\r
-       {\r
-               return SendMessage(EM_SETSYMBOLS, 0, (LPARAM)szSymbols);\r
-       }\r
-\r
-       BOOL ResetSymbols()\r
-       {\r
-               return SendMessage(EM_SETSYMBOLS);\r
-       }\r
-#endif // WIN32_PLATFORM_WFSP\r
-};\r
-\r
-typedef CEditT<ATL::CWindow>   CEdit;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CEditCommands - message handlers for standard EDIT commands\r
-\r
-// Chain to CEditCommands message map. Your class must also derive from CEdit.\r
-// Example:\r
-// class CMyEdit : public CWindowImpl<CMyEdit, CEdit>,\r
-//                 public CEditCommands<CMyEdit>\r
-// {\r
-// public:\r
-//      BEGIN_MSG_MAP(CMyEdit)\r
-//              // your handlers...\r
-//              CHAIN_MSG_MAP_ALT(CEditCommands<CMyEdit>, 1)\r
-//      END_MSG_MAP()\r
-//      // other stuff...\r
-// };\r
-\r
-template <class T>\r
-class CEditCommands\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CEditCommands< T >)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_EDIT_CLEAR, OnEditClear)\r
-               COMMAND_ID_HANDLER(ID_EDIT_CLEAR_ALL, OnEditClearAll)\r
-               COMMAND_ID_HANDLER(ID_EDIT_COPY, OnEditCopy)\r
-               COMMAND_ID_HANDLER(ID_EDIT_CUT, OnEditCut)\r
-               COMMAND_ID_HANDLER(ID_EDIT_PASTE, OnEditPaste)\r
-               COMMAND_ID_HANDLER(ID_EDIT_SELECT_ALL, OnEditSelectAll)\r
-               COMMAND_ID_HANDLER(ID_EDIT_UNDO, OnEditUndo)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEditClear(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Clear();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditClearAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetSel(0, -1);\r
-               pT->Clear();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditCopy(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Copy();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditCut(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Cut();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditPaste(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Paste();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditSelectAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetSel(0, -1);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditUndo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Undo();\r
-               return 0;\r
-       }\r
-\r
-// State (update UI) helpers\r
-       BOOL CanCut() const\r
-       { return HasSelection(); }\r
-\r
-       BOOL CanCopy() const\r
-       { return HasSelection(); }\r
-\r
-       BOOL CanClear() const\r
-       { return HasSelection(); }\r
-\r
-       BOOL CanSelectAll() const\r
-       { return HasText(); }\r
-\r
-       BOOL CanFind() const\r
-       { return HasText(); }\r
-\r
-       BOOL CanRepeat() const\r
-       { return HasText(); }\r
-\r
-       BOOL CanReplace() const\r
-       { return HasText(); }\r
-\r
-       BOOL CanClearAll() const\r
-       { return HasText(); }\r
-\r
-// Implementation\r
-       BOOL HasSelection() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               int nMin, nMax;\r
-               ::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nMin, (LPARAM)&nMax);\r
-               return (nMin != nMax);\r
-       }\r
-\r
-       BOOL HasText() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               return (pT->GetWindowTextLength() > 0);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CScrollBar - client side for a Windows SCROLLBAR control\r
-\r
-template <class TBase>\r
-class CScrollBarT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CScrollBarT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CScrollBarT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return _T("SCROLLBAR");\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetScrollPos() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::GetScrollPos(m_hWnd, SB_CTL);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int SetScrollPos(int nPos, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::SetScrollPos(m_hWnd, SB_CTL, nPos, bRedraw);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       void GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::GetScrollRange(m_hWnd, SB_CTL, lpMinPos, lpMaxPos);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SetScrollRange(m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw);\r
-       }\r
-\r
-       BOOL GetScrollInfo(LPSCROLLINFO lpScrollInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::GetScrollInfo(m_hWnd, SB_CTL, lpScrollInfo);\r
-       }\r
-\r
-       int SetScrollInfo(LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::SetScrollInfo(m_hWnd, SB_CTL, lpScrollInfo, bRedraw);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetScrollLimit() const\r
-       {\r
-               int nMin = 0, nMax = 0;\r
-               ::GetScrollRange(m_hWnd, SB_CTL, &nMin, &nMax);\r
-               SCROLLINFO info = { 0 };\r
-               info.cbSize = sizeof(SCROLLINFO);\r
-               info.fMask = SIF_PAGE;\r
-               if(::GetScrollInfo(m_hWnd, SB_CTL, &info))\r
-                       nMax -= ((info.nPage - 1) > 0) ? (info.nPage - 1) : 0;\r
-\r
-               return nMax;\r
-       }\r
-\r
-#if (WINVER >= 0x0500)\r
-       BOOL GetScrollBarInfo(PSCROLLBARINFO pScrollBarInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#if (_WIN32_WINNT >= 0x0501)\r
-               return (BOOL)::SendMessage(m_hWnd, SBM_GETSCROLLBARINFO, 0, (LPARAM)pScrollBarInfo);\r
-#else // !(_WIN32_WINNT >= 0x0501)\r
-               return ::GetScrollBarInfo(m_hWnd, OBJID_CLIENT, pScrollBarInfo);\r
-#endif // !(_WIN32_WINNT >= 0x0501)\r
-       }\r
-#endif // (WINVER >= 0x0500)\r
-\r
-// Operations\r
-       void ShowScrollBar(BOOL bShow = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::ShowScrollBar(m_hWnd, SB_CTL, bShow);\r
-       }\r
-\r
-       BOOL EnableScrollBar(UINT nArrowFlags = ESB_ENABLE_BOTH)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::EnableScrollBar(m_hWnd, SB_CTL, nArrowFlags);\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-typedef CScrollBarT<ATL::CWindow>   CScrollBar;\r
-\r
-\r
-// --- Windows Common Controls ---\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CImageList\r
-\r
-class CImageList\r
-{\r
-public:\r
-       HIMAGELIST m_hImageList;\r
-\r
-// Constructor\r
-       CImageList(HIMAGELIST hImageList = NULL) : m_hImageList(hImageList)\r
-       { }\r
-\r
-// Operators, etc.\r
-       CImageList& operator =(HIMAGELIST hImageList)\r
-       {\r
-               m_hImageList = hImageList;\r
-               return *this;\r
-       }\r
-\r
-       operator HIMAGELIST() const { return m_hImageList; }\r
-\r
-       void Attach(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(m_hImageList == NULL);\r
-               ATLASSERT(hImageList != NULL);\r
-               m_hImageList = hImageList;\r
-       }\r
-\r
-       HIMAGELIST Detach()\r
-       {\r
-               HIMAGELIST hImageList = m_hImageList;\r
-               m_hImageList = NULL;\r
-               return hImageList;\r
-       }\r
-\r
-       bool IsNull() const { return (m_hImageList == NULL); }\r
-\r
-// Attributes\r
-       int GetImageCount() const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_GetImageCount(m_hImageList);\r
-       }\r
-\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_GetBkColor(m_hImageList);\r
-       }\r
-\r
-       COLORREF SetBkColor(COLORREF cr)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetBkColor(m_hImageList, cr);\r
-       }\r
-\r
-       BOOL GetImageInfo(int nImage, IMAGEINFO* pImageInfo) const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_GetImageInfo(m_hImageList, nImage, pImageInfo);\r
-       }\r
-\r
-       HICON GetIcon(int nIndex, UINT uFlags = ILD_NORMAL) const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_GetIcon(m_hImageList, nIndex, uFlags);\r
-       }\r
-\r
-       BOOL GetIconSize(int& cx, int& cy) const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_GetIconSize(m_hImageList, &cx, &cy);\r
-       }\r
-\r
-       BOOL GetIconSize(SIZE& size) const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_GetIconSize(m_hImageList, (int*)&size.cx, (int*)&size.cy);\r
-       }\r
-\r
-       BOOL SetIconSize(int cx, int cy)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetIconSize(m_hImageList, cx, cy);\r
-       }\r
-\r
-       BOOL SetIconSize(SIZE size)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetIconSize(m_hImageList, size.cx, size.cy);\r
-       }\r
-\r
-       BOOL SetImageCount(UINT uNewCount)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetImageCount(m_hImageList, uNewCount);\r
-       }\r
-\r
-       BOOL SetOverlayImage(int nImage, int nOverlay)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetOverlayImage(m_hImageList, nImage, nOverlay);\r
-       }\r
-\r
-// Operations\r
-       BOOL Create(int cx, int cy, UINT nFlags, int nInitial, int nGrow)\r
-       {\r
-               ATLASSERT(m_hImageList == NULL);\r
-               m_hImageList = ImageList_Create(cx, cy, nFlags, nInitial, nGrow);\r
-               return (m_hImageList != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL Create(ATL::_U_STRINGorID bitmap, int cx, int nGrow, COLORREF crMask)\r
-       {\r
-               ATLASSERT(m_hImageList == NULL);\r
-               m_hImageList = ImageList_LoadBitmap(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr, cx, nGrow, crMask);\r
-               return (m_hImageList != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL CreateFromImage(ATL::_U_STRINGorID image, int cx, int nGrow, COLORREF crMask, UINT uType, UINT uFlags = LR_DEFAULTCOLOR | LR_DEFAULTSIZE)\r
-       {\r
-               ATLASSERT(m_hImageList == NULL);\r
-               m_hImageList = ImageList_LoadImage(ModuleHelper::GetResourceInstance(), image.m_lpstr, cx, nGrow, crMask, uType, uFlags);\r
-               return (m_hImageList != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL Merge(HIMAGELIST hImageList1, int nImage1, HIMAGELIST hImageList2, int nImage2, int dx, int dy)\r
-       {\r
-               ATLASSERT(m_hImageList == NULL);\r
-               m_hImageList = ImageList_Merge(hImageList1, nImage1, hImageList2, nImage2, dx, dy);\r
-               return (m_hImageList != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-#ifdef __IStream_INTERFACE_DEFINED__\r
-       BOOL CreateFromStream(LPSTREAM lpStream)\r
-       {\r
-               ATLASSERT(m_hImageList == NULL);\r
-               m_hImageList = ImageList_Read(lpStream);\r
-               return (m_hImageList != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // __IStream_INTERFACE_DEFINED__\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL Destroy()\r
-       {\r
-               if (m_hImageList == NULL)\r
-                       return FALSE;\r
-               BOOL bRet = ImageList_Destroy(m_hImageList);\r
-               if(bRet)\r
-                       m_hImageList = NULL;\r
-               return bRet;\r
-       }\r
-\r
-       int Add(HBITMAP hBitmap, HBITMAP hBitmapMask = NULL)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_Add(m_hImageList, hBitmap, hBitmapMask);\r
-       }\r
-\r
-       int Add(HBITMAP hBitmap, COLORREF crMask)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_AddMasked(m_hImageList, hBitmap, crMask);\r
-       }\r
-\r
-       BOOL Remove(int nImage)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_Remove(m_hImageList, nImage);\r
-       }\r
-\r
-       BOOL RemoveAll()\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_RemoveAll(m_hImageList);\r
-       }\r
-\r
-       BOOL Replace(int nImage, HBITMAP hBitmap, HBITMAP hBitmapMask)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_Replace(m_hImageList, nImage, hBitmap, hBitmapMask);\r
-       }\r
-\r
-       int AddIcon(HICON hIcon)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_AddIcon(m_hImageList, hIcon);\r
-       }\r
-\r
-       int ReplaceIcon(int nImage, HICON hIcon)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_ReplaceIcon(m_hImageList, nImage, hIcon);\r
-       }\r
-\r
-       HICON ExtractIcon(int nImage)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_ExtractIcon(NULL, m_hImageList, nImage);\r
-       }\r
-\r
-       BOOL Draw(HDC hDC, int nImage, int x, int y, UINT nStyle)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               ATLASSERT(hDC != NULL);\r
-               return ImageList_Draw(m_hImageList, nImage, hDC, x, y, nStyle);\r
-       }\r
-\r
-       BOOL Draw(HDC hDC, int nImage, POINT pt, UINT nStyle)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               ATLASSERT(hDC != NULL);\r
-               return ImageList_Draw(m_hImageList, nImage, hDC, pt.x, pt.y, nStyle);\r
-       }\r
-\r
-       BOOL DrawEx(int nImage, HDC hDC, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               ATLASSERT(hDC != NULL);\r
-               return ImageList_DrawEx(m_hImageList, nImage, hDC, x, y, dx, dy, rgbBk, rgbFg, fStyle);\r
-       }\r
-\r
-       BOOL DrawEx(int nImage, HDC hDC, RECT& rect, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               ATLASSERT(hDC != NULL);\r
-               return ImageList_DrawEx(m_hImageList, nImage, hDC, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, rgbBk, rgbFg, fStyle);\r
-       }\r
-\r
-       static BOOL DrawIndirect(IMAGELISTDRAWPARAMS* pimldp)\r
-       {\r
-               return ImageList_DrawIndirect(pimldp);\r
-       }\r
-\r
-       BOOL Copy(int nSrc, int nDst, UINT uFlags = ILCF_MOVE)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_Copy(m_hImageList, nDst, m_hImageList, nSrc, uFlags);\r
-       }\r
-\r
-#ifdef __IStream_INTERFACE_DEFINED__\r
-#ifndef _WIN32_WCE\r
-       static HIMAGELIST Read(LPSTREAM lpStream)\r
-       {\r
-               return ImageList_Read(lpStream);\r
-       }\r
-\r
-       BOOL Write(LPSTREAM lpStream)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_Write(m_hImageList, lpStream);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       static HRESULT ReadEx(DWORD dwFlags, LPSTREAM lpStream, REFIID riid, PVOID* ppv)\r
-       {\r
-               return ImageList_ReadEx(dwFlags, lpStream, riid, ppv);\r
-       }\r
-\r
-       HRESULT WriteEx(DWORD dwFlags, LPSTREAM lpStream)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_WriteEx(m_hImageList, dwFlags, lpStream);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-#endif // __IStream_INTERFACE_DEFINED__\r
-\r
-       // Drag operations\r
-       BOOL BeginDrag(int nImage, POINT ptHotSpot)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_BeginDrag(m_hImageList, nImage, ptHotSpot.x, ptHotSpot.y);\r
-       }\r
-\r
-       BOOL BeginDrag(int nImage, int xHotSpot, int yHotSpot)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_BeginDrag(m_hImageList, nImage, xHotSpot, yHotSpot);\r
-       }\r
-\r
-       static void EndDrag()\r
-       {\r
-               ImageList_EndDrag();\r
-       }\r
-\r
-       static BOOL DragMove(POINT pt)\r
-       {\r
-               return ImageList_DragMove(pt.x, pt.y);\r
-       }\r
-\r
-       static BOOL DragMove(int x, int y)\r
-       {\r
-               return ImageList_DragMove(x, y);\r
-       }\r
-\r
-       BOOL SetDragCursorImage(int nDrag, POINT ptHotSpot)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetDragCursorImage(m_hImageList, nDrag, ptHotSpot.x, ptHotSpot.y);\r
-       }\r
-\r
-       BOOL SetDragCursorImage(int nDrag, int xHotSpot, int yHotSpot)\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return ImageList_SetDragCursorImage(m_hImageList, nDrag, xHotSpot, yHotSpot);\r
-       }\r
-\r
-       static BOOL DragShowNolock(BOOL bShow = TRUE)\r
-       {\r
-               return ImageList_DragShowNolock(bShow);\r
-       }\r
-\r
-       static CImageList GetDragImage(LPPOINT lpPoint, LPPOINT lpPointHotSpot)\r
-       {\r
-               return CImageList(ImageList_GetDragImage(lpPoint, lpPointHotSpot));\r
-       }\r
-\r
-       static BOOL DragEnter(HWND hWnd, POINT point)\r
-       {\r
-               return ImageList_DragEnter(hWnd, point.x, point.y);\r
-       }\r
-\r
-       static BOOL DragEnter(HWND hWnd, int x, int y)\r
-       {\r
-               return ImageList_DragEnter(hWnd, x, y);\r
-       }\r
-\r
-       static BOOL DragLeave(HWND hWnd)\r
-       {\r
-               return ImageList_DragLeave(hWnd);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       CImageList Duplicate() const\r
-       {\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return CImageList(ImageList_Duplicate(m_hImageList));\r
-       }\r
-\r
-       static CImageList Duplicate(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(hImageList != NULL);\r
-               return CImageList(ImageList_Duplicate(hImageList));\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CToolTipCtrl\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-class CToolInfo : public TOOLINFO\r
-{\r
-public:\r
-       CToolInfo(UINT nFlags, HWND hWnd, UINT nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)\r
-       {\r
-               Init(nFlags, hWnd, nIDTool, lpRect, lpstrText, lUserParam);\r
-       }\r
-\r
-       operator LPTOOLINFO() { return this; }\r
-\r
-       operator LPARAM() { return (LPARAM)this; }\r
-\r
-       void Init(UINT nFlags, HWND hWnd, UINT nIDTool = 0, LPRECT lpRect = NULL, LPTSTR lpstrText = LPSTR_TEXTCALLBACK, LPARAM lUserParam = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(hWnd));\r
-               memset(this, 0, sizeof(TOOLINFO));\r
-               cbSize = sizeof(TOOLINFO);\r
-               uFlags = nFlags;\r
-               if(nIDTool == 0)\r
-               {\r
-                       hwnd = ::GetParent(hWnd);\r
-                       uFlags |= TTF_IDISHWND;\r
-                       uId = (UINT_PTR)hWnd;\r
-               }\r
-               else\r
-               {\r
-                       hwnd = hWnd;\r
-                       uId = nIDTool;\r
-               }\r
-               if(lpRect != NULL)\r
-                       rect = *lpRect;\r
-               hinst = ModuleHelper::GetResourceInstance();\r
-               lpszText = lpstrText;\r
-               lParam = lUserParam;\r
-       }\r
-};\r
-\r
-template <class TBase>\r
-class CToolTipCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CToolTipCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CToolTipCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return TOOLTIPS_CLASS;\r
-       }\r
-\r
-       void GetText(LPTOOLINFO lpToolInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_GETTEXT, 0, (LPARAM)&lpToolInfo);\r
-       }\r
-\r
-       void GetText(LPTSTR lpstrText, HWND hWnd, UINT nIDTool = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-               CToolInfo ti(0, hWnd, nIDTool, NULL, lpstrText);\r
-               ::SendMessage(m_hWnd, TTM_GETTEXT, 0, ti);\r
-       }\r
-\r
-       BOOL GetToolInfo(LPTOOLINFO lpToolInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_GETTOOLINFO, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       BOOL GetToolInfo(HWND hWnd, UINT nIDTool, UINT* puFlags, LPRECT lpRect, LPTSTR lpstrText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-               ATLASSERT(puFlags != NULL);\r
-               ATLASSERT(lpRect != NULL);\r
-               CToolInfo ti(0, hWnd, nIDTool, NULL, lpstrText);\r
-               BOOL bRet = (BOOL)::SendMessage(m_hWnd, TTM_GETTOOLINFO, 0, ti);\r
-               if(bRet != FALSE)\r
-               {\r
-                       *puFlags = ti.uFlags;\r
-                       *lpRect = ti.rect;\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       void SetToolInfo(LPTOOLINFO lpToolInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_SETTOOLINFO, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       void SetToolRect(LPTOOLINFO lpToolInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_NEWTOOLRECT, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       void SetToolRect(HWND hWnd, UINT nIDTool, LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-               ATLASSERT(nIDTool != 0);\r
-\r
-               CToolInfo ti(0, hWnd, nIDTool, (LPRECT)lpRect, NULL);\r
-               ::SendMessage(m_hWnd, TTM_NEWTOOLRECT, 0, ti);\r
-       }\r
-\r
-       int GetToolCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TTM_GETTOOLCOUNT, 0, 0L);\r
-       }\r
-\r
-       int GetDelayTime(DWORD dwType) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TTM_GETDELAYTIME, dwType, 0L);\r
-       }\r
-\r
-       void SetDelayTime(DWORD dwType, int nTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_SETDELAYTIME, dwType, MAKELPARAM(nTime, 0));\r
-       }\r
-\r
-       void GetMargin(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_GETMARGIN, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       void SetMargin(LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_SETMARGIN, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       int GetMaxTipWidth() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TTM_GETMAXTIPWIDTH, 0, 0L);\r
-       }\r
-\r
-       int SetMaxTipWidth(int nWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TTM_SETMAXTIPWIDTH, 0, nWidth);\r
-       }\r
-\r
-       COLORREF GetTipBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TTM_GETTIPBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       void SetTipBkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_SETTIPBKCOLOR, (WPARAM)clr, 0L);\r
-       }\r
-\r
-       COLORREF GetTipTextColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TTM_GETTIPTEXTCOLOR, 0, 0L);\r
-       }\r
-\r
-       void SetTipTextColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_SETTIPTEXTCOLOR, (WPARAM)clr, 0L);\r
-       }\r
-\r
-       BOOL GetCurrentTool(LPTOOLINFO lpToolInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_GETCURRENTTOOL, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       SIZE GetBubbleSize(LPTOOLINFO lpToolInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TTM_GETBUBBLESIZE, 0, (LPARAM)lpToolInfo);\r
-               SIZE size = { GET_X_LPARAM(dwRet), GET_Y_LPARAM(dwRet) };\r
-               return size;\r
-       }\r
-\r
-       BOOL SetTitle(UINT uIcon, LPCTSTR lpstrTitle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_SETTITLE, uIcon, (LPARAM)lpstrTitle);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       void GetTitle(PTTGETTITLE pTTGetTitle) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_GETTITLE, 0, (LPARAM)pTTGetTitle);\r
-       }\r
-\r
-       void SetWindowTheme(LPCWSTR lpstrTheme)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-// Operations\r
-       void Activate(BOOL bActivate)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_ACTIVATE, bActivate, 0L);\r
-       }\r
-\r
-       BOOL AddTool(LPTOOLINFO lpToolInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_ADDTOOL, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       BOOL AddTool(HWND hWnd, ATL::_U_STRINGorID text = LPSTR_TEXTCALLBACK, LPCRECT lpRectTool = NULL, UINT nIDTool = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-               // the toolrect and toolid must both be zero or both valid\r
-               ATLASSERT((lpRectTool != NULL && nIDTool != 0) || (lpRectTool == NULL && nIDTool == 0));\r
-\r
-               CToolInfo ti(0, hWnd, nIDTool, (LPRECT)lpRectTool, (LPTSTR)text.m_lpstr);\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_ADDTOOL, 0, ti);\r
-       }\r
-\r
-       void DelTool(LPTOOLINFO lpToolInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_DELTOOL, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       void DelTool(HWND hWnd, UINT nIDTool = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-\r
-               CToolInfo ti(0, hWnd, nIDTool, NULL, NULL);\r
-               ::SendMessage(m_hWnd, TTM_DELTOOL, 0, ti);\r
-       }\r
-\r
-       BOOL HitTest(LPTTHITTESTINFO lpHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_HITTEST, 0, (LPARAM)lpHitTestInfo);\r
-       }\r
-\r
-       BOOL HitTest(HWND hWnd, POINT pt, LPTOOLINFO lpToolInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-               ATLASSERT(lpToolInfo != NULL);\r
-\r
-               TTHITTESTINFO hti = { 0 };\r
-               hti.ti.cbSize = sizeof(TOOLINFO);\r
-               hti.hwnd = hWnd;\r
-               hti.pt.x = pt.x;\r
-               hti.pt.y = pt.y;\r
-               if((BOOL)::SendMessage(m_hWnd, TTM_HITTEST, 0, (LPARAM)&hti) != FALSE)\r
-               {\r
-                       *lpToolInfo = hti.ti;\r
-                       return TRUE;\r
-               }\r
-               return FALSE;\r
-       }\r
-\r
-       void RelayEvent(LPMSG lpMsg)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_RELAYEVENT, 0, (LPARAM)lpMsg);\r
-       }\r
-\r
-       void UpdateTipText(LPTOOLINFO lpToolInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_UPDATETIPTEXT, 0, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       void UpdateTipText(ATL::_U_STRINGorID text, HWND hWnd, UINT nIDTool = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hWnd != NULL);\r
-\r
-               CToolInfo ti(0, hWnd, nIDTool, NULL, (LPTSTR)text.m_lpstr);\r
-               ::SendMessage(m_hWnd, TTM_UPDATETIPTEXT, 0, ti);\r
-       }\r
-\r
-       BOOL EnumTools(UINT nTool, LPTOOLINFO lpToolInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_ENUMTOOLS, nTool, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       void Pop()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_POP, 0, 0L);\r
-       }\r
-\r
-       void TrackActivate(LPTOOLINFO lpToolInfo, BOOL bActivate)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_TRACKACTIVATE, bActivate, (LPARAM)lpToolInfo);\r
-       }\r
-\r
-       void TrackPosition(int xPos, int yPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_TRACKPOSITION, 0, MAKELPARAM(xPos, yPos));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       void Update()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_UPDATE, 0, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       BOOL AdjustRect(LPRECT lpRect, BOOL bLarger /*= TRUE*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TTM_ADJUSTRECT, bLarger, (LPARAM)lpRect);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       void Popup()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TTM_POPUP, 0, 0L);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-};\r
-\r
-typedef CToolTipCtrlT<ATL::CWindow>   CToolTipCtrl;\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CHeaderCtrl\r
-\r
-template <class TBase>\r
-class CHeaderCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CHeaderCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CHeaderCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_HEADER;\r
-       }\r
-\r
-       int GetItemCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetItem(int nIndex, LPHDITEM pHeaderItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_GETITEM, nIndex, (LPARAM)pHeaderItem);\r
-       }\r
-\r
-       BOOL SetItem(int nIndex, LPHDITEM pHeaderItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_SETITEM, nIndex, (LPARAM)pHeaderItem);\r
-       }\r
-\r
-       CImageList GetImageList() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, HDM_GETIMAGELIST, 0, 0L));\r
-       }\r
-\r
-       CImageList SetImageList(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, HDM_SETIMAGELIST, 0, (LPARAM)hImageList));\r
-       }\r
-\r
-       BOOL GetOrderArray(int nSize, int* lpnArray) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_GETORDERARRAY, nSize, (LPARAM)lpnArray);\r
-       }\r
-\r
-       BOOL SetOrderArray(int nSize, int* lpnArray)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_SETORDERARRAY, nSize, (LPARAM)lpnArray);\r
-       }\r
-\r
-       BOOL GetItemRect(int nIndex, LPRECT lpItemRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_GETITEMRECT, nIndex, (LPARAM)lpItemRect);\r
-       }\r
-\r
-       int SetHotDivider(BOOL bPos, DWORD dwInputValue)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_SETHOTDIVIDER, bPos, dwInputValue);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       int GetBitmapMargin() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_GETBITMAPMARGIN, 0, 0L);\r
-       }\r
-\r
-       int SetBitmapMargin(int nWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_SETBITMAPMARGIN, nWidth, 0L);\r
-       }\r
-\r
-       int SetFilterChangeTimeout(DWORD dwTimeOut)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_SETFILTERCHANGETIMEOUT, 0, dwTimeOut);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       BOOL GetItemDropDownRect(int nIndex, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL GetOverflowRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_GETOVERFLOWRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       int GetFocusedItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_GETFOCUSEDITEM, 0, 0L);\r
-       }\r
-\r
-       BOOL SetFocusedItem(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_SETFOCUSEDITEM, 0, nIndex);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-// Operations\r
-       int InsertItem(int nIndex, LPHDITEM phdi)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_INSERTITEM, nIndex, (LPARAM)phdi);\r
-       }\r
-\r
-       int AddItem(LPHDITEM phdi)\r
-       {\r
-               return InsertItem(GetItemCount(), phdi);\r
-       }\r
-\r
-       BOOL DeleteItem(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_DELETEITEM, nIndex, 0L);\r
-       }\r
-\r
-       BOOL Layout(HD_LAYOUT* pHeaderLayout)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, HDM_LAYOUT, 0, (LPARAM)pHeaderLayout);\r
-       }\r
-\r
-       int HitTest(LPHDHITTESTINFO lpHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_HITTEST, 0, (LPARAM)lpHitTestInfo);\r
-       }\r
-\r
-       int OrderToIndex(int nOrder)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_ORDERTOINDEX, nOrder, 0L);\r
-       }\r
-\r
-       CImageList CreateDragImage(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, HDM_CREATEDRAGIMAGE, nIndex, 0L));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       int EditFilter(int nColumn, BOOL bDiscardChanges)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_EDITFILTER, nColumn, MAKELPARAM(bDiscardChanges, 0));\r
-       }\r
-\r
-       int ClearFilter(int nColumn)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_CLEARFILTER, nColumn, 0L);\r
-       }\r
-\r
-       int ClearAllFilters()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, HDM_CLEARFILTER, (WPARAM)-1, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-};\r
-\r
-typedef CHeaderCtrlT<ATL::CWindow>   CHeaderCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CListViewCtrl\r
-\r
-template <class TBase>\r
-class CListViewCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CListViewCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CListViewCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_LISTVIEW;\r
-       }\r
-\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_GETBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       BOOL SetBkColor(COLORREF cr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETBKCOLOR, 0, cr);\r
-       }\r
-\r
-       CImageList GetImageList(int nImageListType) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_GETIMAGELIST, nImageListType, 0L));\r
-       }\r
-\r
-       CImageList SetImageList(HIMAGELIST hImageList, int nImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_SETIMAGELIST, nImageList, (LPARAM)hImageList));\r
-       }\r
-\r
-       int GetItemCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETITEMCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetItemCount(int nItems)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMCOUNT, nItems, 0L);\r
-       }\r
-\r
-       BOOL GetItem(LPLVITEM pItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       BOOL SetItem(const LVITEM* pItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       BOOL SetItem(int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem,\r
-               int nImage, UINT nState, UINT nStateMask, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvi = { 0 };\r
-               lvi.mask = nMask;\r
-               lvi.iItem = nItem;\r
-               lvi.iSubItem = nSubItem;\r
-               lvi.stateMask = nStateMask;\r
-               lvi.state = nState;\r
-               lvi.pszText = (LPTSTR) lpszItem;\r
-               lvi.iImage = nImage;\r
-               lvi.lParam = lParam;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)&lvi);\r
-       }\r
-\r
-       UINT GetItemState(int nItem, UINT nMask) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, LVM_GETITEMSTATE, nItem, nMask);\r
-       }\r
-\r
-       BOOL SetItemState(int nItem, UINT nState, UINT nStateMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvi = { 0 };\r
-               lvi.state = nState;\r
-               lvi.stateMask = nStateMask;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)&lvi);\r
-       }\r
-\r
-       BOOL SetItemState(int nItem, LPLVITEM pItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)pItem);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetItemText(int nItem, int nSubItem, BSTR& bstrText) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrText == NULL);\r
-               LVITEM lvi = { 0 };\r
-               lvi.iSubItem = nSubItem;\r
-\r
-               LPTSTR lpstrText = NULL;\r
-               int nRes = 0;\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       ATLTRY(lpstrText = new TCHAR[nLen]);\r
-                       if(lpstrText == NULL)\r
-                               break;\r
-                       lpstrText[0] = NULL;\r
-                       lvi.cchTextMax = nLen;\r
-                       lvi.pszText = lpstrText;\r
-                       nRes  = (int)::SendMessage(m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\r
-                       if(nRes < nLen - 1)\r
-                               break;\r
-                       delete [] lpstrText;\r
-                       lpstrText = NULL;\r
-               }\r
-\r
-               if(lpstrText != NULL)\r
-               {\r
-                       if(nRes != 0)\r
-                               bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-                       delete [] lpstrText;\r
-               }\r
-\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetItemText(int nItem, int nSubItem, _CSTRING_NS::CString& strText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvi = { 0 };\r
-               lvi.iSubItem = nSubItem;\r
-\r
-               strText.Empty();\r
-               int nRes = 0;\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       lvi.cchTextMax = nLen;\r
-                       lvi.pszText = strText.GetBufferSetLength(nLen);\r
-                       if(lvi.pszText == NULL)\r
-                       {\r
-                               nRes = 0;\r
-                               break;\r
-                       }\r
-                       nRes  = (int)::SendMessage(m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\r
-                       if(nRes < nLen - 1)\r
-                               break;\r
-               }\r
-               strText.ReleaseBuffer();\r
-               return nRes;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       int GetItemText(int nItem, int nSubItem, LPTSTR lpszText, int nLen) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvi = { 0 };\r
-               lvi.iSubItem = nSubItem;\r
-               lvi.cchTextMax = nLen;\r
-               lvi.pszText = lpszText;\r
-               return (int)::SendMessage(m_hWnd, LVM_GETITEMTEXT, (WPARAM)nItem, (LPARAM)&lvi);\r
-       }\r
-\r
-       BOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(nItem, nSubItem, LVIF_TEXT, lpszText, 0, 0, 0, 0);\r
-       }\r
-\r
-       DWORD_PTR GetItemData(int nItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvi = { 0 };\r
-               lvi.iItem = nItem;\r
-               lvi.mask = LVIF_PARAM;\r
-               BOOL bRet = (BOOL)::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)&lvi);\r
-               return (DWORD_PTR)(bRet ? lvi.lParam : NULL);\r
-       }\r
-\r
-       BOOL SetItemData(int nItem, DWORD_PTR dwData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(nItem, 0, LVIF_PARAM, NULL, 0, 0, 0, (LPARAM)dwData);\r
-       }\r
-\r
-       UINT GetCallbackMask() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, LVM_GETCALLBACKMASK, 0, 0L);\r
-       }\r
-\r
-       BOOL SetCallbackMask(UINT nMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETCALLBACKMASK, nMask, 0L);\r
-       }\r
-\r
-       BOOL GetItemPosition(int nItem, LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETITEMPOSITION, nItem, (LPARAM)lpPoint);\r
-       }\r
-\r
-       BOOL SetItemPosition(int nItem, POINT pt)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(((GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);\r
-       }\r
-\r
-       BOOL SetItemPosition(int nItem, int x, int y)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(((GetStyle() & LVS_TYPEMASK) == LVS_ICON) || ((GetStyle() & LVS_TYPEMASK) == LVS_SMALLICON));\r
-               POINT pt = { x, y };\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt);\r
-       }\r
-\r
-       int GetStringWidth(LPCTSTR lpsz) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz);\r
-       }\r
-\r
-       CEdit GetEditControl() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CEdit((HWND)::SendMessage(m_hWnd, LVM_GETEDITCONTROL, 0, 0L));\r
-       }\r
-\r
-       BOOL GetColumn(int nCol, LVCOLUMN* pColumn) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETCOLUMN, nCol, (LPARAM)pColumn);\r
-       }\r
-\r
-       BOOL SetColumn(int nCol, const LVCOLUMN* pColumn)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETCOLUMN, nCol, (LPARAM)pColumn);\r
-       }\r
-\r
-       int GetColumnWidth(int nCol) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETCOLUMNWIDTH, nCol, 0L);\r
-       }\r
-\r
-       BOOL SetColumnWidth(int nCol, int cx)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0));\r
-       }\r
-\r
-       BOOL GetViewRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETVIEWRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       COLORREF GetTextColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_GETTEXTCOLOR, 0, 0L);\r
-       }\r
-\r
-       BOOL SetTextColor(COLORREF cr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETTEXTCOLOR, 0, cr);\r
-       }\r
-\r
-       COLORREF GetTextBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_GETTEXTBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       BOOL SetTextBkColor(COLORREF cr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETTEXTBKCOLOR, 0, cr);\r
-       }\r
-\r
-       int GetTopIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETTOPINDEX, 0, 0L);\r
-       }\r
-\r
-       int GetCountPerPage() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETCOUNTPERPAGE, 0, 0L);\r
-       }\r
-\r
-       BOOL GetOrigin(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETORIGIN, 0, (LPARAM)lpPoint);\r
-       }\r
-\r
-       UINT GetSelectedCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, LVM_GETSELECTEDCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetItemRect(int nItem, LPRECT lpRect, UINT nCode) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               lpRect->left = nCode;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETITEMRECT, (WPARAM)nItem, (LPARAM)lpRect);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HCURSOR GetHotCursor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HCURSOR)::SendMessage(m_hWnd, LVM_GETHOTCURSOR, 0, 0L);\r
-       }\r
-\r
-       HCURSOR SetHotCursor(HCURSOR hHotCursor)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HCURSOR)::SendMessage(m_hWnd, LVM_SETHOTCURSOR, 0, (LPARAM)hHotCursor);\r
-       }\r
-\r
-       int GetHotItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETHOTITEM, 0, 0L);\r
-       }\r
-\r
-       int SetHotItem(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SETHOTITEM, nIndex, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL GetColumnOrderArray(int nCount, int* lpnArray) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);\r
-       }\r
-\r
-       BOOL SetColumnOrderArray(int nCount, int* lpnArray)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETCOLUMNORDERARRAY, nCount, (LPARAM)lpnArray);\r
-       }\r
-\r
-       CHeaderCtrl GetHeader() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CHeaderCtrl((HWND)::SendMessage(m_hWnd, LVM_GETHEADER, 0, 0L));\r
-       }\r
-\r
-       BOOL GetSubItemRect(int nItem, int nSubItem, int nFlag, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LVS_TYPEMASK) == LVS_REPORT);\r
-               ATLASSERT(lpRect != NULL);\r
-               lpRect->top = nSubItem;\r
-               lpRect->left = nFlag;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETSUBITEMRECT, nItem, (LPARAM)lpRect);\r
-       }\r
-\r
-       DWORD SetIconSpacing(int cx, int cy)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LVS_TYPEMASK) == LVS_ICON);\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_SETICONSPACING, 0, MAKELPARAM(cx, cy));\r
-       }\r
-\r
-       int GetISearchString(LPTSTR lpstr) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);\r
-       }\r
-\r
-       void GetItemSpacing(SIZE& sizeSpacing, BOOL bSmallIconView = FALSE) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, LVM_GETITEMSPACING, bSmallIconView, 0L);\r
-               sizeSpacing.cx = GET_X_LPARAM(dwRet);\r
-               sizeSpacing.cy = GET_Y_LPARAM(dwRet);\r
-       }\r
-\r
-#if (_WIN32_WCE >= 410)\r
-       void SetItemSpacing(INT cySpacing)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ListView_SetItemSpacing(m_hWnd, cySpacing);\r
-       }\r
-#endif // (_WIN32_WCE >= 410)\r
-\r
-       // single-selection only\r
-       int GetSelectedIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LVS_SINGLESEL) != 0);\r
-               return (int)::SendMessage(m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));\r
-       }\r
-\r
-       BOOL GetSelectedItem(LPLVITEM pItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LVS_SINGLESEL) != 0);\r
-               ATLASSERT(pItem != NULL);\r
-               pItem->iItem = (int)::SendMessage(m_hWnd, LVM_GETNEXTITEM, (WPARAM)-1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0));\r
-               if(pItem->iItem == -1)\r
-                       return FALSE;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       // extended list view styles\r
-       DWORD GetExtendedListViewStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0L);\r
-       }\r
-\r
-       // dwExMask = 0 means all styles\r
-       DWORD SetExtendedListViewStyle(DWORD dwExStyle, DWORD dwExMask = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, dwExMask, dwExStyle);\r
-       }\r
-\r
-       // checkboxes only\r
-       BOOL GetCheckState(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetExtendedListViewStyle() & LVS_EX_CHECKBOXES) != 0);\r
-               UINT uRet = GetItemState(nIndex, LVIS_STATEIMAGEMASK);\r
-               return (uRet >> 12) - 1;\r
-       }\r
-\r
-       BOOL SetCheckState(int nItem, BOOL bCheck)\r
-       {\r
-               int nCheck = bCheck ? 2 : 1;   // one based index\r
-               return SetItemState(nItem, INDEXTOSTATEIMAGEMASK(nCheck), LVIS_STATEIMAGEMASK);\r
-       }\r
-\r
-       // view type\r
-       DWORD GetViewType() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (GetStyle() & LVS_TYPEMASK);\r
-       }\r
-\r
-       DWORD SetViewType(DWORD dwType)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(dwType == LVS_ICON || dwType == LVS_SMALLICON || dwType == LVS_LIST || dwType == LVS_REPORT);\r
-               DWORD dwOldType = GetViewType();\r
-               if(dwType != dwOldType)\r
-                       ModifyStyle(LVS_TYPEMASK, (dwType & LVS_TYPEMASK));\r
-               return dwOldType;\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-#ifndef _WIN32_WCE\r
-       BOOL GetBkImage(LPLVBKIMAGE plvbki) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETBKIMAGE, 0, (LPARAM)plvbki);\r
-       }\r
-\r
-       BOOL SetBkImage(LPLVBKIMAGE plvbki)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETBKIMAGE, 0, (LPARAM)plvbki);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int GetSelectionMark() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETSELECTIONMARK, 0, 0L);\r
-       }\r
-\r
-       int SetSelectionMark(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SETSELECTIONMARK, 0, nIndex);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetWorkAreas(int nWorkAreas, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETWORKAREAS, nWorkAreas, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL SetWorkAreas(int nWorkAreas, LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETWORKAREAS, nWorkAreas, (LPARAM)lpRect);\r
-       }\r
-\r
-       DWORD GetHoverTime() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetExtendedListViewStyle() & (LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE)) != 0);\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_GETHOVERTIME, 0, 0L);\r
-       }\r
-\r
-       DWORD SetHoverTime(DWORD dwHoverTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetExtendedListViewStyle() & (LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE)) != 0);\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_SETHOVERTIME, 0, dwHoverTime);\r
-       }\r
-\r
-       BOOL GetNumberOfWorkAreas(int* pnWorkAreas) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)pnWorkAreas);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL SetItemCountEx(int nItems, DWORD dwFlags)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(((GetStyle() & LVS_OWNERDATA) != 0) && (((GetStyle() & LVS_TYPEMASK) == LVS_REPORT) || ((GetStyle() & LVS_TYPEMASK) == LVS_LIST)));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMCOUNT, nItems, dwFlags);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl GetToolTips() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, LVM_GETTOOLTIPS, 0, 0L));\r
-       }\r
-\r
-       CToolTipCtrl SetToolTips(HWND hWndTT)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, LVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));\r
-       }\r
-\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       int GetSelectedColumn() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETSELECTEDCOLUMN, 0, 0L);\r
-       }\r
-\r
-       void SetSelectedColumn(int nColumn)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_SETSELECTEDCOLUMN, nColumn, 0L);\r
-       }\r
-\r
-       DWORD GetView() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_GETVIEW, 0, 0L);\r
-       }\r
-\r
-       int SetView(DWORD dwView)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SETVIEW, dwView, 0L);\r
-       }\r
-\r
-       BOOL IsGroupViewEnabled() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_ISGROUPVIEWENABLED, 0, 0L);\r
-       }\r
-\r
-       int GetGroupInfo(int nGroupID, PLVGROUP pGroup) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETGROUPINFO, nGroupID, (LPARAM)pGroup);\r
-       }\r
-\r
-       int SetGroupInfo(int nGroupID, PLVGROUP pGroup)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SETGROUPINFO, nGroupID, (LPARAM)pGroup);\r
-       }\r
-\r
-       void GetGroupMetrics(PLVGROUPMETRICS pGroupMetrics) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_GETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);\r
-       }\r
-\r
-       void SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_SETGROUPMETRICS, 0, (LPARAM)pGroupMetrics);\r
-       }\r
-\r
-       void GetTileViewInfo(PLVTILEVIEWINFO pTileViewInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_GETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);\r
-       }\r
-\r
-       BOOL SetTileViewInfo(PLVTILEVIEWINFO pTileViewInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETTILEVIEWINFO, 0, (LPARAM)pTileViewInfo);\r
-       }\r
-\r
-       void GetTileInfo(PLVTILEINFO pTileInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_GETTILEINFO, 0, (LPARAM)pTileInfo);\r
-       }\r
-\r
-       BOOL SetTileInfo(PLVTILEINFO pTileInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETTILEINFO, 0, (LPARAM)pTileInfo);\r
-       }\r
-\r
-       BOOL GetInsertMark(LPLVINSERTMARK pInsertMark) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETINSERTMARK, 0, (LPARAM)pInsertMark);\r
-       }\r
-\r
-       BOOL SetInsertMark(LPLVINSERTMARK pInsertMark)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETINSERTMARK, 0, (LPARAM)pInsertMark);\r
-       }\r
-\r
-       int GetInsertMarkRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETINSERTMARKRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       COLORREF GetInsertMarkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_GETINSERTMARKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetInsertMarkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_SETINSERTMARKCOLOR, 0, clr);\r
-       }\r
-\r
-       COLORREF GetOutlineColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_GETOUTLINECOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetOutlineColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, LVM_SETOUTLINECOLOR, 0, clr);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       int GetGroupCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETGROUPCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetGroupInfoByIndex(int nIndex, PLVGROUP pGroup) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETGROUPINFOBYINDEX, nIndex, (LPARAM)pGroup);\r
-       }\r
-\r
-       BOOL GetGroupRect(int nGroupID, int nType, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpRect != NULL);\r
-               if(lpRect != NULL)\r
-                       lpRect->top = nType;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETGROUPRECT, nGroupID, (LPARAM)lpRect);\r
-       }\r
-\r
-       UINT GetGroupState(int nGroupID, UINT uMask) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, LVM_GETGROUPSTATE, nGroupID, (LPARAM)uMask);\r
-       }\r
-\r
-       int GetFocusedGroup() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETFOCUSEDGROUP, 0, 0L);\r
-       }\r
-\r
-       BOOL GetEmptyText(LPWSTR lpstrText, int cchText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETEMPTYTEXT, cchText, (LPARAM)lpstrText);\r
-       }\r
-\r
-       BOOL GetFooterRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL GetFooterInfo(LPLVFOOTERINFO lpFooterInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERINFO, 0, (LPARAM)lpFooterInfo);\r
-       }\r
-\r
-       BOOL GetFooterItemRect(int nItem, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERITEMRECT, nItem, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL GetFooterItem(int nItem, LPLVFOOTERITEM lpFooterItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETFOOTERITEM, nItem, (LPARAM)lpFooterItem);\r
-       }\r
-\r
-       BOOL GetItemIndexRect(PLVITEMINDEX pItemIndex, int nSubItem, int nType, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pItemIndex != NULL);\r
-               ATLASSERT(lpRect != NULL);\r
-               if(lpRect != NULL)\r
-               {\r
-                       lpRect->top = nSubItem;\r
-                       lpRect->left = nType;\r
-               }\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETITEMINDEXRECT, (WPARAM)pItemIndex, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL SetItemIndexState(PLVITEMINDEX pItemIndex, UINT uState, UINT dwMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvi = { 0 };\r
-               lvi.state = uState;\r
-               lvi.stateMask = dwMask;\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETITEMINDEXSTATE, (WPARAM)pItemIndex, (LPARAM)&lvi);\r
-       }\r
-\r
-       BOOL GetNextItemIndex(PLVITEMINDEX pItemIndex, WORD wFlags) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_GETNEXTITEMINDEX, (WPARAM)pItemIndex, MAKELPARAM(wFlags, 0));\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-// Operations\r
-       int InsertColumn(int nCol, const LVCOLUMN* pColumn)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn);\r
-       }\r
-\r
-       int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT, \r
-                       int nWidth = -1, int nSubItem = -1, int iImage = -1, int iOrder = -1)\r
-       {\r
-               LVCOLUMN column = { 0 };\r
-               column.mask = LVCF_TEXT|LVCF_FMT;\r
-               column.pszText = (LPTSTR)lpszColumnHeading;\r
-               column.fmt = nFormat;\r
-               if (nWidth != -1)\r
-               {\r
-                       column.mask |= LVCF_WIDTH;\r
-                       column.cx = nWidth;\r
-               }\r
-               if (nSubItem != -1)\r
-               {\r
-                       column.mask |= LVCF_SUBITEM;\r
-                       column.iSubItem = nSubItem;\r
-               }\r
-               if (iImage != -1)\r
-               {\r
-                       column.mask |= LVCF_IMAGE;\r
-                       column.iImage = iImage;\r
-               }\r
-               if (iOrder != -1)\r
-               {\r
-                       column.mask |= LVCF_ORDER;\r
-                       column.iOrder = iOrder;\r
-               }\r
-               return InsertColumn(nCol, &column);\r
-       }\r
-\r
-       BOOL DeleteColumn(int nCol)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_DELETECOLUMN, nCol, 0L);\r
-       }\r
-\r
-       int InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem, UINT nState, UINT nStateMask, int nImage, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM item = { 0 };\r
-               item.mask = nMask;\r
-               item.iItem = nItem;\r
-               item.iSubItem = 0;\r
-               item.pszText = (LPTSTR)lpszItem;\r
-               item.state = nState;\r
-               item.stateMask = nStateMask;\r
-               item.iImage = nImage;\r
-               item.lParam = lParam;\r
-               return InsertItem(&item);\r
-       }\r
-\r
-       int InsertItem(const LVITEM* pItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_INSERTITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       int InsertItem(int nItem, LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return InsertItem(LVIF_TEXT, nItem, lpszItem, 0, 0, 0, 0);\r
-       }\r
-\r
-       int InsertItem(int nItem, LPCTSTR lpszItem, int nImage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return InsertItem(LVIF_TEXT|LVIF_IMAGE, nItem, lpszItem, 0, 0, nImage, 0);\r
-       }\r
-\r
-       int GetNextItem(int nItem, int nFlags) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_GETNEXTITEM, nItem, MAKELPARAM(nFlags, 0));\r
-       }\r
-\r
-       BOOL DeleteItem(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_DELETEITEM, nItem, 0L);\r
-       }\r
-\r
-       BOOL DeleteAllItems()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_DELETEALLITEMS, 0, 0L);\r
-       }\r
-\r
-       int FindItem(LVFINDINFO* pFindInfo, int nStart) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_FINDITEM, nStart, (LPARAM)pFindInfo);\r
-       }\r
-\r
-       int HitTest(LVHITTESTINFO* pHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)pHitTestInfo);\r
-       }\r
-\r
-       int HitTest(POINT pt, UINT* pFlags) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVHITTESTINFO hti = { 0 };\r
-               hti.pt = pt;\r
-               int nRes = (int)::SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)&hti);\r
-               if (pFlags != NULL)\r
-                       *pFlags = hti.flags;\r
-               return nRes;\r
-       }\r
-\r
-       BOOL EnsureVisible(int nItem, BOOL bPartialOK)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_ENSUREVISIBLE, nItem, MAKELPARAM(bPartialOK, 0));\r
-       }\r
-\r
-       BOOL Scroll(SIZE size)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SCROLL, size.cx, size.cy);\r
-       }\r
-\r
-       BOOL RedrawItems(int nFirst, int nLast)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_REDRAWITEMS, nFirst, nLast);\r
-       }\r
-\r
-       BOOL Arrange(UINT nCode)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_ARRANGE, nCode, 0L);\r
-       }\r
-\r
-       CEdit EditLabel(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CEdit((HWND)::SendMessage(m_hWnd, LVM_EDITLABEL, nItem, 0L));\r
-       }\r
-\r
-       BOOL Update(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_UPDATE, nItem, 0L);\r
-       }\r
-\r
-       BOOL SortItems(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SORTITEMS, (WPARAM)lParamSort, (LPARAM)pfnCompare);\r
-       }\r
-\r
-       CImageList RemoveImageList(int nImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_SETIMAGELIST, (WPARAM)nImageList, NULL));\r
-       }\r
-\r
-       CImageList CreateDragImage(int nItem, LPPOINT lpPoint)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, LVM_CREATEDRAGIMAGE, nItem, (LPARAM)lpPoint));\r
-       }\r
-\r
-       DWORD ApproximateViewRect(int cx = -1, int cy = -1, int nCount = -1)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, LVM_APPROXIMATEVIEWRECT, nCount, MAKELPARAM(cx, cy));\r
-       }\r
-\r
-       int SubItemHitTest(LPLVHITTESTINFO lpInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SUBITEMHITTEST, 0, (LPARAM)lpInfo);\r
-       }\r
-\r
-       int AddColumn(LPCTSTR strItem, int nItem, int nSubItem = -1,\r
-                       int nMask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM,\r
-                       int nFmt = LVCFMT_LEFT)\r
-       {\r
-               const int cxOffset = 15;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVCOLUMN lvc = { 0 };\r
-               lvc.mask = nMask;\r
-               lvc.fmt = nFmt;\r
-               lvc.pszText = (LPTSTR)strItem;\r
-               lvc.cx = GetStringWidth(lvc.pszText) + cxOffset;\r
-               if(nMask & LVCF_SUBITEM)\r
-                       lvc.iSubItem = (nSubItem != -1) ? nSubItem : nItem;\r
-               return InsertColumn(nItem, &lvc);\r
-       }\r
-\r
-       int AddItem(int nItem, int nSubItem, LPCTSTR strItem, int nImageIndex = -1)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVITEM lvItem = { 0 };\r
-               lvItem.mask = LVIF_TEXT;\r
-               lvItem.iItem = nItem;\r
-               lvItem.iSubItem = nSubItem;\r
-               lvItem.pszText = (LPTSTR)strItem;\r
-               if(nImageIndex != -1)\r
-               {\r
-                       lvItem.mask |= LVIF_IMAGE;\r
-                       lvItem.iImage = nImageIndex;\r
-               }\r
-               if(nSubItem == 0)\r
-                       return InsertItem(&lvItem);\r
-               return SetItem(&lvItem) ? nItem : -1;\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       BOOL SortItemsEx(PFNLVCOMPARE pfnCompare, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SORTITEMSEX, (WPARAM)lParamSort, (LPARAM)pfnCompare);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       int InsertGroup(int nItem, PLVGROUP pGroup)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_INSERTGROUP, nItem, (LPARAM)pGroup);\r
-       }\r
-\r
-       int AddGroup(PLVGROUP pGroup)\r
-       {\r
-               return InsertGroup(-1, pGroup);\r
-       }\r
-\r
-       int RemoveGroup(int nGroupID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_REMOVEGROUP, nGroupID, 0L);\r
-       }\r
-\r
-       void MoveGroup(int nGroupID, int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_MOVEGROUP, nGroupID, nItem);\r
-       }\r
-\r
-       void MoveItemToGroup(int nItem, int nGroupID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_MOVEITEMTOGROUP, nItem, nGroupID);\r
-       }\r
-\r
-       int EnableGroupView(BOOL bEnable)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_ENABLEGROUPVIEW, bEnable, 0L);\r
-       }\r
-\r
-       int SortGroups(PFNLVGROUPCOMPARE pCompareFunc, LPVOID lpVoid = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SORTGROUPS, (WPARAM)pCompareFunc, (LPARAM)lpVoid);\r
-       }\r
-\r
-       void InsertGroupSorted(PLVINSERTGROUPSORTED pInsertGroupSorted)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_INSERTGROUPSORTED, (WPARAM)pInsertGroupSorted, 0L);\r
-       }\r
-\r
-       void RemoveAllGroups()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_REMOVEALLGROUPS, 0, 0L);\r
-       }\r
-\r
-       BOOL HasGroup(int nGroupID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_HASGROUP, nGroupID, 0L);\r
-       }\r
-\r
-       BOOL InsertMarkHitTest(LPPOINT lpPoint, LPLVINSERTMARK pInsertMark) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)pInsertMark);\r
-       }\r
-\r
-       BOOL SetInfoTip(PLVSETINFOTIP pSetInfoTip)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LVM_SETINFOTIP, 0, (LPARAM)pSetInfoTip);\r
-       }\r
-\r
-       void CancelEditLabel()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, LVM_CANCELEDITLABEL, 0, 0L);\r
-       }\r
-\r
-       UINT MapIndexToID(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, LVM_MAPINDEXTOID, nIndex, 0L);\r
-       }\r
-\r
-       int MapIDToIndex(UINT uID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_MAPIDTOINDEX, uID, 0L);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       int HitTestEx(LPLVHITTESTINFO lpHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);\r
-       }\r
-\r
-       int HitTestEx(POINT pt, UINT* pFlags) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LVHITTESTINFO hti = { 0 };\r
-               hti.pt = pt;\r
-               int nRes = (int)::SendMessage(m_hWnd, LVM_HITTEST, (WPARAM)-1, (LPARAM)&hti);\r
-               if (pFlags != NULL)\r
-                       *pFlags = hti.flags;\r
-               return nRes;\r
-       }\r
-\r
-       int SubItemHitTestEx(LPLVHITTESTINFO lpHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LVM_SUBITEMHITTEST, (WPARAM)-1, (LPARAM)lpHitTestInfo);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-       // single-selection only\r
-       BOOL SelectItem(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & LVS_SINGLESEL) != 0);\r
-\r
-               BOOL bRet = SetItemState(nIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);\r
-               if(bRet)\r
-                       bRet = EnsureVisible(nIndex, FALSE);\r
-               return bRet;\r
-       }\r
-};\r
-\r
-typedef CListViewCtrlT<ATL::CWindow>   CListViewCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTreeViewCtrl\r
-\r
-template <class TBase>\r
-class CTreeViewCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CTreeViewCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CTreeViewCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_TREEVIEW;\r
-       }\r
-\r
-       UINT GetCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, TVM_GETCOUNT, 0, 0L);\r
-       }\r
-\r
-       UINT GetIndent() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, TVM_GETINDENT, 0, 0L);\r
-       }\r
-\r
-       void SetIndent(UINT nIndent)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TVM_SETINDENT, nIndent, 0L);\r
-       }\r
-\r
-       CImageList GetImageList(int nImageListType = TVSIL_NORMAL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_GETIMAGELIST, (WPARAM)nImageListType, 0L));\r
-       }\r
-\r
-       CImageList SetImageList(HIMAGELIST hImageList, int nImageListType = TVSIL_NORMAL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageListType, (LPARAM)hImageList));\r
-       }\r
-\r
-       BOOL GetItem(LPTVITEM pItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       BOOL SetItem(LPTVITEM pItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       BOOL SetItem(HTREEITEM hItem, UINT nMask, LPCTSTR lpszItem, int nImage,\r
-               int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = nMask;\r
-               item.pszText = (LPTSTR) lpszItem;\r
-               item.iImage = nImage;\r
-               item.iSelectedImage = nSelectedImage;\r
-               item.state = nState;\r
-               item.stateMask = nStateMask;\r
-               item.lParam = lParam;\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)&item);\r
-       }\r
-\r
-       BOOL GetItemText(HTREEITEM hItem, LPTSTR lpstrText, int nLen) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpstrText != NULL);\r
-\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_TEXT;\r
-               item.pszText = lpstrText;\r
-               item.cchTextMax = nLen;\r
-\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetItemText(HTREEITEM hItem, BSTR& bstrText) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrText == NULL);\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_TEXT;\r
-\r
-               LPTSTR lpstrText = NULL;\r
-               BOOL bRet = FALSE;\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       ATLTRY(lpstrText = new TCHAR[nLen]);\r
-                       if(lpstrText == NULL)\r
-                               break;\r
-                       lpstrText[0] = NULL;\r
-                       item.pszText = lpstrText;\r
-                       item.cchTextMax = nLen;\r
-                       bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-                       if(!bRet || (lstrlen(item.pszText) < nLen - 1))\r
-                               break;\r
-                       delete [] lpstrText;\r
-                       lpstrText = NULL;\r
-               }\r
-\r
-               if(lpstrText != NULL)\r
-               {\r
-                       if(bRet)\r
-                               bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-                       delete [] lpstrText;\r
-               }\r
-\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       BOOL GetItemText(HTREEITEM hItem, _CSTRING_NS::CString& strText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_TEXT;\r
-\r
-               strText.Empty();\r
-               BOOL bRet = FALSE;\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       item.pszText = strText.GetBufferSetLength(nLen);\r
-                       if(item.pszText == NULL)\r
-                       {\r
-                               bRet = FALSE;\r
-                               break;\r
-                       }\r
-                       item.cchTextMax = nLen;\r
-                       bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-                       if(!bRet || (lstrlen(item.pszText) < nLen - 1))\r
-                               break;\r
-               }\r
-               strText.ReleaseBuffer();\r
-               return bRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       BOOL SetItemText(HTREEITEM hItem, LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(hItem, TVIF_TEXT, lpszItem, 0, 0, 0, 0, NULL);\r
-       }\r
-\r
-       BOOL GetItemImage(HTREEITEM hItem, int& nImage, int& nSelectedImage) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_IMAGE|TVIF_SELECTEDIMAGE;\r
-               BOOL bRes = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-               if (bRes)\r
-               {\r
-                       nImage = item.iImage;\r
-                       nSelectedImage = item.iSelectedImage;\r
-               }\r
-               return bRes;\r
-       }\r
-\r
-       BOOL SetItemImage(HTREEITEM hItem, int nImage, int nSelectedImage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(hItem, TVIF_IMAGE|TVIF_SELECTEDIMAGE, NULL, nImage, nSelectedImage, 0, 0, NULL);\r
-       }\r
-\r
-       UINT GetItemState(HTREEITEM hItem, UINT nStateMask) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-               return (((UINT)::SendMessage(m_hWnd, TVM_GETITEMSTATE, (WPARAM)hItem, (LPARAM)nStateMask)) & nStateMask);\r
-#else // !((_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE))\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_STATE;\r
-               item.state = 0;\r
-               item.stateMask = nStateMask;\r
-               ::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-               return (item.state & nStateMask);\r
-#endif // !((_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE))\r
-       }\r
-\r
-       BOOL SetItemState(HTREEITEM hItem, UINT nState, UINT nStateMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(hItem, TVIF_STATE, NULL, 0, 0, nState, nStateMask, NULL);\r
-       }\r
-\r
-       DWORD_PTR GetItemData(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_PARAM;\r
-               BOOL bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-               return (DWORD_PTR)(bRet ? item.lParam : NULL);\r
-       }\r
-\r
-       BOOL SetItemData(HTREEITEM hItem, DWORD_PTR dwData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(hItem, TVIF_PARAM, NULL, 0, 0, 0, 0, (LPARAM)dwData);\r
-       }\r
-\r
-       CEdit GetEditControl() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CEdit((HWND)::SendMessage(m_hWnd, TVM_GETEDITCONTROL, 0, 0L));\r
-       }\r
-\r
-       UINT GetVisibleCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, TVM_GETVISIBLECOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetItemRect(HTREEITEM hItem, LPRECT lpRect, BOOL bTextOnly) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               *(HTREEITEM*)lpRect = hItem;\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_GETITEMRECT, (WPARAM)bTextOnly, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL ItemHasChildren(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVITEM item = { 0 };\r
-               item.hItem = hItem;\r
-               item.mask = TVIF_CHILDREN;\r
-               ::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);\r
-               return item.cChildren;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl GetToolTips() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TVM_GETTOOLTIPS, 0, 0L));\r
-       }\r
-\r
-       CToolTipCtrl SetToolTips(HWND hWndTT)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TVM_SETTOOLTIPS, (WPARAM)hWndTT, 0L));\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int GetISearchString(LPTSTR lpstr) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TVM_GETISEARCHSTRING, 0, (LPARAM)lpstr);\r
-       }\r
-\r
-       // checkboxes only\r
-       BOOL GetCheckState(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & TVS_CHECKBOXES) != 0);\r
-               UINT uRet = GetItemState(hItem, TVIS_STATEIMAGEMASK);\r
-               return (uRet >> 12) - 1;\r
-       }\r
-\r
-       BOOL SetCheckState(HTREEITEM hItem, BOOL bCheck)\r
-       {\r
-               int nCheck = bCheck ? 2 : 1;   // one based index\r
-               return SetItemState(hItem, INDEXTOSTATEIMAGEMASK(nCheck), TVIS_STATEIMAGEMASK);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_GETBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetBkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_SETBKCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       COLORREF GetInsertMarkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_GETINSERTMARKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetInsertMarkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       int GetItemHeight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TVM_GETITEMHEIGHT, 0, 0L);\r
-       }\r
-\r
-       int SetItemHeight(int cyHeight)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TVM_SETITEMHEIGHT, cyHeight, 0L);\r
-       }\r
-\r
-       int GetScrollTime() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TVM_GETSCROLLTIME, 0, 0L);\r
-       }\r
-\r
-       int SetScrollTime(int nScrollTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TVM_SETSCROLLTIME, nScrollTime, 0L);\r
-       }\r
-\r
-       COLORREF GetTextColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_GETTEXTCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetTextColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_SETTEXTCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       COLORREF GetLineColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_GETLINECOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetLineColor(COLORREF clrNew /*= CLR_DEFAULT*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TVM_SETLINECOLOR, 0, (LPARAM)clrNew);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL GetItem(LPTVITEMEX pItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem);\r
-       }\r
-\r
-       BOOL SetItem(LPTVITEMEX pItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-       DWORD GetExtendedStyle() const\r
-       {\r
-#ifndef TVM_GETEXTENDEDSTYLE\r
-               const UINT TVM_GETEXTENDEDSTYLE = (TV_FIRST + 45);\r
-#endif\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TVM_GETEXTENDEDSTYLE, 0, 0L);\r
-       }\r
-\r
-       DWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)\r
-       {\r
-#ifndef TVM_SETEXTENDEDSTYLE\r
-               const UINT TVM_SETEXTENDEDSTYLE = (TV_FIRST + 44);\r
-#endif\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TVM_SETEXTENDEDSTYLE, dwMask, dwStyle);\r
-       }\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       BOOL SetAutoScrollInfo(UINT uPixPerSec, UINT uUpdateTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETAUTOSCROLLINFO, (WPARAM)uPixPerSec, (LPARAM)uUpdateTime);\r
-       }\r
-\r
-       DWORD GetSelectedCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TVM_GETSELECTEDCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetItemPartRect(HTREEITEM hItem, TVITEMPART partID, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVGETITEMPARTRECTINFO gipri = { hItem, lpRect, partID };\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_GETITEMPARTRECT, 0, (LPARAM)&gipri);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-// Operations\r
-       HTREEITEM InsertItem(LPTVINSERTSTRUCT lpInsertStruct)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);\r
-       }\r
-\r
-       HTREEITEM InsertItem(LPCTSTR lpszItem, int nImage,\r
-               int nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter); \r
-       }\r
-\r
-       HTREEITEM InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter);\r
-       }\r
-\r
-       HTREEITEM InsertItem(UINT nMask, LPCTSTR lpszItem, int nImage,\r
-               int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,\r
-               HTREEITEM hParent, HTREEITEM hInsertAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVINSERTSTRUCT tvis = { 0 };\r
-               tvis.hParent = hParent;\r
-               tvis.hInsertAfter = hInsertAfter;\r
-               tvis.item.mask = nMask;\r
-               tvis.item.pszText = (LPTSTR) lpszItem;\r
-               tvis.item.iImage = nImage;\r
-               tvis.item.iSelectedImage = nSelectedImage;\r
-               tvis.item.state = nState;\r
-               tvis.item.stateMask = nStateMask;\r
-               tvis.item.lParam = lParam;\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);\r
-       }\r
-\r
-       BOOL DeleteItem(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem);\r
-       }\r
-\r
-       BOOL DeleteAllItems()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);\r
-       }\r
-\r
-       BOOL Expand(HTREEITEM hItem, UINT nCode = TVE_EXPAND)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_EXPAND, nCode, (LPARAM)hItem);\r
-       }\r
-\r
-       HTREEITEM GetNextItem(HTREEITEM hItem, UINT nCode) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);\r
-       }\r
-\r
-       HTREEITEM GetChildItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);\r
-       }\r
-\r
-       HTREEITEM GetNextSiblingItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem); \r
-       }\r
-\r
-       HTREEITEM GetPrevSiblingItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);\r
-       }\r
-\r
-       HTREEITEM GetParentItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); \r
-       }\r
-\r
-       HTREEITEM GetFirstVisibleItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);\r
-       }\r
-\r
-       HTREEITEM GetNextVisibleItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);\r
-       }\r
-\r
-       HTREEITEM GetPrevVisibleItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);\r
-       }\r
-\r
-       HTREEITEM GetSelectedItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);\r
-       }\r
-\r
-       HTREEITEM GetDropHilightItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);\r
-       }\r
-\r
-       HTREEITEM GetRootItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);\r
-       }\r
-\r
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-       HTREEITEM GetLastVisibleItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);\r
-       }\r
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0600)\r
-       HTREEITEM GetNextSelectedItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0600)\r
-\r
-       BOOL Select(HTREEITEM hItem, UINT nCode)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, nCode, (LPARAM)hItem);\r
-       }\r
-\r
-       BOOL SelectItem(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem);\r
-       }\r
-\r
-       BOOL SelectDropTarget(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_DROPHILITE, (LPARAM)hItem);\r
-       }\r
-\r
-       BOOL SelectSetFirstVisible(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_FIRSTVISIBLE, (LPARAM)hItem);\r
-       }\r
-\r
-       CEdit EditLabel(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CEdit((HWND)::SendMessage(m_hWnd, TVM_EDITLABEL, 0, (LPARAM)hItem));\r
-       }\r
-\r
-       BOOL EndEditLabelNow(BOOL bCancel)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_ENDEDITLABELNOW, bCancel, 0L);\r
-       }\r
-\r
-       HTREEITEM HitTest(TVHITTESTINFO* pHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);\r
-       }\r
-\r
-       HTREEITEM HitTest(POINT pt, UINT* pFlags) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVHITTESTINFO hti = { 0 };\r
-               hti.pt = pt;\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);\r
-               if (pFlags != NULL)\r
-                       *pFlags = hti.flags;\r
-               return hTreeItem;\r
-       }\r
-\r
-       BOOL SortChildren(HTREEITEM hItem, BOOL bRecurse = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDREN, (WPARAM)bRecurse, (LPARAM)hItem);\r
-       }\r
-\r
-       BOOL EnsureVisible(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_ENSUREVISIBLE, 0, (LPARAM)hItem);\r
-       }\r
-\r
-       BOOL SortChildrenCB(LPTVSORTCB pSort, BOOL bRecurse = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDRENCB, (WPARAM)bRecurse, (LPARAM)pSort);\r
-       }\r
-\r
-       CImageList RemoveImageList(int nImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_SETIMAGELIST, (WPARAM)nImageList, NULL));\r
-       }\r
-\r
-       CImageList CreateDragImage(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TVM_CREATEDRAGIMAGE, 0, (LPARAM)hItem));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL SetInsertMark(HTREEITEM hTreeItem, BOOL bAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETINSERTMARK, bAfter, (LPARAM)hTreeItem);\r
-       }\r
-\r
-       BOOL RemoveInsertMark()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TVM_SETINSERTMARK, 0, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       HTREEITEM MapAccIDToHTREEITEM(UINT uID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HTREEITEM)::SendMessage(m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);\r
-       }\r
-\r
-       UINT MapHTREEITEMToAccID(HTREEITEM hTreeItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, TVM_MAPHTREEITEMTOACCID, (WPARAM)hTreeItem, 0L);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       void ShowInfoTip(HTREEITEM hItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TVM_SHOWINFOTIP, 0, (LPARAM)hItem);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-};\r
-\r
-typedef CTreeViewCtrlT<ATL::CWindow>   CTreeViewCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTreeViewCtrlEx\r
-\r
-// forward declaration\r
-template <class TBase> class CTreeViewCtrlExT;\r
-\r
-// Note: TBase here is for CTreeViewCtrlExT, and not for CTreeItemT itself\r
-template <class TBase>\r
-class CTreeItemT\r
-{\r
-public:\r
-       HTREEITEM m_hTreeItem;\r
-       CTreeViewCtrlExT<TBase>* m_pTreeView;\r
-\r
-// Construction\r
-       CTreeItemT(HTREEITEM hTreeItem = NULL, CTreeViewCtrlExT<TBase>* pTreeView = NULL) : m_hTreeItem(hTreeItem), m_pTreeView(pTreeView)\r
-       { }\r
\r
-       CTreeItemT(const CTreeItemT<TBase>& posSrc)\r
-       {\r
-               *this = posSrc;\r
-       }\r
-\r
-       operator HTREEITEM() { return m_hTreeItem; }\r
-\r
-       CTreeItemT<TBase>& operator =(const CTreeItemT<TBase>& itemSrc)\r
-       {\r
-               m_hTreeItem = itemSrc.m_hTreeItem;\r
-               m_pTreeView = itemSrc.m_pTreeView;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       CTreeViewCtrlExT<TBase>* GetTreeView() const { return m_pTreeView; }\r
-\r
-       BOOL operator !() const { return m_hTreeItem == NULL; }\r
-\r
-       BOOL IsNull() const { return m_hTreeItem == NULL; }\r
-       \r
-       BOOL GetRect(LPRECT lpRect, BOOL bTextOnly) const;\r
-       BOOL GetText(LPTSTR lpstrText, int nLen) const;\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetText(BSTR& bstrText) const;\r
-#endif // !_ATL_NO_COM\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       BOOL GetText(_CSTRING_NS::CString& strText) const;\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       BOOL SetText(LPCTSTR lpszItem);\r
-       BOOL GetImage(int& nImage, int& nSelectedImage) const;\r
-       BOOL SetImage(int nImage, int nSelectedImage);\r
-       UINT GetState(UINT nStateMask) const;\r
-       BOOL SetState(UINT nState, UINT nStateMask);\r
-       DWORD_PTR GetData() const;\r
-       BOOL SetData(DWORD_PTR dwData);\r
-       BOOL SetItem(UINT nMask, LPCTSTR lpszItem, int nImage, int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam);\r
-\r
-// Operations\r
-       CTreeItemT<TBase> InsertAfter(LPCTSTR lpstrItem, HTREEITEM hItemAfter, int nImageIndex)\r
-       {\r
-               return _Insert(lpstrItem, nImageIndex, hItemAfter);\r
-       }\r
-\r
-       CTreeItemT<TBase> AddHead(LPCTSTR lpstrItem, int nImageIndex)\r
-       {\r
-               return _Insert(lpstrItem, nImageIndex, TVI_FIRST);\r
-       }\r
-\r
-       CTreeItemT<TBase> AddTail(LPCTSTR lpstrItem, int nImageIndex)\r
-       {\r
-               return _Insert(lpstrItem, nImageIndex, TVI_LAST);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetChild() const;\r
-       CTreeItemT<TBase> GetNext(UINT nCode) const;\r
-       CTreeItemT<TBase> GetNextSibling() const;\r
-       CTreeItemT<TBase> GetPrevSibling() const;\r
-       CTreeItemT<TBase> GetParent() const;\r
-       CTreeItemT<TBase> GetFirstVisible() const;\r
-       CTreeItemT<TBase> GetNextVisible() const;\r
-       CTreeItemT<TBase> GetPrevVisible() const;\r
-       CTreeItemT<TBase> GetSelected() const;\r
-       CTreeItemT<TBase> GetDropHilight() const;\r
-       CTreeItemT<TBase> GetRoot() const;\r
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-       CTreeItemT<TBase> GetLastVisible() const;\r
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-#if (_WIN32_IE >= 0x0600)\r
-       CTreeItemT<TBase> GetNextSelected() const;\r
-#endif // (_WIN32_IE >= 0x0600)\r
-       BOOL HasChildren() const;\r
-       BOOL Delete();\r
-       BOOL Expand(UINT nCode = TVE_EXPAND);\r
-       BOOL Select(UINT nCode);\r
-       BOOL Select();\r
-       BOOL SelectDropTarget();\r
-       BOOL SelectSetFirstVisible();\r
-       HWND EditLabel();\r
-       HIMAGELIST CreateDragImage();\r
-       BOOL SortChildren(BOOL bRecurse = FALSE);\r
-       BOOL EnsureVisible();\r
-       CTreeItemT<TBase> _Insert(LPCTSTR lpstrItem, int nImageIndex, HTREEITEM hItemAfter);\r
-       int GetImageIndex() const;\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL SetInsertMark(BOOL bAfter);\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       UINT MapHTREEITEMToAccID() const;\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       void ShowInfoTip();\r
-       BOOL GetPartRect(TVITEMPART partID, LPRECT lpRect) const;\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-};\r
-\r
-typedef CTreeItemT<ATL::CWindow>   CTreeItem;\r
-\r
-\r
-template <class TBase>\r
-class CTreeViewCtrlExT : public CTreeViewCtrlT< TBase >\r
-{\r
-public:\r
-// Constructors\r
-       CTreeViewCtrlExT(HWND hWnd = NULL) : CTreeViewCtrlT< TBase >(hWnd)\r
-       { }\r
-\r
-       CTreeViewCtrlExT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Operations (overides that return CTreeItem)\r
-       CTreeItemT<TBase> InsertItem(LPTVINSERTSTRUCT lpInsertStruct)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct);\r
-               return CTreeItemT<TBase>(hTreeItem, this);\r
-       }\r
-\r
-       CTreeItemT<TBase> InsertItem(LPCTSTR lpszItem, int nImage,\r
-               int nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter); \r
-       }\r
-\r
-       CTreeItemT<TBase> InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetNextItem(HTREEITEM hItem, UINT nCode) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetChildItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this); \r
-       }\r
-\r
-       CTreeItemT<TBase> GetNextSiblingItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem); \r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetPrevSiblingItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetParentItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); \r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetFirstVisibleItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd)); \r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetNextVisibleItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetPrevVisibleItem(HTREEITEM hItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetSelectedItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetDropHilightItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> GetRootItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-       CTreeItemT<TBase> GetLastVisibleItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_LASTVISIBLE, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0600)\r
-       CTreeItemT<TBase> GetNextSelectedItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0600)\r
-\r
-       CTreeItemT<TBase> HitTest(TVHITTESTINFO* pHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-       CTreeItemT<TBase> InsertItem(UINT nMask, LPCTSTR lpszItem, int nImage,\r
-               int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,\r
-               HTREEITEM hParent, HTREEITEM hInsertAfter)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVINSERTSTRUCT tvis = { 0 };\r
-               tvis.hParent = hParent;\r
-               tvis.hInsertAfter = hInsertAfter;\r
-               tvis.item.mask = nMask;\r
-               tvis.item.pszText = (LPTSTR) lpszItem;\r
-               tvis.item.iImage = nImage;\r
-               tvis.item.iSelectedImage = nSelectedImage;\r
-               tvis.item.state = nState;\r
-               tvis.item.stateMask = nStateMask;\r
-               tvis.item.lParam = lParam;\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);\r
-               return CTreeItemT<TBase>(hTreeItem, this);\r
-       }\r
-\r
-       CTreeItemT<TBase> HitTest(POINT pt, UINT* pFlags) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TVHITTESTINFO hti = { 0 };\r
-               hti.pt = pt;\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)&hti);\r
-               if (pFlags != NULL)\r
-                       *pFlags = hti.flags;\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       CTreeItemT<TBase> MapAccIDToHTREEITEM(UINT uID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HTREEITEM hTreeItem = (HTREEITEM)::SendMessage(m_hWnd, TVM_MAPACCIDTOHTREEITEM, uID, 0L);\r
-               return CTreeItemT<TBase>(hTreeItem, (CTreeViewCtrlExT<TBase>*)this);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-};\r
-\r
-typedef CTreeViewCtrlExT<ATL::CWindow>   CTreeViewCtrlEx;\r
-\r
-\r
-// CTreeItem inline methods\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::GetRect(LPRECT lpRect, BOOL bTextOnly) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemRect(m_hTreeItem,lpRect,bTextOnly);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetNext(UINT nCode) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetNextItem(m_hTreeItem,nCode);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetChild() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetChildItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetNextSibling() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetNextSiblingItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetPrevSibling() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetPrevSiblingItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetParent() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetParentItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetFirstVisible() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetFirstVisibleItem();\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetNextVisible() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetNextVisibleItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetPrevVisible() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetPrevVisibleItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetSelected() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetSelectedItem();\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetDropHilight() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetDropHilightItem();\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetRoot() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetRootItem();\r
-}\r
-\r
-#if !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetLastVisible() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetLastVisibleItem();\r
-}\r
-#endif // !defined(_WIN32_WCE) && (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0600)\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::GetNextSelected() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetNextSelectedItem();\r
-}\r
-#endif // (_WIN32_IE >= 0x0600)\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::GetText(LPTSTR lpstrText, int nLen) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemText(m_hTreeItem, lpstrText, nLen);\r
-}\r
-\r
-#ifndef _ATL_NO_COM\r
-#ifdef _OLEAUTO_H_\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::GetText(BSTR& bstrText) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemText(m_hTreeItem, bstrText);\r
-}\r
-#endif // _OLEAUTO_H_\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::GetText(_CSTRING_NS::CString& strText) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemText(m_hTreeItem, strText);\r
-}\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::GetImage(int& nImage, int& nSelectedImage) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemImage(m_hTreeItem,nImage,nSelectedImage);\r
-}\r
-\r
-template <class TBase>\r
-inline UINT CTreeItemT<TBase>::GetState(UINT nStateMask) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemState(m_hTreeItem,nStateMask);\r
-}\r
-\r
-template <class TBase>\r
-inline DWORD_PTR CTreeItemT<TBase>::GetData() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemData(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SetItem(UINT nMask, LPCTSTR lpszItem, int nImage,\r
-               int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SetItem(m_hTreeItem, nMask, lpszItem, nImage, nSelectedImage, nState, nStateMask, lParam);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SetText(LPCTSTR lpszItem)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SetItemText(m_hTreeItem,lpszItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SetImage(int nImage, int nSelectedImage)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SetItemImage(m_hTreeItem,nImage,nSelectedImage);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SetState(UINT nState, UINT nStateMask)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SetItemState(m_hTreeItem,nState,nStateMask);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SetData(DWORD_PTR dwData)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SetItemData(m_hTreeItem,dwData);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::HasChildren() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->ItemHasChildren(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::Delete()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->DeleteItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::Expand(UINT nCode /*= TVE_EXPAND*/)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->Expand(m_hTreeItem,nCode);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::Select(UINT nCode)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->Select(m_hTreeItem,nCode);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::Select()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SelectItem(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SelectDropTarget()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SelectDropTarget(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SelectSetFirstVisible()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SelectSetFirstVisible(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline HWND CTreeItemT<TBase>::EditLabel()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->EditLabel(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline HIMAGELIST CTreeItemT<TBase>::CreateDragImage()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->CreateDragImage(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SortChildren(BOOL bRecurse /*= FALSE*/)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SortChildren(m_hTreeItem, bRecurse);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::EnsureVisible()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->EnsureVisible(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline CTreeItemT<TBase> CTreeItemT<TBase>::_Insert(LPCTSTR lpstrItem, int nImageIndex, HTREEITEM hItemAfter)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       TVINSERTSTRUCT ins = { 0 };\r
-       ins.hParent = m_hTreeItem;\r
-       ins.hInsertAfter = hItemAfter;\r
-       ins.item.mask = TVIF_TEXT;\r
-       ins.item.pszText = (LPTSTR)lpstrItem;\r
-       if(nImageIndex != -1)\r
-       {\r
-               ins.item.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;\r
-               ins.item.iImage = nImageIndex;\r
-               ins.item.iSelectedImage = nImageIndex;\r
-       }\r
-       return CTreeItemT<TBase>(m_pTreeView->InsertItem(&ins), m_pTreeView);\r
-}\r
-\r
-template <class TBase>\r
-inline int CTreeItemT<TBase>::GetImageIndex() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       TVITEM item = { 0 };\r
-       item.mask = TVIF_HANDLE | TVIF_IMAGE;\r
-       item.hItem = m_hTreeItem;\r
-       m_pTreeView->GetItem(&item);\r
-       return item.iImage;\r
-}\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::SetInsertMark(BOOL bAfter)\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->SetInsertMark(m_hTreeItem, bAfter);\r
-}\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-template <class TBase>\r
-inline UINT CTreeItemT<TBase>::MapHTREEITEMToAccID() const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->MapHTREEITEMToAccID(m_hTreeItem);\r
-}\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-template <class TBase>\r
-inline void CTreeItemT<TBase>::ShowInfoTip()\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       m_pTreeView->ShowInfoTip(m_hTreeItem);\r
-}\r
-\r
-template <class TBase>\r
-inline BOOL CTreeItemT<TBase>::GetPartRect(TVITEMPART partID, LPRECT lpRect) const\r
-{\r
-       ATLASSERT(m_pTreeView != NULL);\r
-       return m_pTreeView->GetItemPartRect(m_hTreeItem, partID, lpRect);\r
-}\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CToolBarCtrl\r
-\r
-template <class TBase>\r
-class CToolBarCtrlT : public TBase\r
-{\r
-public:\r
-// Construction\r
-       CToolBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CToolBarCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return TOOLBARCLASSNAME;\r
-       }\r
-\r
-       BOOL IsButtonEnabled(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONENABLED, nID, 0L);\r
-       }\r
-\r
-       BOOL IsButtonChecked(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONCHECKED, nID, 0L);\r
-       }\r
-\r
-       BOOL IsButtonPressed(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONPRESSED, nID, 0L);\r
-       }\r
-\r
-       BOOL IsButtonHidden(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return(BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIDDEN, nID, 0L);\r
-       }\r
-\r
-       BOOL IsButtonIndeterminate(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0L);\r
-       }\r
-\r
-       int GetState(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETSTATE, nID, 0L);\r
-       }\r
-\r
-       BOOL SetState(int nID, UINT nState)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0));\r
-       }\r
-\r
-       BOOL GetButton(int nIndex, LPTBBUTTON lpButton) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETBUTTON, nIndex, (LPARAM)lpButton);\r
-       }\r
-\r
-       int GetButtonCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_BUTTONCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetItemRect(int nIndex, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETITEMRECT, nIndex, (LPARAM)lpRect);\r
-       }\r
-\r
-       void SetButtonStructSize(int nSize = sizeof(TBBUTTON))\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L);\r
-       }\r
-\r
-       BOOL SetButtonSize(SIZE size)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy));\r
-       }\r
-\r
-       BOOL SetButtonSize(int cx, int cy)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(cx, cy));\r
-       }\r
-\r
-       BOOL SetBitmapSize(SIZE size)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy));\r
-       }\r
-\r
-       BOOL SetBitmapSize(int cx, int cy)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(cx, cy));\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl GetToolTips() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TB_GETTOOLTIPS, 0, 0L));\r
-       }\r
-\r
-       void SetToolTips(HWND hWndToolTip)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void SetNotifyWnd(HWND hWnd)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETPARENT, (WPARAM)hWnd, 0L);\r
-       }\r
-\r
-       int GetRows() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETROWS, 0, 0L);\r
-       }\r
-\r
-       void SetRows(int nRows, BOOL bLarger, LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL SetCmdID(int nIndex, UINT nID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETCMDID, nIndex, nID);\r
-       }\r
-\r
-       DWORD GetBitmapFlags() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TB_GETBITMAPFLAGS, 0, 0L);\r
-       }\r
-\r
-       int GetBitmap(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETBITMAP, nID, 0L);\r
-       }\r
-\r
-       int GetButtonText(int nID, LPTSTR lpstrText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETBUTTONTEXT, nID, (LPARAM)lpstrText);\r
-       }\r
-\r
-       // nIndex - IE5 or higher only\r
-       CImageList GetImageList(int nIndex = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETIMAGELIST, nIndex, 0L));\r
-       }\r
-\r
-       // nIndex - IE5 or higher only\r
-       CImageList SetImageList(HIMAGELIST hImageList, int nIndex = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETIMAGELIST, nIndex, (LPARAM)hImageList));\r
-       }\r
-\r
-       // nIndex - IE5 or higher only\r
-       CImageList GetDisabledImageList(int nIndex = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETDISABLEDIMAGELIST, nIndex, 0L));\r
-       }\r
-\r
-       // nIndex - IE5 or higher only\r
-       CImageList SetDisabledImageList(HIMAGELIST hImageList, int nIndex = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETDISABLEDIMAGELIST, nIndex, (LPARAM)hImageList));\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       // nIndex - IE5 or higher only\r
-       CImageList GetHotImageList(int nIndex = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETHOTIMAGELIST, nIndex, 0L));\r
-       }\r
-\r
-       // nIndex - IE5 or higher only\r
-       CImageList SetHotImageList(HIMAGELIST hImageList, int nIndex = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETHOTIMAGELIST, nIndex, (LPARAM)hImageList));\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       DWORD GetStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TB_GETSTYLE, 0, 0L);\r
-       }\r
-\r
-       void SetStyle(DWORD dwStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETSTYLE, 0, dwStyle);\r
-       }\r
-\r
-       DWORD GetButtonSize() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L);\r
-       }\r
-\r
-       void GetButtonSize(SIZE& size) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L);\r
-               size.cx = LOWORD(dwRet);\r
-               size.cy = HIWORD(dwRet);\r
-       }\r
-\r
-       BOOL GetRect(int nID, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETRECT, nID, (LPARAM)lpRect);\r
-       }\r
-\r
-       int GetTextRows() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETTEXTROWS, 0, 0L);\r
-       }\r
-\r
-       BOOL SetButtonWidth(int cxMin, int cxMax)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax));\r
-       }\r
-\r
-       BOOL SetIndent(int nIndent)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETINDENT, nIndent, 0L);\r
-       }\r
-\r
-       BOOL SetMaxTextRows(int nMaxTextRows)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETMAXTEXTROWS, nMaxTextRows, 0L);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-#ifndef _WIN32_WCE\r
-       BOOL GetAnchorHighlight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetAnchorHighlight(BOOL bEnable = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETANCHORHIGHLIGHT, bEnable, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int GetButtonInfo(int nID, LPTBBUTTONINFO lptbbi) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)lptbbi);\r
-       }\r
-\r
-       BOOL SetButtonInfo(int nID, LPTBBUTTONINFO lptbbi)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)lptbbi);\r
-       }\r
-\r
-       BOOL SetButtonInfo(int nID, DWORD dwMask, BYTE Style, BYTE State, LPCTSTR lpszItem, \r
-                          int iImage, WORD cx, int iCommand, DWORD_PTR lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TBBUTTONINFO tbbi = { 0 };\r
-               tbbi.cbSize = sizeof(TBBUTTONINFO);\r
-               tbbi.dwMask = dwMask;\r
-               tbbi.idCommand = iCommand;\r
-               tbbi.iImage = iImage;\r
-               tbbi.fsState = State;\r
-               tbbi.fsStyle = Style;\r
-               tbbi.cx = cx;\r
-               tbbi.pszText = (LPTSTR) lpszItem;\r
-               tbbi.lParam = lParam;\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)&tbbi);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetHotItem() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETHOTITEM, 0, 0L);\r
-       }\r
-\r
-       int SetHotItem(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_SETHOTITEM, nItem, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL IsButtonHighlighted(int nButtonID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ISBUTTONHIGHLIGHTED, nButtonID, 0L);\r
-       }\r
-\r
-       DWORD SetDrawTextFlags(DWORD dwMask, DWORD dwFlags)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwFlags);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetColorScheme(LPCOLORSCHEME lpcs) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETCOLORSCHEME, 0, (LPARAM)lpcs);\r
-       }\r
-\r
-       void SetColorScheme(LPCOLORSCHEME lpcs)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETCOLORSCHEME, 0, (LPARAM)lpcs);\r
-       }\r
-\r
-       DWORD GetExtendedStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L);\r
-       }\r
-\r
-       DWORD SetExtendedStyle(DWORD dwStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwStyle);\r
-       }\r
-\r
-       void GetInsertMark(LPTBINSERTMARK lptbim) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)lptbim);\r
-       }\r
-\r
-       void SetInsertMark(LPTBINSERTMARK lptbim)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)lptbim);\r
-       }\r
-\r
-       COLORREF GetInsertMarkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetInsertMarkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       BOOL GetMaxSize(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)lpSize);\r
-       }\r
-\r
-       void GetPadding(LPSIZE lpSizePadding) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpSizePadding != NULL);\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TB_GETPADDING, 0, 0L);\r
-               lpSizePadding->cx = GET_X_LPARAM(dwRet);\r
-               lpSizePadding->cy = GET_Y_LPARAM(dwRet);\r
-       }\r
-\r
-       void SetPadding(int cx, int cy, LPSIZE lpSizePadding = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, TB_SETPADDING, 0, MAKELPARAM(cx, cy));\r
-               if(lpSizePadding != NULL)\r
-               {\r
-                       lpSizePadding->cx = GET_X_LPARAM(dwRet);\r
-                       lpSizePadding->cy = GET_Y_LPARAM(dwRet);\r
-               }\r
-       }\r
-\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       int GetString(int nString, LPTSTR lpstrString, int cchMaxLen) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(cchMaxLen, nString), (LPARAM)lpstrString);\r
-       }\r
-\r
-       int GetStringBSTR(int nString, BSTR& bstrString) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrString == NULL);\r
-               int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));\r
-               if(nLength != -1)\r
-               {\r
-                       CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-                       LPTSTR lpstrText = buff.Allocate(nLength + 1);\r
-                       if(lpstrText != NULL)\r
-                       {\r
-                               nLength = (int)::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstrText);\r
-                               if(nLength != -1)\r
-                                       bstrString = ::SysAllocString(T2OLE(lpstrText));\r
-                       }\r
-                       else\r
-                       {\r
-                               nLength = -1;\r
-                       }\r
-               }\r
-\r
-               return nLength;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetString(int nString, _CSTRING_NS::CString& str) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(0, nString), NULL));\r
-               if(nLength != -1)\r
-               {\r
-                       LPTSTR lpstr = str.GetBufferSetLength(nLength + 1);\r
-                       if(lpstr != NULL)\r
-                               nLength = (int)::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(nLength + 1, nString), (LPARAM)lpstr);\r
-                       else\r
-                               nLength = -1;\r
-                       str.ReleaseBuffer();\r
-               }\r
-               return nLength;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       void GetMetrics(LPTBMETRICS lptbm) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_GETMETRICS, 0, (LPARAM)lptbm);\r
-       }\r
-\r
-       void SetMetrics(LPTBMETRICS lptbm)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETMETRICS, 0, (LPARAM)lptbm);\r
-       }\r
-\r
-       void SetWindowTheme(LPCWSTR lpstrTheme)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       CImageList GetPressedImageList(int nIndex = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_GETPRESSEDIMAGELIST, nIndex, 0L));\r
-       }\r
-\r
-       CImageList SetPressedImageList(HIMAGELIST hImageList, int nIndex = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TB_SETPRESSEDIMAGELIST, nIndex, (LPARAM)hImageList));\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-// Operations\r
-       BOOL EnableButton(int nID, BOOL bEnable = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0));\r
-       }\r
-\r
-       BOOL CheckButton(int nID, BOOL bCheck = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0));\r
-       }\r
-\r
-       BOOL PressButton(int nID, BOOL bPress = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0));\r
-       }\r
-\r
-       BOOL HideButton(int nID, BOOL bHide = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0));\r
-       }\r
-\r
-       BOOL Indeterminate(int nID, BOOL bIndeterminate = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0));\r
-       }\r
-\r
-       int AddBitmap(int nNumButtons, UINT nBitmapID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TBADDBITMAP tbab = { 0 };\r
-               tbab.hInst = ModuleHelper::GetResourceInstance();\r
-               ATLASSERT(tbab.hInst != NULL);\r
-               tbab.nID = nBitmapID;\r
-               return (int)::SendMessage(m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);\r
-       }\r
-\r
-       int AddBitmap(int nNumButtons, HBITMAP hBitmap)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TBADDBITMAP tbab = { 0 };\r
-               tbab.hInst = NULL;\r
-               tbab.nID = (UINT_PTR)hBitmap;\r
-               return (int)::SendMessage(m_hWnd, TB_ADDBITMAP, (WPARAM)nNumButtons, (LPARAM)&tbab);\r
-       }\r
-\r
-       BOOL AddButtons(int nNumButtons, LPTBBUTTON lpButtons)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons);\r
-       }\r
-\r
-       BOOL InsertButton(int nIndex, LPTBBUTTON lpButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton);\r
-       }\r
-\r
-       BOOL InsertButton(int nIndex, int iCommand, BYTE Style, BYTE State, int iBitmap, \r
-                         INT_PTR iString, DWORD_PTR lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TBBUTTON tbb = { 0 };\r
-               tbb.fsStyle = Style;\r
-               tbb.fsState = State;\r
-               tbb.idCommand = iCommand;\r
-               tbb.iBitmap = iBitmap;\r
-               tbb.iString = iString;\r
-               tbb.dwData = lParam;\r
-               return (BOOL)::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)&tbb);\r
-       }\r
-\r
-       BOOL InsertButton(int nIndex, int iCommand, BYTE Style, BYTE State, int iBitmap, \r
-                         LPCTSTR lpszItem, DWORD_PTR lParam)\r
-       {\r
-               return InsertButton(nIndex, iCommand, Style, State, iBitmap, (INT_PTR)lpszItem, lParam);\r
-       }\r
-\r
-       BOOL AddButton(LPTBBUTTON lpButton)\r
-       {\r
-               return InsertButton(-1, lpButton);\r
-       }\r
-\r
-       BOOL AddButton(int iCommand, BYTE Style, BYTE State, int iBitmap, INT_PTR iString, DWORD_PTR lParam)\r
-       {\r
-               return InsertButton(-1, iCommand, Style, State, iBitmap, iString, lParam);\r
-       }\r
-\r
-       BOOL AddButton(int iCommand, BYTE Style, BYTE State, int iBitmap, LPCTSTR lpszItem, DWORD_PTR lParam)\r
-       {\r
-               return InsertButton(-1, iCommand, Style, State, iBitmap, lpszItem, lParam);\r
-       }\r
-\r
-       BOOL DeleteButton(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_DELETEBUTTON, nIndex, 0L);\r
-       }\r
-\r
-       UINT CommandToIndex(UINT nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, TB_COMMANDTOINDEX, nID, 0L);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       void SaveState(HKEY hKeyRoot, LPCTSTR lpszSubKey, LPCTSTR lpszValueName)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TBSAVEPARAMS tbs = { 0 };\r
-               tbs.hkr = hKeyRoot;\r
-               tbs.pszSubKey = lpszSubKey;\r
-               tbs.pszValueName = lpszValueName;\r
-               ::SendMessage(m_hWnd, TB_SAVERESTORE, (WPARAM)TRUE, (LPARAM)&tbs);\r
-       }\r
-\r
-       void RestoreState(HKEY hKeyRoot, LPCTSTR lpszSubKey, LPCTSTR lpszValueName)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TBSAVEPARAMS tbs = { 0 };\r
-               tbs.hkr = hKeyRoot;\r
-               tbs.pszSubKey = lpszSubKey;\r
-               tbs.pszValueName = lpszValueName;\r
-               ::SendMessage(m_hWnd, TB_SAVERESTORE, (WPARAM)FALSE, (LPARAM)&tbs);\r
-       }\r
-\r
-       void Customize()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_CUSTOMIZE, 0, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int AddString(UINT nStringID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_ADDSTRING, (WPARAM)ModuleHelper::GetResourceInstance(), (LPARAM)nStringID);\r
-       }\r
-\r
-       int AddStrings(LPCTSTR lpszStrings)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings);\r
-       }\r
-\r
-       void AutoSize()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TB_AUTOSIZE, 0, 0L);\r
-       }\r
-\r
-       BOOL ChangeBitmap(int nID, int nBitmap)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_CHANGEBITMAP, nID, MAKELPARAM(nBitmap, 0));\r
-       }\r
-\r
-       int LoadImages(int nBitmapID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)ModuleHelper::GetResourceInstance());\r
-       }\r
-\r
-       int LoadStdImages(int nBitmapID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_LOADIMAGES, nBitmapID, (LPARAM)HINST_COMMCTRL);\r
-       }\r
-\r
-       BOOL ReplaceBitmap(LPTBREPLACEBITMAP ptbrb)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_REPLACEBITMAP, 0, (LPARAM)ptbrb);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       int HitTest(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)lpPoint);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL InsertMarkHitTest(LPPOINT lpPoint, LPTBINSERTMARK lptbim) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)lpPoint, (LPARAM)lptbim);\r
-       }\r
-\r
-       BOOL InsertMarkHitTest(int x, int y, LPTBINSERTMARK lptbim) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               POINT pt = { x, y };\r
-               return (BOOL)::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)&pt, (LPARAM)lptbim);\r
-       }\r
-\r
-       BOOL MapAccelerator(TCHAR chAccel, int& nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)&nID);\r
-       }\r
-\r
-       BOOL MarkButton(int nID, BOOL bHighlight = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0));\r
-       }\r
-\r
-       BOOL MoveButton(int nOldPos, int nNewPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos);\r
-       }\r
-\r
-       HRESULT GetObject(REFIID iid, LPVOID* ppvObject)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HRESULT)::SendMessage(m_hWnd, TB_GETOBJECT, (WPARAM)&iid, (LPARAM)ppvObject);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-};\r
-\r
-typedef CToolBarCtrlT<ATL::CWindow>   CToolBarCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStatusBarCtrl\r
-\r
-template <class TBase>\r
-class CStatusBarCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CStatusBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CStatusBarCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Methods\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return STATUSCLASSNAME;\r
-       }\r
-\r
-       int GetParts(int nParts, int* pParts) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, SB_GETPARTS, nParts, (LPARAM)pParts);\r
-       }\r
-\r
-       BOOL SetParts(int nParts, int* pWidths)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, SB_SETPARTS, nParts, (LPARAM)pWidths);\r
-       }\r
-\r
-       int GetTextLength(int nPane, int* pType = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L);\r
-               if (pType != NULL)\r
-                       *pType = (int)(short)HIWORD(dwRet);\r
-               return (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-       int GetText(int nPane, LPTSTR lpszText, int* pType = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, SB_GETTEXT, (WPARAM)nPane, (LPARAM)lpszText);\r
-               if(pType != NULL)\r
-                       *pType = (int)(short)HIWORD(dwRet);\r
-               return (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetTextBSTR(int nPane, BSTR& bstrText, int* pType = NULL) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               ATLASSERT(bstrText == NULL);\r
-               int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));\r
-               if(nLength == 0)\r
-                       return FALSE;\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrText = buff.Allocate(nLength + 1);\r
-               if(lpstrText == NULL)\r
-                       return FALSE;\r
-\r
-               if(!GetText(nPane, lpstrText, pType))\r
-                       return FALSE;\r
-\r
-               bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetText(int nPane, _CSTRING_NS::CString& strText, int* pType = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               int nLength = (int)(short)LOWORD(::SendMessage(m_hWnd, SB_GETTEXTLENGTH, (WPARAM)nPane, 0L));\r
-               if(nLength == 0)\r
-                       return 0;\r
-\r
-               LPTSTR lpstr = strText.GetBufferSetLength(nLength);\r
-               if(lpstr == NULL)\r
-                       return 0;\r
-               return GetText(nPane, lpstr, pType);\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       BOOL SetText(int nPane, LPCTSTR lpszText, int nType = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               return (BOOL)::SendMessage(m_hWnd, SB_SETTEXT, (nPane | nType), (LPARAM)lpszText);\r
-       }\r
-\r
-       BOOL GetRect(int nPane, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               return (BOOL)::SendMessage(m_hWnd, SB_GETRECT, nPane, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL GetBorders(int* pBorders) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, SB_GETBORDERS, 0, (LPARAM)pBorders);\r
-       }\r
-\r
-       BOOL GetBorders(int& nHorz, int& nVert, int& nSpacing) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int borders[3] = { 0, 0, 0 };\r
-               BOOL bResult = (BOOL)::SendMessage(m_hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);\r
-               if(bResult)\r
-               {\r
-                       nHorz = borders[0];\r
-                       nVert = borders[1];\r
-                       nSpacing = borders[2];\r
-               }\r
-               return bResult;\r
-       }\r
-\r
-       void SetMinHeight(int nMin)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, SB_SETMINHEIGHT, nMin, 0L);\r
-       }\r
-\r
-       BOOL SetSimple(BOOL bSimple = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, SB_SIMPLE, bSimple, 0L);\r
-       }\r
-\r
-       BOOL IsSimple() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, SB_ISSIMPLE, 0, 0L);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, SB_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, SB_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-\r
-       void GetTipText(int nPane, LPTSTR lpstrText, int nSize) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               ::SendMessage(m_hWnd, SB_GETTIPTEXT, MAKEWPARAM(nPane, nSize), (LPARAM)lpstrText);\r
-       }\r
-\r
-       void SetTipText(int nPane, LPCTSTR lpstrText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               ::SendMessage(m_hWnd, SB_SETTIPTEXT, nPane, (LPARAM)lpstrText);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))\r
-       COLORREF SetBkColor(COLORREF clrBk)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, SB_SETBKCOLOR, 0, (LPARAM)clrBk);\r
-       }\r
-\r
-       HICON GetIcon(int nPane) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               return (HICON)::SendMessage(m_hWnd, SB_GETICON, nPane, 0L);\r
-       }\r
-\r
-       BOOL SetIcon(int nPane, HICON hIcon)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPane < 256);\r
-               return (BOOL)::SendMessage(m_hWnd, SB_SETICON, nPane, (LPARAM)hIcon);\r
-       }\r
-#endif // ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))\r
-};\r
-\r
-typedef CStatusBarCtrlT<ATL::CWindow>   CStatusBarCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTabCtrl\r
-\r
-template <class TBase>\r
-class CTabCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CTabCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CTabCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_TABCONTROL;\r
-       }\r
-\r
-       CImageList GetImageList() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TCM_GETIMAGELIST, 0, 0L));\r
-       }\r
-\r
-       CImageList SetImageList(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, TCM_SETIMAGELIST, 0, (LPARAM)hImageList));\r
-       }\r
-\r
-       int GetItemCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_GETITEMCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetItem(int nItem, LPTCITEM pTabCtrlItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_GETITEM, nItem, (LPARAM)pTabCtrlItem);\r
-       }\r
-\r
-       BOOL SetItem(int nItem, LPTCITEM pTabCtrlItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem);\r
-       }\r
-\r
-       int SetItem(int nItem, UINT mask, LPCTSTR lpszItem, DWORD dwState, DWORD dwStateMask, int iImage, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TCITEM tci = { 0 };\r
-               tci.mask = mask;\r
-               tci.pszText = (LPTSTR) lpszItem;\r
-               tci.dwState = dwState;\r
-               tci.dwStateMask = dwStateMask;\r
-               tci.iImage = iImage;\r
-               tci.lParam = lParam;\r
-               return (int)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)&tci);\r
-       }\r
-\r
-       BOOL GetItemRect(int nItem, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_GETITEMRECT, nItem, (LPARAM)lpRect);\r
-       }\r
-\r
-       int GetCurSel() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_GETCURSEL, 0, 0L);\r
-       }\r
-\r
-       int SetCurSel(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_SETCURSEL, nItem, 0L);\r
-       }\r
-\r
-       SIZE SetItemSize(SIZE size)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwSize = (DWORD)::SendMessage(m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(size.cx, size.cy));\r
-               SIZE sizeRet = { GET_X_LPARAM(dwSize), GET_Y_LPARAM(dwSize) };\r
-               return sizeRet;\r
-       }\r
-\r
-       void SetItemSize(int cx, int cy)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(cx, cy));\r
-       }\r
-\r
-       void SetPadding(SIZE size)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_SETPADDING, 0, MAKELPARAM(size.cx, size.cy));\r
-       }\r
-\r
-       int GetRowCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_GETROWCOUNT, 0, 0L);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl GetTooltips() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TCM_GETTOOLTIPS, 0, 0L));\r
-       }\r
-\r
-       void SetTooltips(HWND hWndToolTip)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_SETTOOLTIPS, (WPARAM)hWndToolTip, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int GetCurFocus() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_GETCURFOCUS, 0, 0L);\r
-       }\r
-\r
-       void SetCurFocus(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_SETCURFOCUS, nItem, 0L);\r
-       }\r
-\r
-       BOOL SetItemExtra(int cbExtra)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetItemCount() == 0);   // must be empty\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_SETITEMEXTRA, cbExtra, 0L);\r
-       }\r
-\r
-       int SetMinTabWidth(int nWidth = -1)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_SETMINTABWIDTH, 0, nWidth);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       DWORD GetExtendedStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TCM_GETEXTENDEDSTYLE, 0, 0L);\r
-       }\r
-\r
-       DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, TCM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-// Operations\r
-       int InsertItem(int nItem, LPTCITEM pTabCtrlItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)pTabCtrlItem);\r
-       }\r
-\r
-       int InsertItem(int nItem, UINT mask, LPCTSTR lpszItem, int iImage, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TCITEM tci = { 0 };\r
-               tci.mask = mask;\r
-               tci.pszText = (LPTSTR) lpszItem;\r
-               tci.iImage = iImage;\r
-               tci.lParam = lParam;\r
-               return (int)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);\r
-       }\r
-\r
-       int InsertItem(int nItem, LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TCITEM tci = { 0 };\r
-               tci.mask = TCIF_TEXT;\r
-               tci.pszText = (LPTSTR) lpszItem;\r
-               return (int)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)&tci);\r
-       }\r
-\r
-       int AddItem(LPTCITEM pTabCtrlItem)\r
-       {\r
-               return InsertItem(GetItemCount(), pTabCtrlItem);\r
-       }\r
-\r
-       int AddItem(UINT mask, LPCTSTR lpszItem, int iImage, LPARAM lParam)\r
-       {\r
-               return InsertItem(GetItemCount(), mask, lpszItem, iImage, lParam);\r
-       }\r
-\r
-       int AddItem(LPCTSTR lpszItem)\r
-       {\r
-               return InsertItem(GetItemCount(), lpszItem);\r
-       }\r
-\r
-       BOOL DeleteItem(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_DELETEITEM, nItem, 0L);\r
-       }\r
-\r
-       BOOL DeleteAllItems()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_DELETEALLITEMS, 0, 0L);\r
-       }\r
-\r
-       void AdjustRect(BOOL bLarger, LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_ADJUSTRECT, bLarger, (LPARAM)lpRect);\r
-       }\r
-\r
-       void RemoveImage(int nImage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_REMOVEIMAGE, nImage, 0L);\r
-       }\r
-\r
-       int HitTest(TC_HITTESTINFO* pHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TCM_HITTEST, 0, (LPARAM)pHitTestInfo);\r
-       }\r
-\r
-       void DeselectAll(BOOL bExcludeFocus = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TCM_DESELECTALL, bExcludeFocus, 0L);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       BOOL HighlightItem(int nIndex, BOOL bHighlight = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TCM_HIGHLIGHTITEM, nIndex, MAKELPARAM(bHighlight, 0));\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-};\r
-\r
-typedef CTabCtrlT<ATL::CWindow>   CTabCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTrackBarCtrl\r
-\r
-template <class TBase>\r
-class CTrackBarCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CTrackBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CTrackBarCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return TRACKBAR_CLASS;\r
-       }\r
-\r
-       int GetLineSize() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETLINESIZE, 0, 0L);\r
-       }\r
-\r
-       int SetLineSize(int nSize)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_SETLINESIZE, 0, nSize);\r
-       }\r
-\r
-       int GetPageSize() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETPAGESIZE, 0, 0L);\r
-       }\r
-\r
-       int SetPageSize(int nSize)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_SETPAGESIZE, 0, nSize);\r
-       }\r
-\r
-       int GetRangeMin() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETRANGEMIN, 0, 0L);\r
-       }\r
-\r
-       void SetRangeMin(int nMin, BOOL bRedraw = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETRANGEMIN, bRedraw, nMin);\r
-       }\r
-\r
-       int GetRangeMax() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETRANGEMAX, 0, 0L);\r
-       }\r
-\r
-       void SetRangeMax(int nMax, BOOL bRedraw = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETRANGEMAX, bRedraw, nMax);\r
-       }\r
-\r
-       void GetRange(int& nMin, int& nMax) const\r
-       {\r
-               nMin = GetRangeMin();\r
-               nMax = GetRangeMax();\r
-       }\r
-\r
-       void SetRange(int nMin, int nMax, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETRANGE, bRedraw, MAKELPARAM(nMin, nMax));\r
-       }\r
-\r
-       int GetSelStart() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETSELSTART, 0, 0L);\r
-       }\r
-\r
-       void SetSelStart(int nMin)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETSELSTART, 0, (LPARAM)nMin);\r
-       }\r
-\r
-       int GetSelEnd() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETSELEND, 0, 0L);\r
-       }\r
-\r
-       void SetSelEnd(int nMax)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETSELEND, 0, (LPARAM)nMax);\r
-       }\r
-\r
-       void GetSelection(int& nMin, int& nMax) const\r
-       {\r
-               nMin = GetSelStart();\r
-               nMax = GetSelEnd();\r
-       }\r
-\r
-       void SetSelection(int nMin, int nMax)\r
-       {\r
-               SetSelStart(nMin);\r
-               SetSelEnd(nMax);\r
-       }\r
-\r
-       void GetChannelRect(LPRECT lprc) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_GETCHANNELRECT, 0, (LPARAM)lprc);\r
-       }\r
-\r
-       void GetThumbRect(LPRECT lprc) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_GETTHUMBRECT, 0, (LPARAM)lprc);\r
-       }\r
-\r
-       int GetPos() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETPOS, 0, 0L);\r
-       }\r
-\r
-       void SetPos(int nPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETPOS, TRUE, nPos);\r
-       }\r
-\r
-       UINT GetNumTics() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, TBM_GETNUMTICS, 0, 0L);\r
-       }\r
-\r
-       DWORD* GetTicArray() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD*)::SendMessage(m_hWnd, TBM_GETPTICS, 0, 0L);\r
-       }\r
-\r
-       int GetTic(int nTic) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETTIC, nTic, 0L);\r
-       }\r
-\r
-       BOOL SetTic(int nTic)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TBM_SETTIC, 0, nTic);\r
-       }\r
-\r
-       int GetTicPos(int nTic) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETTICPOS, nTic, 0L);\r
-       }\r
-\r
-       void SetTicFreq(int nFreq)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETTICFREQ, nFreq, 0L);\r
-       }\r
-\r
-       int GetThumbLength() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_GETTHUMBLENGTH, 0, 0L);\r
-       }\r
-\r
-       void SetThumbLength(int nLength)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETTHUMBLENGTH, nLength, 0L);\r
-       }\r
-\r
-       void SetSel(int nStart, int nEnd, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & TBS_ENABLESELRANGE) != 0);\r
-               ::SendMessage(m_hWnd, TBM_SETSEL, bRedraw, MAKELPARAM(nStart, nEnd));\r
-       }\r
-\r
-       ATL::CWindow GetBuddy(BOOL bLeft = TRUE) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ATL::CWindow((HWND)::SendMessage(m_hWnd, TBM_GETBUDDY, bLeft, 0L));\r
-       }\r
-\r
-       ATL::CWindow SetBuddy(HWND hWndBuddy, BOOL bLeft = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ATL::CWindow((HWND)::SendMessage(m_hWnd, TBM_SETBUDDY, bLeft, (LPARAM)hWndBuddy));\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl GetToolTips() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, TBM_GETTOOLTIPS, 0, 0L));\r
-       }\r
-\r
-       void SetToolTips(HWND hWndTT)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETTOOLTIPS, (WPARAM)hWndTT, 0L);\r
-       }\r
-\r
-       int SetTipSide(int nSide)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, TBM_SETTIPSIDE, nSide, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TBM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, TBM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-// Operations\r
-       void ClearSel(BOOL bRedraw = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_CLEARSEL, bRedraw, 0L);\r
-       }\r
-\r
-       void VerifyPos()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_SETPOS, FALSE, 0L);\r
-       }\r
-\r
-       void ClearTics(BOOL bRedraw = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, TBM_CLEARTICS, bRedraw, 0L);\r
-       }\r
-};\r
-\r
-typedef CTrackBarCtrlT<ATL::CWindow>   CTrackBarCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CUpDownCtrl\r
-\r
-template <class TBase>\r
-class CUpDownCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CUpDownCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CUpDownCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return UPDOWN_CLASS;\r
-       }\r
-\r
-       UINT GetAccel(int nAccel, UDACCEL* pAccel) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)LOWORD(::SendMessage(m_hWnd, UDM_GETACCEL, nAccel, (LPARAM)pAccel));\r
-       }\r
-\r
-       BOOL SetAccel(int nAccel, UDACCEL* pAccel)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)LOWORD(::SendMessage(m_hWnd, UDM_SETACCEL, nAccel, (LPARAM)pAccel));\r
-       }\r
-\r
-       UINT GetBase() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)LOWORD(::SendMessage(m_hWnd, UDM_GETBASE, 0, 0L));\r
-       }\r
-\r
-       int SetBase(int nBase)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, UDM_SETBASE, nBase, 0L);\r
-       }\r
-\r
-       ATL::CWindow GetBuddy() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ATL::CWindow((HWND)::SendMessage(m_hWnd, UDM_GETBUDDY, 0, 0L));\r
-       }\r
-\r
-       ATL::CWindow SetBuddy(HWND hWndBuddy)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ATL::CWindow((HWND)::SendMessage(m_hWnd, UDM_SETBUDDY, (WPARAM)hWndBuddy, 0L));\r
-       }\r
-\r
-       int GetPos(LPBOOL lpbError = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, UDM_GETPOS, 0, 0L);\r
-               // Note: Seems that Windows always sets error to TRUE if\r
-               // UDS_SETBUDDYINT style is not used\r
-               if(lpbError != NULL)\r
-                       *lpbError = (HIWORD(dwRet) != 0) ? TRUE : FALSE;\r
-               return (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-       int SetPos(int nPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)(short)LOWORD(::SendMessage(m_hWnd, UDM_SETPOS, 0, MAKELPARAM(nPos, 0)));\r
-       }\r
-\r
-       DWORD GetRange() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, UDM_GETRANGE, 0, 0L);\r
-       }\r
-\r
-       void GetRange(int& nLower, int& nUpper) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, UDM_GETRANGE, 0, 0L);\r
-               nLower = (int)(short)HIWORD(dwRet);\r
-               nUpper = (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-       void SetRange(int nLower, int nUpper)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, UDM_SETRANGE, 0, MAKELPARAM(nUpper, nLower));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       void SetRange32(int nLower, int nUpper)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, UDM_SETRANGE32, nLower, nUpper);\r
-       }\r
-\r
-       void GetRange32(int& nLower, int& nUpper) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, UDM_GETRANGE32, (WPARAM)&nLower, (LPARAM)&nUpper);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, UDM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, UDM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       int GetPos32(LPBOOL lpbError = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               // Note: Seems that Windows always sets error to TRUE if\r
-               // UDS_SETBUDDYINT style is not used\r
-               return (int)::SendMessage(m_hWnd, UDM_GETPOS32, 0, (LPARAM)lpbError);\r
-       }\r
-\r
-       int SetPos32(int nPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, UDM_SETPOS32, 0, (LPARAM)nPos);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-};\r
-\r
-typedef CUpDownCtrlT<ATL::CWindow>   CUpDownCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CProgressBarCtrl\r
-\r
-template <class TBase>\r
-class CProgressBarCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CProgressBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CProgressBarCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return PROGRESS_CLASS;\r
-       }\r
-\r
-       DWORD SetRange(int nLower, int nUpper)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper));\r
-       }\r
-\r
-       int SetPos(int nPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_SETPOS, nPos, 0L));\r
-       }\r
-\r
-       int OffsetPos(int nPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_DELTAPOS, nPos, 0L));\r
-       }\r
-\r
-       int SetStep(int nStep)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_SETSTEP, nStep, 0L));\r
-       }\r
-\r
-       UINT GetPos() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, PBM_GETPOS, 0, 0L);\r
-       }\r
-\r
-       void GetRange(PPBRANGE pPBRange) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pPBRange != NULL);\r
-               ::SendMessage(m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)pPBRange);\r
-       }\r
-\r
-       void GetRange(int& nLower, int& nUpper) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               PBRANGE range = { 0 };\r
-               ::SendMessage(m_hWnd, PBM_GETRANGE, TRUE, (LPARAM)&range);\r
-               nLower = range.iLow;\r
-               nUpper = range.iHigh;\r
-       }\r
-\r
-       int GetRangeLimit(BOOL bLowLimit) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PBM_GETRANGE, bLowLimit, (LPARAM)NULL);\r
-       }\r
-\r
-       DWORD SetRange32(int nMin, int nMax)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, PBM_SETRANGE32, nMin, nMax);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       COLORREF SetBarColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, PBM_SETBARCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       COLORREF SetBkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, PBM_SETBKCOLOR, 0, (LPARAM)clr);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if (_WIN32_WINNT >= 0x0501) && defined(PBM_SETMARQUEE)\r
-       BOOL SetMarquee(BOOL bMarquee, UINT uUpdateTime = 0U)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PBM_SETMARQUEE, (WPARAM)bMarquee, (LPARAM)uUpdateTime);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501) && defined(PBM_SETMARQUEE)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       int GetStep() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PBM_GETSTEP, 0, 0L);\r
-       }\r
-\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, PBM_GETBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF GetBarColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, PBM_GETBARCOLOR, 0, 0L);\r
-       }\r
-\r
-       int GetState() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PBM_GETSTATE, 0, 0L);\r
-       }\r
-\r
-       int SetState(int nState)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PBM_SETSTATE, nState, 0L);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-// Operations\r
-       int StepIt()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)(short)LOWORD(::SendMessage(m_hWnd, PBM_STEPIT, 0, 0L));\r
-       }\r
-};\r
-\r
-typedef CProgressBarCtrlT<ATL::CWindow>   CProgressBarCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CHotKeyCtrl\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class TBase>\r
-class CHotKeyCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CHotKeyCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CHotKeyCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return HOTKEY_CLASS;\r
-       }\r
-\r
-       DWORD GetHotKey() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L);\r
-       }\r
-\r
-       void GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dw = (DWORD)::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L);\r
-               wVirtualKeyCode = LOBYTE(LOWORD(dw));\r
-               wModifiers = HIBYTE(LOWORD(dw));\r
-       }\r
-\r
-       void SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, HKM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0L);\r
-       }\r
-\r
-       void SetRules(WORD wInvalidComb, WORD wModifiers)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0));\r
-       }\r
-};\r
-\r
-typedef CHotKeyCtrlT<ATL::CWindow>   CHotKeyCtrl;\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAnimateCtrl\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class TBase>\r
-class CAnimateCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CAnimateCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CAnimateCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return ANIMATE_CLASS;\r
-       }\r
-\r
-// Operations\r
-       BOOL Open(ATL::_U_STRINGorID FileName)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, (LPARAM)FileName.m_lpstr);\r
-       }\r
-\r
-       BOOL Play(UINT nFrom, UINT nTo, UINT nRep)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, nRep, MAKELPARAM(nFrom, nTo));\r
-       }\r
-\r
-       BOOL Stop()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, ACM_STOP, 0, 0L);\r
-       }\r
-\r
-       BOOL Close()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, 0L);\r
-       }\r
-\r
-       BOOL Seek(UINT nTo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, 0, MAKELPARAM(nTo, nTo));\r
-       }\r
-\r
-       // Vista only\r
-       BOOL IsPlaying() const\r
-       {\r
-#ifndef ACM_ISPLAYING\r
-               const UINT ACM_ISPLAYING = (WM_USER+104);\r
-#endif\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, ACM_ISPLAYING, 0, 0L);\r
-       }\r
-};\r
-\r
-typedef CAnimateCtrlT<ATL::CWindow>   CAnimateCtrl;\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRichEditCtrl\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-#ifdef _UNICODE\r
-#if (_RICHEDIT_VER == 0x0100)\r
-#undef RICHEDIT_CLASS\r
-#define RICHEDIT_CLASS L"RICHEDIT"\r
-#endif // (_RICHEDIT_VER == 0x0100)\r
-#endif // _UNICODE\r
-\r
-template <class TBase>\r
-class CRichEditCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CRichEditCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CRichEditCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return RICHEDIT_CLASS;\r
-       }\r
-\r
-       static LPCTSTR GetLibraryName()\r
-       {\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-               return _T("RICHED20.DLL");\r
-#else\r
-               return _T("RICHED32.DLL");\r
-#endif\r
-       }\r
-\r
-       int GetLineCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetModify() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0L);\r
-       }\r
-\r
-       void SetModify(BOOL bModified = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0L);\r
-       }\r
-\r
-       void GetRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       DWORD GetOptions() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETOPTIONS, 0, 0L);\r
-       }\r
-\r
-       DWORD SetOptions(WORD wOperation, DWORD dwOptions)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_SETOPTIONS, wOperation, dwOptions);\r
-       }\r
-\r
-       // NOTE: first word in lpszBuffer must contain the size of the buffer!\r
-       int GetLine(int nIndex, LPTSTR lpszBuffer) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\r
-       }\r
-\r
-       int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               *(LPWORD)lpszBuffer = (WORD)nMaxLength;\r
-               return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);\r
-       }\r
-\r
-       BOOL CanUndo() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0L);\r
-       }\r
-\r
-       BOOL CanPaste(UINT nFormat = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANPASTE, nFormat, 0L);\r
-       }\r
-\r
-       void GetSel(LONG& nStartChar, LONG& nEndChar) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               CHARRANGE cr = { 0, 0 };\r
-               ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\r
-               nStartChar = cr.cpMin;\r
-               nEndChar = cr.cpMax;\r
-       }\r
-\r
-       void GetSel(CHARRANGE &cr) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\r
-       }\r
-\r
-       int SetSel(LONG nStartChar, LONG nEndChar)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               CHARRANGE cr = { nStartChar, nEndChar };\r
-               return (int)::SendMessage(m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);\r
-       }\r
-\r
-       int SetSel(CHARRANGE &cr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);\r
-       }\r
-\r
-       int SetSelAll()\r
-       {\r
-               return SetSel(0, -1);\r
-       }\r
-\r
-       int SetSelNone()\r
-       {\r
-               return SetSel(-1, 0);\r
-       }\r
-\r
-       DWORD GetDefaultCharFormat(CHARFORMAT& cf) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT);\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);\r
-       }\r
-\r
-       DWORD GetSelectionCharFormat(CHARFORMAT& cf) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT);\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);\r
-       }\r
-\r
-       DWORD GetEventMask() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETEVENTMASK, 0, 0L);\r
-       }\r
-\r
-       LONG GetLimitText() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_GETLIMITTEXT, 0, 0L);\r
-       }\r
-\r
-       DWORD GetParaFormat(PARAFORMAT& pf) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               pf.cbSize = sizeof(PARAFORMAT);\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);\r
-       }\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-       LONG GetSelText(LPTSTR lpstrBuff) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrBuff);\r
-       }\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-       // RichEdit 1.0 EM_GETSELTEXT is ANSI only\r
-       LONG GetSelText(LPSTR lpstrBuff) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrBuff);\r
-       }\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetSelTextBSTR(BSTR& bstrText) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrText == NULL);\r
-\r
-               CHARRANGE cr = { 0, 0 };\r
-               ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);\r
-               if(lpstrText == NULL)\r
-                       return FALSE;\r
-               if(::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText) == 0)\r
-                       return FALSE;\r
-\r
-               bstrText = ::SysAllocString(T2W(lpstrText));\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-               CTempBuffer<char, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);\r
-               if(lpstrText == NULL)\r
-                       return FALSE;\r
-               if(::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText) == 0)\r
-                       return FALSE;\r
-\r
-               bstrText = ::SysAllocString(A2W(lpstrText));\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       LONG GetSelText(_CSTRING_NS::CString& strText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               CHARRANGE cr = { 0, 0 };\r
-               ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr);\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-               LONG lLen = 0;\r
-               LPTSTR lpstrText = strText.GetBufferSetLength(cr.cpMax - cr.cpMin);\r
-               if(lpstrText != NULL)\r
-               {\r
-                       lLen = (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText);\r
-                       strText.ReleaseBuffer();\r
-               }\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-               CTempBuffer<char, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPSTR lpstrText = buff.Allocate(cr.cpMax - cr.cpMin + 1);\r
-               if(lpstrText == NULL)\r
-                       return 0;\r
-               LONG lLen = (LONG)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpstrText);\r
-               if(lLen == 0)\r
-                       return 0;\r
-\r
-               USES_CONVERSION;\r
-               strText = A2T(lpstrText);\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-\r
-               return lLen;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       WORD GetSelectionType() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (WORD)::SendMessage(m_hWnd, EM_SELECTIONTYPE, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetBackgroundColor(COLORREF cr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, EM_SETBKGNDCOLOR, 0, cr);\r
-       }\r
-\r
-       COLORREF SetBackgroundColor()   // sets to system background\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, EM_SETBKGNDCOLOR, 1, 0);\r
-       }\r
-\r
-       BOOL SetCharFormat(CHARFORMAT& cf, WORD wFlags)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetDefaultCharFormat(CHARFORMAT& cf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetSelectionCharFormat(CHARFORMAT& cf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetWordCharFormat(CHARFORMAT& cf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);\r
-       }\r
-\r
-       DWORD SetEventMask(DWORD dwEventMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_SETEVENTMASK, 0, dwEventMask);\r
-       }\r
-\r
-       BOOL SetParaFormat(PARAFORMAT& pf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               pf.cbSize = sizeof(PARAFORMAT);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);\r
-       }\r
-\r
-       BOOL SetTargetDevice(HDC hDC, int cxLineWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTARGETDEVICE, (WPARAM)hDC, cxLineWidth);\r
-       }\r
-\r
-       int GetTextLength() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, WM_GETTEXTLENGTH, 0, 0L);\r
-       }\r
-\r
-       BOOL SetReadOnly(BOOL bReadOnly = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L);\r
-       }\r
-\r
-       int GetFirstVisibleLine() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L);\r
-       }\r
-\r
-       EDITWORDBREAKPROCEX GetWordBreakProcEx() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (EDITWORDBREAKPROCEX)::SendMessage(m_hWnd, EM_GETWORDBREAKPROCEX, 0, 0L);\r
-       }\r
-\r
-       EDITWORDBREAKPROCEX SetWordBreakProcEx(EDITWORDBREAKPROCEX pfnEditWordBreakProcEx)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (EDITWORDBREAKPROCEX)::SendMessage(m_hWnd, EM_SETWORDBREAKPROCEX, 0, (LPARAM)pfnEditWordBreakProcEx);\r
-       }\r
-\r
-       int GetTextRange(TEXTRANGE* pTextRange) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)pTextRange);\r
-       }\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-       int GetTextRange(LONG nStartChar, LONG nEndChar, LPTSTR lpstrText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TEXTRANGE tr = { 0 };\r
-               tr.chrg.cpMin = nStartChar;\r
-               tr.chrg.cpMax = nEndChar;\r
-               tr.lpstrText = lpstrText;\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);\r
-       }\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-\r
-       int GetTextRange(LONG nStartChar, LONG nEndChar, LPSTR lpstrText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               TEXTRANGE tr = { 0 };\r
-               tr.chrg.cpMin = nStartChar;\r
-               tr.chrg.cpMax = nEndChar;\r
-               tr.lpstrText = lpstrText;\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);\r
-       }\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-       DWORD GetDefaultCharFormat(CHARFORMAT2& cf) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT2);\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 0, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetCharFormat(CHARFORMAT2& cf, WORD wFlags)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT2);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, (WPARAM)wFlags, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetDefaultCharFormat(CHARFORMAT2& cf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT2);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, 0, (LPARAM)&cf);\r
-       }\r
-\r
-       DWORD GetSelectionCharFormat(CHARFORMAT2& cf) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT2);\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETCHARFORMAT, 1, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetSelectionCharFormat(CHARFORMAT2& cf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT2);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);\r
-       }\r
-\r
-       BOOL SetWordCharFormat(CHARFORMAT2& cf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               cf.cbSize = sizeof(CHARFORMAT2);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);\r
-       }\r
-\r
-       DWORD GetParaFormat(PARAFORMAT2& pf) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               pf.cbSize = sizeof(PARAFORMAT2);\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);\r
-       }\r
-\r
-       BOOL SetParaFormat(PARAFORMAT2& pf)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               pf.cbSize = sizeof(PARAFORMAT2);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);\r
-       }\r
-\r
-       TEXTMODE GetTextMode() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (TEXTMODE)::SendMessage(m_hWnd, EM_GETTEXTMODE, 0, 0L);\r
-       }\r
-\r
-       BOOL SetTextMode(TEXTMODE enumTextMode)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return !(BOOL)::SendMessage(m_hWnd, EM_SETTEXTMODE, enumTextMode, 0L);\r
-       }\r
-\r
-       UNDONAMEID GetUndoName() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UNDONAMEID)::SendMessage(m_hWnd, EM_GETUNDONAME, 0, 0L);\r
-       }\r
-\r
-       UNDONAMEID GetRedoName() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UNDONAMEID)::SendMessage(m_hWnd, EM_GETREDONAME, 0, 0L);\r
-       }\r
-\r
-       BOOL CanRedo() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANREDO, 0, 0L);\r
-       }\r
-\r
-       BOOL GetAutoURLDetect() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_GETAUTOURLDETECT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetAutoURLDetect(BOOL bAutoDetect = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return !(BOOL)::SendMessage(m_hWnd, EM_AUTOURLDETECT, bAutoDetect, 0L);\r
-       }\r
-\r
-       // this method is deprecated, please use SetAutoURLDetect\r
-       BOOL EnableAutoURLDetect(BOOL bEnable = TRUE) { return SetAutoURLDetect(bEnable); }\r
-\r
-       UINT SetUndoLimit(UINT uUndoLimit)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_SETUNDOLIMIT, uUndoLimit, 0L);\r
-       }\r
-\r
-       void SetPalette(HPALETTE hPalette)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETPALETTE, (WPARAM)hPalette, 0L);\r
-       }\r
-\r
-       int GetTextEx(GETTEXTEX* pGetTextEx, LPTSTR lpstrText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTEX, (WPARAM)pGetTextEx, (LPARAM)lpstrText);\r
-       }\r
-\r
-       int GetTextEx(LPTSTR lpstrText, int nTextLen, DWORD dwFlags = GT_DEFAULT, UINT uCodePage = CP_ACP, LPCSTR lpDefaultChar = NULL, LPBOOL lpUsedDefChar = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               GETTEXTEX gte = { 0 };\r
-               gte.cb = nTextLen * sizeof(TCHAR);\r
-               gte.codepage = uCodePage;\r
-               gte.flags = dwFlags;\r
-               gte.lpDefaultChar = lpDefaultChar;\r
-               gte.lpUsedDefChar = lpUsedDefChar;\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTEX, (WPARAM)&gte, (LPARAM)lpstrText);\r
-       }\r
-\r
-       int GetTextLengthEx(GETTEXTLENGTHEX* pGetTextLengthEx) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)pGetTextLengthEx, 0L);\r
-       }\r
-\r
-       int GetTextLengthEx(DWORD dwFlags = GTL_DEFAULT, UINT uCodePage = CP_ACP) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               GETTEXTLENGTHEX gtle = { 0 };\r
-               gtle.codepage = uCodePage;\r
-               gtle.flags = dwFlags;\r
-               return (int)::SendMessage(m_hWnd, EM_GETTEXTLENGTHEX, (WPARAM)&gtle, 0L);\r
-       }\r
-#endif // (_RICHEDIT_VER >= 0x0200)\r
-\r
-#if (_RICHEDIT_VER >= 0x0300)\r
-       int SetTextEx(SETTEXTEX* pSetTextEx, LPCTSTR lpstrText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_SETTEXTEX, (WPARAM)pSetTextEx, (LPARAM)lpstrText);\r
-       }\r
-\r
-       int SetTextEx(LPCTSTR lpstrText, DWORD dwFlags = ST_DEFAULT, UINT uCodePage = CP_ACP)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               SETTEXTEX ste = { 0 };\r
-               ste.flags = dwFlags;\r
-               ste.codepage = uCodePage;\r
-               return (int)::SendMessage(m_hWnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpstrText);\r
-       }\r
-\r
-       int GetEditStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_GETEDITSTYLE, 0, 0L);\r
-       }\r
-\r
-       int SetEditStyle(int nStyle, int nMask = -1)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               if(nMask == -1)\r
-                       nMask = nStyle;   // set everything specified\r
-               return (int)::SendMessage(m_hWnd, EM_SETEDITSTYLE, nStyle, nMask);\r
-       }\r
-\r
-       BOOL SetFontSize(int nFontSizeDelta)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nFontSizeDelta >= -1637 && nFontSizeDelta <= 1638);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETFONTSIZE, nFontSizeDelta, 0L);\r
-       }\r
-\r
-       void GetScrollPos(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpPoint != NULL);\r
-               ::SendMessage(m_hWnd, EM_GETSCROLLPOS, 0, (LPARAM)lpPoint);\r
-       }\r
-\r
-       void SetScrollPos(LPPOINT lpPoint)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpPoint != NULL);\r
-               ::SendMessage(m_hWnd, EM_SETSCROLLPOS, 0, (LPARAM)lpPoint);\r
-       }\r
-\r
-       BOOL GetZoom(int& nNum, int& nDen) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_GETZOOM, (WPARAM)&nNum, (LPARAM)&nDen);\r
-       }\r
-\r
-       BOOL SetZoom(int nNum, int nDen)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nNum >= 0 && nNum <= 64);\r
-               ATLASSERT(nDen >= 0 && nDen <= 64);\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETZOOM, nNum, nDen);\r
-       }\r
-\r
-       BOOL SetZoomOff()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETZOOM, 0, 0L);\r
-       }\r
-#endif // (_RICHEDIT_VER >= 0x0300)\r
-\r
-// Operations\r
-       void LimitText(LONG nChars = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_EXLIMITTEXT, 0, nChars);\r
-       }\r
-\r
-       int LineFromChar(LONG nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_EXLINEFROMCHAR, 0, nIndex);\r
-       }\r
-\r
-       POINT PosFromChar(LONG nChar) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               POINT point = { 0, 0 };\r
-               ::SendMessage(m_hWnd, EM_POSFROMCHAR, (WPARAM)&point, nChar);\r
-               return point;\r
-       }\r
-\r
-       int CharFromPos(POINT pt) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               POINTL ptl = { pt.x, pt.y };\r
-               return (int)::SendMessage(m_hWnd, EM_CHARFROMPOS, 0, (LPARAM)&ptl);\r
-       }\r
-\r
-       void EmptyUndoBuffer()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0L);\r
-       }\r
-\r
-       int LineIndex(int nLine = -1) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0L);\r
-       }\r
-\r
-       int LineLength(int nLine = -1) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0L);\r
-       }\r
-\r
-       BOOL LineScroll(int nLines, int nChars = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines);\r
-       }\r
-\r
-       void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText);\r
-       }\r
-\r
-       void SetRect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       BOOL DisplayBand(LPRECT pDisplayRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_DISPLAYBAND, 0, (LPARAM)pDisplayRect);\r
-       }\r
-\r
-       LONG FindText(DWORD dwFlags, FINDTEXT& ft) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#if (_RICHEDIT_VER >= 0x0200) && defined(_UNICODE)\r
-               return (LONG)::SendMessage(m_hWnd, EM_FINDTEXTW, dwFlags, (LPARAM)&ft);\r
-#else\r
-               return (LONG)::SendMessage(m_hWnd, EM_FINDTEXT, dwFlags, (LPARAM)&ft);\r
-#endif\r
-       }\r
-\r
-       LONG FindText(DWORD dwFlags, FINDTEXTEX& ft) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#if (_RICHEDIT_VER >= 0x0200) && defined(_UNICODE)\r
-               return (LONG)::SendMessage(m_hWnd, EM_FINDTEXTEXW, dwFlags, (LPARAM)&ft);\r
-#else\r
-               return (LONG)::SendMessage(m_hWnd, EM_FINDTEXTEX, dwFlags, (LPARAM)&ft);\r
-#endif\r
-       }\r
-\r
-       LONG FormatRange(FORMATRANGE& fr, BOOL bDisplay = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)&fr);\r
-       }\r
-\r
-       LONG FormatRange(FORMATRANGE* pFormatRange, BOOL bDisplay = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_FORMATRANGE, bDisplay, (LPARAM)pFormatRange);\r
-       }\r
-\r
-       void HideSelection(BOOL bHide = TRUE, BOOL bChangeStyle = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_HIDESELECTION, bHide, bChangeStyle);\r
-       }\r
-\r
-       void PasteSpecial(UINT uClipFormat, DWORD dwAspect = 0, HMETAFILE hMF = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               REPASTESPECIAL reps = { dwAspect, (DWORD_PTR)hMF };\r
-               ::SendMessage(m_hWnd, EM_PASTESPECIAL, uClipFormat, (LPARAM)&reps);\r
-       }\r
-\r
-       void RequestResize()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_REQUESTRESIZE, 0, 0L);\r
-       }\r
-\r
-       LONG StreamIn(UINT uFormat, EDITSTREAM& es)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_STREAMIN, uFormat, (LPARAM)&es);\r
-       }\r
-\r
-       LONG StreamOut(UINT uFormat, EDITSTREAM& es)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_STREAMOUT, uFormat, (LPARAM)&es);\r
-       }\r
-\r
-       DWORD FindWordBreak(int nCode, LONG nStartChar)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_FINDWORDBREAK, nCode, nStartChar);\r
-       }\r
-\r
-       // Additional operations\r
-       void ScrollCaret()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0L);\r
-       }\r
-\r
-       int InsertText(long nInsertAfterChar, LPCTSTR lpstrText, BOOL bCanUndo = FALSE)\r
-       {\r
-               int nRet = SetSel(nInsertAfterChar, nInsertAfterChar);\r
-               ReplaceSel(lpstrText, bCanUndo);\r
-               return nRet;\r
-       }\r
-\r
-       int AppendText(LPCTSTR lpstrText, BOOL bCanUndo = FALSE)\r
-       {\r
-               return InsertText(GetWindowTextLength(), lpstrText, bCanUndo);\r
-       }\r
-\r
-       // Clipboard operations\r
-       BOOL Undo()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0L);\r
-       }\r
-\r
-       void Clear()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);\r
-       }\r
-\r
-       void Copy()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_COPY, 0, 0L);\r
-       }\r
-\r
-       void Cut()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CUT, 0, 0L);\r
-       }\r
-\r
-       void Paste()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);\r
-       }\r
-\r
-       // OLE support\r
-       IRichEditOle* GetOleInterface() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               IRichEditOle *pRichEditOle = NULL;\r
-               ::SendMessage(m_hWnd, EM_GETOLEINTERFACE, 0, (LPARAM)&pRichEditOle);\r
-               return pRichEditOle;\r
-       }\r
-\r
-       BOOL SetOleCallback(IRichEditOleCallback* pCallback)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETOLECALLBACK, 0, (LPARAM)pCallback);\r
-       }\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-       BOOL Redo()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_REDO, 0, 0L);\r
-       }\r
-\r
-       void StopGroupTyping()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_STOPGROUPTYPING, 0, 0L);\r
-       }\r
-\r
-       void ShowScrollBar(int nBarType, BOOL bVisible = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SHOWSCROLLBAR, nBarType, bVisible);\r
-       }\r
-#endif // (_RICHEDIT_VER >= 0x0200)\r
-\r
-#if (_RICHEDIT_VER >= 0x0300)\r
-       BOOL SetTabStops(int nTabStops, LPINT rgTabStops)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops);\r
-       }\r
-\r
-       BOOL SetTabStops()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0L);\r
-       }\r
-\r
-       BOOL SetTabStops(const int& cxEachStop)    // takes an 'int'\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop);\r
-       }\r
-#endif // (_RICHEDIT_VER >= 0x0300)\r
-};\r
-\r
-typedef CRichEditCtrlT<ATL::CWindow>   CRichEditCtrl;\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRichEditCommands - message handlers for standard EDIT commands\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-// Chain to CRichEditCommands message map. Your class must also derive from CRichEditCtrl.\r
-// Example:\r
-// class CMyRichEdit : public CWindowImpl<CMyRichEdit, CRichEditCtrl>,\r
-//                     public CRichEditCommands<CMyRichEdit>\r
-// {\r
-// public:\r
-//      BEGIN_MSG_MAP(CMyRichEdit)\r
-//              // your handlers...\r
-//              CHAIN_MSG_MAP_ALT(CRichEditCommands<CMyRichEdit>, 1)\r
-//      END_MSG_MAP()\r
-//      // other stuff...\r
-// };\r
-\r
-template <class T>\r
-class CRichEditCommands : public CEditCommands< T >\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CRichEditCommands< T >)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_EDIT_CLEAR, CEditCommands< T >::OnEditClear)\r
-               COMMAND_ID_HANDLER(ID_EDIT_CLEAR_ALL, CEditCommands< T >::OnEditClearAll)\r
-               COMMAND_ID_HANDLER(ID_EDIT_COPY, CEditCommands< T >::OnEditCopy)\r
-               COMMAND_ID_HANDLER(ID_EDIT_CUT, CEditCommands< T >::OnEditCut)\r
-               COMMAND_ID_HANDLER(ID_EDIT_PASTE, CEditCommands< T >::OnEditPaste)\r
-               COMMAND_ID_HANDLER(ID_EDIT_SELECT_ALL, CEditCommands< T >::OnEditSelectAll)\r
-               COMMAND_ID_HANDLER(ID_EDIT_UNDO, CEditCommands< T >::OnEditUndo)\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-               COMMAND_ID_HANDLER(ID_EDIT_REDO, OnEditRedo)\r
-#endif // (_RICHEDIT_VER >= 0x0200)\r
-       END_MSG_MAP()\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-       LRESULT OnEditRedo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Redo();\r
-               return 0;\r
-       }\r
-#endif // (_RICHEDIT_VER >= 0x0200)\r
-\r
-// State (update UI) helpers\r
-       BOOL CanCut() const\r
-       { return HasSelection(); }\r
-\r
-       BOOL CanCopy() const\r
-       { return HasSelection(); }\r
-\r
-       BOOL CanClear() const\r
-       { return HasSelection(); }\r
-\r
-// Implementation\r
-       BOOL HasSelection() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               return (pT->GetSelectionType() != SEL_EMPTY);\r
-       }\r
-};\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDragListBox\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class TBase>\r
-class CDragListBoxT : public CListBoxT< TBase >\r
-{\r
-public:\r
-// Constructors\r
-       CDragListBoxT(HWND hWnd = NULL) : CListBoxT< TBase >(hWnd)\r
-       { }\r
-\r
-       CDragListBoxT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               if(hWnd != NULL)\r
-                       MakeDragList();\r
-               return hWnd;\r
-       }\r
-\r
-// Operations\r
-       BOOL MakeDragList()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((GetStyle() & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == 0);\r
-               return ::MakeDragList(m_hWnd);\r
-       }\r
-\r
-       int LBItemFromPt(POINT pt, BOOL bAutoScroll = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::LBItemFromPt(m_hWnd, pt, bAutoScroll);\r
-       }\r
-\r
-       void DrawInsert(int nItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::DrawInsert(GetParent(), m_hWnd, nItem);\r
-       }\r
-\r
-       static UINT GetDragListMessage()\r
-       {\r
-               static UINT uDragListMessage = 0;\r
-               if(uDragListMessage == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CDragListBox::GetDragListMessage.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uDragListMessage == 0)\r
-                               uDragListMessage = ::RegisterWindowMessage(DRAGLISTMSGSTRING);\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uDragListMessage != 0);\r
-               return uDragListMessage;\r
-       }\r
-};\r
-\r
-typedef CDragListBoxT<ATL::CWindow>   CDragListBox;\r
-\r
-template <class T>\r
-class CDragListNotifyImpl\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CDragListNotifyImpl< T >)\r
-               MESSAGE_HANDLER(CDragListBox::GetDragListMessage(), OnDragListNotify)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnDragListNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               uMsg;   // avoid level 4 warning\r
-               ATLASSERT(uMsg == CDragListBox::GetDragListMessage());\r
-               T* pT = static_cast<T*>(this);\r
-               LPDRAGLISTINFO lpDragListInfo = (LPDRAGLISTINFO)lParam;\r
-               LRESULT lRet = 0;\r
-               switch(lpDragListInfo->uNotification)\r
-               {\r
-               case DL_BEGINDRAG:\r
-                       lRet = (LPARAM)pT->OnBeginDrag((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\r
-                       break;\r
-               case DL_CANCELDRAG:\r
-                       pT->OnCancelDrag((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\r
-                       break;\r
-               case DL_DRAGGING:\r
-                       lRet = (LPARAM)pT->OnDragging((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\r
-                       break;\r
-               case DL_DROPPED:\r
-                       pT->OnDropped((int)wParam, lpDragListInfo->hWnd, lpDragListInfo->ptCursor);\r
-                       break;\r
-               default:\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Unknown DragListBox notification\n"));\r
-                       bHandled = FALSE;   // don't handle it\r
-                       break;\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-// Overrideables\r
-       BOOL OnBeginDrag(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\r
-       {\r
-               return TRUE;   // allow dragging\r
-       }\r
-\r
-       void OnCancelDrag(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\r
-       {\r
-               // nothing to do\r
-       }\r
-\r
-       int OnDragging(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\r
-       {\r
-               return 0;   // don't change cursor\r
-       }\r
-\r
-       void OnDropped(int /*nCtlID*/, HWND /*hWndDragList*/, POINT /*ptCursor*/)\r
-       {\r
-               // nothing to do\r
-       }\r
-};\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CReBarCtrl\r
-\r
-template <class TBase>\r
-class CReBarCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CReBarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CReBarCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return REBARCLASSNAME;\r
-       }\r
-\r
-       UINT GetBandCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, RB_GETBANDCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetBandInfo(int nBand, LPREBARBANDINFO lprbbi) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_GETBANDINFO, nBand, (LPARAM)lprbbi);\r
-       }\r
-\r
-       BOOL SetBandInfo(int nBand, LPREBARBANDINFO lprbbi)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SETBANDINFO, nBand, (LPARAM)lprbbi);\r
-       }\r
-\r
-       BOOL GetBarInfo(LPREBARINFO lprbi) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)lprbi);\r
-       }\r
-\r
-       BOOL SetBarInfo(LPREBARINFO lprbi)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)lprbi);\r
-       }\r
-\r
-       CImageList GetImageList() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               REBARINFO rbi = { 0 };\r
-               rbi.cbSize = sizeof(REBARINFO);\r
-               rbi.fMask = RBIM_IMAGELIST;\r
-               if( (BOOL)::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)&rbi) == FALSE ) return CImageList();\r
-               return CImageList(rbi.himl);\r
-       }\r
-\r
-       BOOL SetImageList(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               REBARINFO rbi = { 0 };\r
-               rbi.cbSize = sizeof(REBARINFO);\r
-               rbi.fMask = RBIM_IMAGELIST;\r
-               rbi.himl = hImageList;\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)&rbi);\r
-       }\r
-\r
-       UINT GetRowCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, RB_GETROWCOUNT, 0, 0L);\r
-       }\r
-\r
-       UINT GetRowHeight(int nBand) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, RB_GETROWHEIGHT, nBand, 0L);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       COLORREF GetTextColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, RB_GETTEXTCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetTextColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, RB_GETBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetBkColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr);\r
-       }\r
-\r
-       UINT GetBarHeight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, RB_GETBARHEIGHT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetRect(int nBand, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_GETRECT, nBand, (LPARAM)lpRect);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl GetToolTips() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CToolTipCtrl((HWND)::SendMessage(m_hWnd, RB_GETTOOLTIPS, 0, 0L));\r
-       }\r
-\r
-       void SetToolTips(HWND hwndToolTip)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_SETTOOLTIPS, (WPARAM)hwndToolTip, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void GetBandBorders(int nBand, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpRect != NULL);\r
-               ::SendMessage(m_hWnd, RB_GETBANDBORDERS, nBand, (LPARAM)lpRect);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetColorScheme(LPCOLORSCHEME lpColorScheme) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpColorScheme != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, RB_GETCOLORSCHEME, 0, (LPARAM)lpColorScheme);\r
-       }\r
-\r
-       void SetColorScheme(LPCOLORSCHEME lpColorScheme)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpColorScheme != NULL);\r
-               ::SendMessage(m_hWnd, RB_SETCOLORSCHEME, 0, (LPARAM)lpColorScheme);\r
-       }\r
-\r
-       HPALETTE GetPalette() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HPALETTE)::SendMessage(m_hWnd, RB_GETPALETTE, 0, 0L);\r
-       }\r
-\r
-       HPALETTE SetPalette(HPALETTE hPalette)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HPALETTE)::SendMessage(m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPalette);\r
-       }\r
-\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       // requires uxtheme.h to be included to use MARGINS struct\r
-#ifndef _UXTHEME_H_\r
-       typedef struct _MARGINS*   PMARGINS;\r
-#endif // !_UXTHEME_H_\r
-       void GetBandMargins(PMARGINS pMargins) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_GETBANDMARGINS, 0, (LPARAM)pMargins);\r
-       }\r
-\r
-       void SetWindowTheme(LPCWSTR lpstrTheme)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-#if (_WIN32_IE >= 0x0600)\r
-       DWORD GetExtendedStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, RB_GETEXTENDEDSTYLE, 0, 0L);\r
-       }\r
-\r
-       DWORD SetExtendedStyle(DWORD dwStyle, DWORD dwMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, RB_SETEXTENDEDSTYLE, dwMask, dwStyle);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0600)\r
-\r
-// Operations\r
-       BOOL InsertBand(int nBand, LPREBARBANDINFO lprbbi)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_INSERTBAND, nBand, (LPARAM)lprbbi);\r
-       }\r
-\r
-       BOOL AddBand(LPREBARBANDINFO lprbbi)\r
-       {\r
-               return InsertBand(-1, lprbbi);\r
-       }\r
-\r
-       BOOL DeleteBand(int nBand)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_DELETEBAND, nBand, 0L);\r
-       }\r
-\r
-       ATL::CWindow SetNotifyWnd(HWND hWnd)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ATL::CWindow((HWND)::SendMessage(m_hWnd, RB_SETPARENT, (WPARAM)hWnd, 0L));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       void BeginDrag(int nBand, DWORD dwPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_BEGINDRAG, nBand, dwPos);\r
-       }\r
-\r
-       void BeginDrag(int nBand, int xPos, int yPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_BEGINDRAG, nBand, MAKELPARAM(xPos, yPos));\r
-       }\r
-\r
-       void EndDrag()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_ENDDRAG, 0, 0L);\r
-       }\r
-\r
-       void DragMove(DWORD dwPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, dwPos);\r
-       }\r
-\r
-       void DragMove(int xPos, int yPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, MAKELPARAM(xPos, yPos));\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       void GetDropTarget(IDropTarget** ppDropTarget) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)ppDropTarget);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void MaximizeBand(int nBand, BOOL bIdeal = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_MAXIMIZEBAND, nBand, bIdeal);\r
-       }\r
-\r
-       void MinimizeBand(int nBand)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_MINIMIZEBAND, nBand, 0L);\r
-       }\r
-\r
-       BOOL SizeToRect(LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SIZETORECT, 0, (LPARAM)lpRect);\r
-       }\r
-\r
-       int IdToIndex(UINT uBandID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, RB_IDTOINDEX, uBandID, 0L);\r
-       }\r
-\r
-       int HitTest(LPRBHITTESTINFO lprbht) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, RB_HITTEST, 0, (LPARAM)lprbht);\r
-       }\r
-\r
-       BOOL ShowBand(int nBand, BOOL bShow)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SHOWBAND, nBand, bShow);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL MoveBand(int nBand, int nNewPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nNewPos >= 0 && nNewPos <= ((int)GetBandCount() - 1));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_MOVEBAND, nBand, nNewPos);\r
-       }\r
-#endif // !_WIN32_WCE\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       void PushChevron(int nBand, LPARAM lAppValue)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, RB_PUSHCHEVRON, nBand, lAppValue);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-// Extra operations\r
-#if (_WIN32_IE >= 0x0400)\r
-       void LockBands(bool bLock)\r
-       {\r
-               int nBandCount = GetBandCount();\r
-               for(int i =0; i < nBandCount; i++)\r
-               {\r
-                       REBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO() };\r
-                       rbbi.fMask = RBBIM_STYLE;\r
-                       BOOL bRet = GetBandInfo(i, &rbbi);\r
-                       ATLASSERT(bRet);\r
-\r
-                       if((rbbi.fStyle & RBBS_GRIPPERALWAYS) == 0)\r
-                       {\r
-                               rbbi.fStyle |= RBBS_GRIPPERALWAYS;\r
-                               bRet = SetBandInfo(i, &rbbi);\r
-                               ATLASSERT(bRet);\r
-                               rbbi.fStyle &= ~RBBS_GRIPPERALWAYS;\r
-                       }\r
-\r
-                       if(bLock)\r
-                               rbbi.fStyle |= RBBS_NOGRIPPER;\r
-                       else\r
-                               rbbi.fStyle &= ~RBBS_NOGRIPPER;\r
-\r
-                       bRet = SetBandInfo(i, &rbbi);\r
-                       ATLASSERT(bRet);\r
-               }\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       BOOL SetBandWidth(int nBand, int cxWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, RB_SETBANDWIDTH, nBand, cxWidth);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-};\r
-\r
-typedef CReBarCtrlT<ATL::CWindow>   CReBarCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CComboBoxEx\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class TBase>\r
-class CComboBoxExT : public CComboBoxT< TBase >\r
-{\r
-public:\r
-// Constructors\r
-       CComboBoxExT(HWND hWnd = NULL) : CComboBoxT< TBase >(hWnd)\r
-       { }\r
-\r
-       CComboBoxExT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_COMBOBOXEX;\r
-       }\r
-\r
-       CImageList GetImageList() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, CBEM_GETIMAGELIST, 0, 0L));\r
-       }\r
-\r
-       CImageList SetImageList(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CImageList((HIMAGELIST)::SendMessage(m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)hImageList));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       DWORD GetExtendedStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0L);\r
-       }\r
-\r
-       DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, CBEM_SETEXTENDEDSTYLE, dwExMask, dwExStyle);\r
-       }\r
-\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CBEM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CBEM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       void SetWindowTheme(LPCWSTR lpstrTheme)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, CBEM_SETWINDOWTHEME, 0, (LPARAM)lpstrTheme);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-// Operations\r
-       int InsertItem(const COMBOBOXEXITEM* lpcCBItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)lpcCBItem);\r
-       }\r
-\r
-       int InsertItem(UINT nMask, int nIndex, LPCTSTR lpszItem, int nImage, int nSelImage, \r
-                      int iIndent, int iOverlay, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               COMBOBOXEXITEM cbex = { 0 };\r
-               cbex.mask = nMask;\r
-               cbex.iItem = nIndex;\r
-               cbex.pszText = (LPTSTR) lpszItem;\r
-               cbex.iImage = nImage;\r
-               cbex.iSelectedImage = nSelImage;\r
-               cbex.iIndent = iIndent;\r
-               cbex.iOverlay = iOverlay;\r
-               cbex.lParam = lParam;\r
-               return (int)::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);\r
-       }\r
-\r
-       int InsertItem(int nIndex, LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, LPARAM lParam = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               COMBOBOXEXITEM cbex = { 0 };\r
-               cbex.mask = CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_INDENT | CBEIF_LPARAM;\r
-               cbex.iItem = nIndex;\r
-               cbex.pszText = (LPTSTR) lpszItem;\r
-               cbex.iImage = nImage;\r
-               cbex.iSelectedImage = nSelImage;\r
-               cbex.iIndent = iIndent;\r
-               cbex.lParam = lParam;\r
-               return (int)::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM)&cbex);\r
-       }\r
-\r
-       int AddItem(UINT nMask, LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, int iOverlay, LPARAM lParam)\r
-       {\r
-               return InsertItem(nMask, -1, lpszItem, nImage, nSelImage, iIndent, iOverlay, lParam);\r
-       }\r
-\r
-       int AddItem(LPCTSTR lpszItem, int nImage, int nSelImage, int iIndent, LPARAM lParam = 0)\r
-       {\r
-               return InsertItem(-1, lpszItem, nImage, nSelImage, iIndent, lParam);\r
-       }\r
-\r
-       int DeleteItem(int nIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, CBEM_DELETEITEM, nIndex, 0L);\r
-       }\r
-\r
-       BOOL GetItem(PCOMBOBOXEXITEM pCBItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)pCBItem);\r
-       }\r
-\r
-       BOOL SetItem(const COMBOBOXEXITEM* lpcCBItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CBEM_SETITEM, 0, (LPARAM)lpcCBItem);\r
-       }\r
-\r
-       int SetItem(int nIndex, UINT nMask, LPCTSTR lpszItem, int nImage, int nSelImage, \r
-                   int iIndent, int iOverlay, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               COMBOBOXEXITEM cbex = { 0 };\r
-               cbex.mask = nMask;\r
-               cbex.iItem = nIndex;\r
-               cbex.pszText = (LPTSTR) lpszItem;\r
-               cbex.iImage = nImage;\r
-               cbex.iSelectedImage = nSelImage;\r
-               cbex.iIndent = iIndent;\r
-               cbex.iOverlay = iOverlay;\r
-               cbex.lParam = lParam;\r
-               return (int)::SendMessage(m_hWnd, CBEM_SETITEM, 0, (LPARAM)&cbex);\r
-       }\r
-\r
-       BOOL GetItemText(int nIndex, LPTSTR lpszItem, int nLen) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpszItem != NULL);\r
-\r
-               COMBOBOXEXITEM cbex = { 0 };\r
-               cbex.mask = CBEIF_TEXT;\r
-               cbex.iItem = nIndex;\r
-               cbex.pszText = lpszItem;\r
-               cbex.cchTextMax = nLen;\r
-\r
-               return (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetItemText(int nIndex, BSTR& bstrText) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(bstrText == NULL);\r
-\r
-               COMBOBOXEXITEM cbex = { 0 };\r
-               cbex.mask = CBEIF_TEXT;\r
-               cbex.iItem = nIndex;\r
-\r
-               LPTSTR lpstrText = NULL;\r
-               BOOL bRet = FALSE;\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       ATLTRY(lpstrText = new TCHAR[nLen]);\r
-                       if(lpstrText == NULL)\r
-                               break;\r
-                       lpstrText[0] = NULL;\r
-                       cbex.pszText = lpstrText;\r
-                       cbex.cchTextMax = nLen;\r
-                       bRet = (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);\r
-                       if(!bRet || (lstrlen(cbex.pszText) < nLen - 1))\r
-                               break;\r
-                       delete [] lpstrText;\r
-                       lpstrText = NULL;\r
-               }\r
-\r
-               if(lpstrText != NULL)\r
-               {\r
-                       if(bRet)\r
-                               bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-                       delete [] lpstrText;\r
-               }\r
-\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       BOOL GetItemText(int nIndex, _CSTRING_NS::CString& strText) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               COMBOBOXEXITEM cbex = { 0 };\r
-               cbex.mask = CBEIF_TEXT;\r
-               cbex.iItem = nIndex;\r
-\r
-               strText.Empty();\r
-               BOOL bRet = FALSE;\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       cbex.pszText = strText.GetBufferSetLength(nLen);\r
-                       if(cbex.pszText == NULL)\r
-                       {\r
-                               bRet = FALSE;\r
-                               break;\r
-                       }\r
-                       cbex.cchTextMax = nLen;\r
-                       bRet = (BOOL)::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM)&cbex);\r
-                       if(!bRet || (lstrlen(cbex.pszText) < nLen - 1))\r
-                               break;\r
-               }\r
-               strText.ReleaseBuffer();\r
-               return bRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       BOOL SetItemText(int nIndex, LPCTSTR lpszItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return SetItem(nIndex, CBEIF_TEXT, lpszItem, 0, 0, 0, 0, 0);\r
-       }\r
-\r
-       CComboBox GetComboCtrl() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CComboBox((HWND)::SendMessage(m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0L));\r
-       }\r
-\r
-       CEdit GetEditCtrl() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CEdit((HWND)::SendMessage(m_hWnd, CBEM_GETEDITCONTROL, 0, 0L));\r
-       }\r
-\r
-       BOOL HasEditChanged() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, CBEM_HASEDITCHANGED, 0, 0L);\r
-       }\r
-\r
-// Non-functional\r
-       int AddString(LPCTSTR /*lpszItem*/)\r
-       {\r
-               ATLASSERT(FALSE);  // Not available in CComboBoxEx; use InsertItem\r
-               return 0;\r
-       }\r
-\r
-       int InsertString(int /*nIndex*/, LPCTSTR /*lpszString*/)\r
-       {\r
-               ATLASSERT(FALSE);  // Not available in CComboBoxEx; use InsertItem\r
-               return 0;\r
-       }\r
-\r
-       int Dir(UINT /*attr*/, LPCTSTR /*lpszWildCard*/)\r
-       {\r
-               ATLASSERT(FALSE);  // Not available in CComboBoxEx\r
-               return 0;\r
-       }\r
-\r
-       int FindString(int /*nStartAfter*/, LPCTSTR /*lpszString*/) const\r
-       {\r
-               ATLASSERT(FALSE);  // Not available in CComboBoxEx; try FindStringExact\r
-               return 0;\r
-       }\r
-};\r
-\r
-typedef CComboBoxExT<ATL::CWindow>   CComboBoxEx;\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMonthCalendarCtrl\r
-\r
-template <class TBase>\r
-class CMonthCalendarCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CMonthCalendarCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CMonthCalendarCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return MONTHCAL_CLASS;\r
-       }\r
-\r
-       COLORREF GetColor(int nColorType) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, MCM_GETCOLOR, nColorType, 0L);\r
-       }\r
-\r
-       COLORREF SetColor(int nColorType, COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, MCM_SETCOLOR, nColorType, clr);\r
-       }\r
-\r
-       BOOL GetCurSel(LPSYSTEMTIME lpSysTime) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM)lpSysTime);\r
-       }\r
-\r
-       BOOL SetCurSel(LPSYSTEMTIME lpSysTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM)lpSysTime);\r
-       }\r
-\r
-       int GetFirstDayOfWeek(BOOL* pbLocaleVal = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, MCM_GETFIRSTDAYOFWEEK, 0, 0L);\r
-               if(pbLocaleVal != NULL)\r
-                       *pbLocaleVal = (BOOL)HIWORD(dwRet);\r
-               return (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-       int SetFirstDayOfWeek(int nDay, BOOL* pbLocaleVal = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               DWORD dwRet = (DWORD)::SendMessage(m_hWnd, MCM_SETFIRSTDAYOFWEEK, 0, nDay);\r
-               if(pbLocaleVal != NULL)\r
-                       *pbLocaleVal = (BOOL)HIWORD(dwRet);\r
-               return (int)(short)LOWORD(dwRet);\r
-       }\r
-\r
-       int GetMaxSelCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, MCM_GETMAXSELCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetMaxSelCount(int nMax)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0L);\r
-       }\r
-\r
-       int GetMonthDelta() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, MCM_GETMONTHDELTA, 0, 0L);\r
-       }\r
-\r
-       int SetMonthDelta(int nDelta)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, MCM_SETMONTHDELTA, nDelta, 0L);\r
-       }\r
-\r
-       DWORD GetRange(LPSYSTEMTIME lprgSysTimeArray) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM)lprgSysTimeArray);\r
-       }\r
-\r
-       BOOL SetRange(DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETRANGE, dwFlags, (LPARAM)lprgSysTimeArray);\r
-       }\r
-\r
-       BOOL GetSelRange(LPSYSTEMTIME lprgSysTimeArray) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_GETSELRANGE, 0, (LPARAM)lprgSysTimeArray);\r
-       }\r
-\r
-       BOOL SetSelRange(LPSYSTEMTIME lprgSysTimeArray)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)lprgSysTimeArray);\r
-       }\r
-\r
-       BOOL GetToday(LPSYSTEMTIME lpSysTime) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM)lpSysTime);\r
-       }\r
-\r
-       void SetToday(LPSYSTEMTIME lpSysTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, MCM_SETTODAY, 0, (LPARAM)lpSysTime);\r
-       }\r
-\r
-       BOOL GetMinReqRect(LPRECT lpRectInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM)lpRectInfo);\r
-       }\r
-\r
-       int GetMaxTodayWidth() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, MCM_GETMAXTODAYWIDTH, 0, 0L);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL GetUnicodeFormat() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_GETUNICODEFORMAT, 0, 0L);\r
-       }\r
-\r
-       BOOL SetUnicodeFormat(BOOL bUnicode = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETUNICODEFORMAT, bUnicode, 0L);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-       DWORD GetCurrentView() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, MCM_GETCURRENTVIEW, 0, 0L);\r
-       }\r
-\r
-       BOOL SetCurrentView(DWORD dwView)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETCURRENTVIEW, 0, dwView);\r
-       }\r
-\r
-       DWORD GetCalendarCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, MCM_GETCALENDARCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetCalendarGridInfo(PMCGRIDINFO pGridInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_GETCALENDARGRIDINFO, 0, (LPARAM)pGridInfo);\r
-       }\r
-\r
-       CALID GetCALID() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (CALID)::SendMessage(m_hWnd, MCM_GETCALID, 0, 0L);\r
-       }\r
-\r
-       void SetCALID(CALID calid)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, MCM_SETCALID, (LPARAM)calid, 0L);\r
-       }\r
-\r
-       int GetCalendarBorder() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, MCM_GETCALENDARBORDER, 0, 0L);\r
-       }\r
-\r
-       void SetCalendarBorder(int cxyBorder, BOOL bSet = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, MCM_SETCALENDARBORDER, (WPARAM)bSet, (LPARAM)cxyBorder);\r
-       }\r
-#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-\r
-// Operations\r
-       int GetMonthRange(DWORD dwFlags, LPSYSTEMTIME lprgSysTimeArray) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, MCM_GETMONTHRANGE, dwFlags, (LPARAM)lprgSysTimeArray);\r
-       }\r
-\r
-       BOOL SetDayState(int nMonths, LPMONTHDAYSTATE lpDayStateArray)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, MCM_SETDAYSTATE, nMonths, (LPARAM)lpDayStateArray);\r
-       }\r
-\r
-       DWORD HitTest(PMCHITTESTINFO pMCHitTest) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, MCM_HITTEST, 0, (LPARAM)pMCHitTest);\r
-       }\r
-\r
-#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-       void SizeRectToMin(LPRECT lpRect)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, MCM_SIZERECTTOMIN, 0, (LPARAM)lpRect);\r
-       }\r
-#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-};\r
-\r
-typedef CMonthCalendarCtrlT<ATL::CWindow>   CMonthCalendarCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDateTimePickerCtrl\r
-\r
-template <class TBase>\r
-class CDateTimePickerCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CDateTimePickerCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CDateTimePickerCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Operations\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return DATETIMEPICK_CLASS;\r
-       }\r
-\r
-       BOOL SetFormat(LPCTSTR lpszFormat)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM)lpszFormat);\r
-       }\r
-\r
-       COLORREF GetMonthCalColor(int nColorType) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, DTM_GETMCCOLOR, nColorType, 0L);\r
-       }\r
-\r
-       COLORREF SetMonthCalColor(int nColorType, COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, DTM_SETMCCOLOR, nColorType, clr);\r
-       }\r
-\r
-       DWORD GetRange(LPSYSTEMTIME lpSysTimeArray) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM)lpSysTimeArray);\r
-       }\r
-\r
-       BOOL SetRange(DWORD dwFlags, LPSYSTEMTIME lpSysTimeArray)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DTM_SETRANGE, dwFlags, (LPARAM)lpSysTimeArray);\r
-       }\r
-\r
-       DWORD GetSystemTime(LPSYSTEMTIME lpSysTime) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)lpSysTime);\r
-       }\r
-\r
-       BOOL SetSystemTime(DWORD dwFlags, LPSYSTEMTIME lpSysTime)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DTM_SETSYSTEMTIME, dwFlags, (LPARAM)lpSysTime);\r
-       }\r
-\r
-       CMonthCalendarCtrl GetMonthCal() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CMonthCalendarCtrl((HWND)::SendMessage(m_hWnd, DTM_GETMONTHCAL, 0, 0L));\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       CFontHandle GetMonthCalFont() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CFontHandle((HFONT)::SendMessage(m_hWnd, DTM_GETMCFONT, 0, 0L));\r
-       }\r
-\r
-       void SetMonthCalFont(HFONT hFont, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_SETMCFONT, (WPARAM)hFont, MAKELPARAM(bRedraw, 0));\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-       DWORD GetMonthCalStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, DTM_GETMCSTYLE, 0, 0L);\r
-       }\r
-\r
-       DWORD SetMonthCalStyle(DWORD dwStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, DTM_SETMCSTYLE, 0, (LPARAM)dwStyle);\r
-       }\r
-\r
-       void GetDateTimePickerInfo(LPDATETIMEPICKERINFO lpPickerInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_GETDATETIMEPICKERINFO, 0, (LPARAM)lpPickerInfo);\r
-       }\r
-\r
-       BOOL GetIdealSize(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DTM_GETIDEALSIZE, 0, (LPARAM)lpSize);\r
-       }\r
-\r
-       void CloseMonthCal()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_CLOSEMONTHCAL, 0, 0L);\r
-       }\r
-#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-};\r
-\r
-typedef CDateTimePickerCtrlT<ATL::CWindow>   CDateTimePickerCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFlatScrollBarImpl - support for flat scroll bars\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-template <class T>\r
-class CFlatScrollBarImpl\r
-{\r
-public:\r
-// Initialization\r
-       BOOL FlatSB_Initialize()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::InitializeFlatSB(pT->m_hWnd);\r
-       }\r
-\r
-       HRESULT FlatSB_Uninitialize()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::UninitializeFlatSB(pT->m_hWnd);\r
-       }\r
-\r
-// Flat scroll bar properties\r
-       BOOL FlatSB_GetScrollProp(UINT uIndex, LPINT lpnValue) const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_GetScrollProp(pT->m_hWnd, uIndex, lpnValue);\r
-       }\r
-\r
-       BOOL FlatSB_SetScrollProp(UINT uIndex, int nValue, BOOL bRedraw = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_SetScrollProp(pT->m_hWnd, uIndex, nValue, bRedraw);\r
-       }\r
-\r
-// Attributes\r
-       int FlatSB_GetScrollPos(int nBar) const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_GetScrollPos(pT->m_hWnd, nBar);\r
-       }\r
-\r
-       int FlatSB_SetScrollPos(int nBar, int nPos, BOOL bRedraw = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_SetScrollPos(pT->m_hWnd, nBar, nPos, bRedraw);\r
-       }\r
-\r
-       BOOL FlatSB_GetScrollRange(int nBar, LPINT lpMinPos, LPINT lpMaxPos) const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_GetScrollRange(pT->m_hWnd, nBar, lpMinPos, lpMaxPos);\r
-       }\r
-\r
-       BOOL FlatSB_SetScrollRange(int nBar, int nMinPos, int nMaxPos, BOOL bRedraw = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_SetScrollRange(pT->m_hWnd, nBar, nMinPos, nMaxPos, bRedraw);\r
-       }\r
-\r
-       BOOL FlatSB_GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo) const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_GetScrollInfo(pT->m_hWnd, nBar, lpScrollInfo);\r
-       }\r
-\r
-       int FlatSB_SetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_SetScrollInfo(pT->m_hWnd, nBar, lpScrollInfo, bRedraw);\r
-       }\r
-\r
-// Operations\r
-       BOOL FlatSB_ShowScrollBar(UINT nBar, BOOL bShow = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_ShowScrollBar(pT->m_hWnd, nBar, bShow);\r
-       }\r
-\r
-       BOOL FlatSB_EnableScrollBar(UINT uSBFlags, UINT uArrowFlags = ESB_ENABLE_BOTH)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::FlatSB_EnableScrollBar(pT->m_hWnd, uSBFlags, uArrowFlags);\r
-       }\r
-};\r
-\r
-template <class TBase>\r
-class CFlatScrollBarT : public TBase, public CFlatScrollBarImpl<CFlatScrollBarT< TBase > >\r
-{\r
-public:\r
-       CFlatScrollBarT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CFlatScrollBarT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-};\r
-\r
-typedef CFlatScrollBarT<ATL::CWindow>   CFlatScrollBar;\r
-\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CIPAddressCtrl\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-\r
-template <class TBase>\r
-class CIPAddressCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CIPAddressCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CIPAddressCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Atteributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_IPADDRESS;\r
-       }\r
-\r
-       BOOL IsBlank() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, IPM_ISBLANK, 0, 0L);\r
-       }\r
-\r
-       int GetAddress(LPDWORD lpdwAddress) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, IPM_GETADDRESS, 0, (LPARAM)lpdwAddress);\r
-       }\r
-\r
-       void SetAddress(DWORD dwAddress)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IPM_SETADDRESS, 0, dwAddress);\r
-       }\r
-\r
-       void ClearAddress()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IPM_CLEARADDRESS, 0, 0L);\r
-       }\r
-\r
-       void SetRange(int nField, WORD wRange)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IPM_SETRANGE, nField, wRange);\r
-       }\r
-\r
-       void SetRange(int nField, BYTE nMin, BYTE nMax)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IPM_SETRANGE, nField, MAKEIPRANGE(nMin, nMax));\r
-       }\r
-\r
-       void SetFocus(int nField)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IPM_SETFOCUS, nField, 0L);\r
-       }\r
-};\r
-\r
-typedef CIPAddressCtrlT<ATL::CWindow>   CIPAddressCtrl;\r
-\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPagerCtrl\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-template <class TBase>\r
-class CPagerCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CPagerCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CPagerCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_PAGESCROLLER;\r
-       }\r
-\r
-       int GetButtonSize() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PGM_GETBUTTONSIZE, 0, 0L);\r
-       }\r
-\r
-       int SetButtonSize(int nButtonSize)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PGM_SETBUTTONSIZE, 0, nButtonSize);\r
-       }\r
-\r
-       DWORD GetButtonState(int nButton) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nButton == PGB_TOPORLEFT || nButton == PGB_BOTTOMORRIGHT);\r
-               return (DWORD)::SendMessage(m_hWnd, PGM_GETBUTTONSTATE, 0, nButton);\r
-       }\r
-\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, PGM_GETBKCOLOR, 0, 0L);\r
-       }\r
-\r
-       COLORREF SetBkColor(COLORREF clrBk)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (COLORREF)::SendMessage(m_hWnd, PGM_SETBKCOLOR, 0, (LPARAM)clrBk);\r
-       }\r
-\r
-       int GetBorder() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PGM_GETBORDER, 0, 0L);\r
-       }\r
-\r
-       int SetBorder(int nBorderSize)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PGM_SETBORDER, 0, nBorderSize);\r
-       }\r
-\r
-       int GetPos() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PGM_GETPOS, 0, 0L);\r
-       }\r
-\r
-       int SetPos(int nPos)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PGM_SETPOS, 0, nPos);\r
-       }\r
-\r
-// Operations\r
-       void SetChild(HWND hWndChild)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PGM_SETCHILD, 0, (LPARAM)hWndChild);\r
-       }\r
-\r
-       void ForwardMouse(BOOL bForward = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PGM_FORWARDMOUSE, bForward, 0L);\r
-       }\r
-\r
-       void RecalcSize()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PGM_RECALCSIZE, 0, 0L);\r
-       }\r
-\r
-       void GetDropTarget(IDropTarget** ppDropTarget)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(ppDropTarget != NULL);\r
-               ::SendMessage(m_hWnd, PGM_GETDROPTARGET, 0, (LPARAM)ppDropTarget);\r
-       }\r
-};\r
-\r
-typedef CPagerCtrlT<ATL::CWindow>   CPagerCtrl;\r
-\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CLinkCtrl - Windows SYSLINK control\r
-\r
-#if (_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)\r
-\r
-template <class TBase>\r
-class CLinkCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CLinkCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CLinkCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               return TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-#ifdef _UNICODE\r
-               return WC_LINK;\r
-#else // !_UNICODE\r
-               return "SysLink";\r
-#endif // !_UNICODE\r
-       }\r
-\r
-       int GetIdealHeight(int cxMaxWidth = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LM_GETIDEALHEIGHT, cxMaxWidth, 0L);\r
-       }\r
-\r
-       BOOL GetItem(PLITEM pLItem) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LM_GETITEM, 0, (LPARAM)pLItem);\r
-       }\r
-\r
-       BOOL SetItem(PLITEM pLItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LM_SETITEM, 0, (LPARAM)pLItem);\r
-       }\r
-\r
-       // Vista only\r
-       int GetIdealSize(SIZE& size, int cxMaxWidth = 0) const\r
-       {\r
-#ifndef LM_GETIDEALSIZE\r
-               const UINT LM_GETIDEALSIZE = LM_GETIDEALHEIGHT;\r
-#endif\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, LM_GETIDEALSIZE, cxMaxWidth, (LPARAM)&size);\r
-       }\r
-\r
-// Operations\r
-       BOOL HitTest(PLHITTESTINFO pLHitTestInfo) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, LM_HITTEST, 0, (LPARAM)pLHitTestInfo);\r
-       }\r
-};\r
-\r
-typedef CLinkCtrlT<ATL::CWindow>   CLinkCtrl;\r
-\r
-#endif // (_WIN32_WINNT >= 0x0501) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCustomDraw - MI class for custom-draw support\r
-\r
-template <class T>\r
-class CCustomDraw\r
-{\r
-public:\r
-#if (_ATL_VER < 0x0700)\r
-       BOOL m_bHandledCD;\r
-\r
-       BOOL IsMsgHandled() const\r
-       {\r
-               return m_bHandledCD;\r
-       }\r
-\r
-       void SetMsgHandled(BOOL bHandled)\r
-       {\r
-               m_bHandledCD = bHandled;\r
-       }\r
-#endif // !(_ATL_VER < 0x0700)\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CCustomDraw< T >)\r
-               NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)\r
-       ALT_MSG_MAP(1)\r
-               REFLECTED_NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)\r
-       END_MSG_MAP()\r
-\r
-// message handler\r
-       LRESULT OnCustomDraw(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetMsgHandled(TRUE);\r
-               LPNMCUSTOMDRAW lpNMCustomDraw = (LPNMCUSTOMDRAW)pnmh;\r
-               DWORD dwRet = 0;\r
-               switch(lpNMCustomDraw->dwDrawStage)\r
-               {\r
-               case CDDS_PREPAINT:\r
-                       dwRet = pT->OnPrePaint(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_POSTPAINT:\r
-                       dwRet = pT->OnPostPaint(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_PREERASE:\r
-                       dwRet = pT->OnPreErase(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_POSTERASE:\r
-                       dwRet = pT->OnPostErase(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_ITEMPREPAINT:\r
-                       dwRet = pT->OnItemPrePaint(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_ITEMPOSTPAINT:\r
-                       dwRet = pT->OnItemPostPaint(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_ITEMPREERASE:\r
-                       dwRet = pT->OnItemPreErase(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-               case CDDS_ITEMPOSTERASE:\r
-                       dwRet = pT->OnItemPostErase(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-#if (_WIN32_IE >= 0x0400)\r
-               case (CDDS_ITEMPREPAINT | CDDS_SUBITEM):\r
-                       dwRet = pT->OnSubItemPrePaint(idCtrl, lpNMCustomDraw);\r
-                       break;\r
-#endif // (_WIN32_IE >= 0x0400)\r
-               default:\r
-                       pT->SetMsgHandled(FALSE);\r
-                       break;\r
-               }\r
-               bHandled = pT->IsMsgHandled();\r
-               return dwRet;\r
-       }\r
-\r
-// Overrideables\r
-       DWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnPostPaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnPreErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnPostErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnItemPostPaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnItemPreErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-       DWORD OnItemPostErase(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       DWORD OnSubItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_DODEFAULT;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-};\r
-\r
-\r
-// --- Windows CE common controls ---\r
-\r
-#ifdef _WIN32_WCE\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCECommandBarCtrl\r
-\r
-template <class TBase>\r
-class CCECommandBarCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CCECommandBarCtrlT(HWND hWnd = NULL) : TBase(hWnd) { }\r
-\r
-       CCECommandBarCtrlT< TBase >& operator=(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       BOOL IsVisible() const\r
-       {\r
-               return IsWindowVisible();\r
-       }\r
-\r
-       int GetHeight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_Height(m_hWnd);\r
-       }\r
-\r
-       HMENU GetMenu(WORD wButton) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_GetMenu(m_hWnd, wButton);\r
-       }\r
-\r
-// Operations\r
-       HWND Create(HWND hWndParent, int nCmdBarID)\r
-       {\r
-               m_hWnd = ::CommandBar_Create(ModuleHelper::GetModuleInstance(), hWndParent, nCmdBarID);\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return m_hWnd;\r
-       }\r
-\r
-       void Destroy()\r
-       {\r
-               DestroyWindow();\r
-       }\r
-\r
-       BOOL Show(BOOL bShow = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_Show(m_hWnd, bShow);\r
-       }\r
-\r
-       BOOL DrawMenuBar(WORD wButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_DrawMenuBar(m_hWnd, wButton);\r
-       }\r
-\r
-       BOOL AddAdornments(DWORD dwFlags = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_AddAdornments(m_hWnd, dwFlags, 0);\r
-       }\r
-\r
-       int AddBitmap(int nBitmapID, int nNumImages)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_AddBitmap(m_hWnd, ModuleHelper::GetResourceInstance(), nBitmapID, nNumImages, 16, 16);\r
-       }\r
-\r
-       BOOL AddButtons(UINT uNumButtons, LPTBBUTTON lpButtons)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CommandBar_AddButtons(m_hWnd, uNumButtons, lpButtons);\r
-       }\r
-\r
-       BOOL AddToolTips(UINT uNumToolTips, LPTSTR lpToolTips)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CommandBar_AddToolTips(m_hWnd, uNumToolTips, lpToolTips);\r
-       }\r
-\r
-       BOOL InsertButton(int nButton, LPTBBUTTON lpButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CommandBar_InsertButton(m_hWnd, nButton, lpButton);\r
-       }\r
-\r
-       HWND InsertComboBox(int nWidth, UINT dwStyle, WORD wComboBoxID, WORD wButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_InsertComboBox(m_hWnd, ModuleHelper::GetModuleInstance(), nWidth, dwStyle, wComboBoxID, wButton);\r
-       }\r
-\r
-       BOOL InsertMenubar(WORD wMenuID, WORD wButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_InsertMenubar(m_hWnd, ModuleHelper::GetResourceInstance(), wMenuID, wButton);\r
-       }\r
-\r
-       BOOL InsertMenubarEx(ATL::_U_STRINGorID menu, WORD wButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBar_InsertMenubarEx(m_hWnd, ModuleHelper::GetResourceInstance(), (LPTSTR)menu.m_lpstr, wButton);\r
-       }\r
-\r
-       BOOL IsCommandBarMessage(LPMSG lpMsg)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::IsCommandBarMessage(m_hWnd, lpMsg);\r
-       }\r
-};\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC MenuBar\r
-       typedef CCECommandBarCtrlT<CToolBarCtrl>        CMenuBarCtrl;\r
-#else\r
-       typedef CCECommandBarCtrlT<CToolBarCtrl>        CCECommandBarCtrl;\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCECommandBandsCtrl\r
-\r
-template <class TBase>\r
-class CCECommandBandsCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CCECommandBandsCtrlT(HWND hWnd = NULL) : TBase(hWnd) { }\r
-\r
-       CCECommandBandsCtrlT< TBase >& operator=(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       BOOL IsVisible() const\r
-       {\r
-               return IsWindowVisible();\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       UINT GetHeight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CommandBands_Height(m_hWnd);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-       HWND GetCommandBar(UINT uBand) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBands_GetCommandBar(m_hWnd, uBand);\r
-       }\r
-\r
-       BOOL GetRestoreInformation(UINT uBand, LPCOMMANDBANDSRESTOREINFO pcbr) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBands_GetRestoreInformation(m_hWnd, uBand, pcbr);\r
-       }\r
-\r
-// Operations\r
-       HWND Create(HWND hWndParent, UINT wID, DWORD dwStyles, HIMAGELIST hImageList = NULL)\r
-       {\r
-               m_hWnd = ::CommandBands_Create(ModuleHelper::GetModuleInstance(), hWndParent, wID, dwStyles, hImageList);\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return m_hWnd;\r
-       }\r
-\r
-       BOOL AddAdornments(DWORD dwFlags = 0, LPREBARBANDINFO prbbi = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBands_AddAdornments(m_hWnd, ModuleHelper::GetModuleInstance(), dwFlags, prbbi);\r
-       }\r
-\r
-       BOOL AddBands(UINT uBandCount, LPREBARBANDINFO prbbi)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBands_AddBands(m_hWnd, ModuleHelper::GetModuleInstance(), uBandCount, prbbi);\r
-       }\r
-\r
-       BOOL Show(BOOL bShow = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::CommandBands_Show(m_hWnd, bShow);\r
-       }\r
-};\r
-\r
-typedef CCECommandBandsCtrlT<ATL::CWindow>     CCECommandBandsCtrl;\r
-\r
-#endif // _WIN32_WCE\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLCTRLS_H__\r
diff --git a/WTL80/include/atlctrlw.h b/WTL80/include/atlctrlw.h
deleted file mode 100644 (file)
index 3bf16ee..0000000
+++ /dev/null
@@ -1,4161 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLCTRLW_H__\r
-#define __ATLCTRLW_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifdef _WIN32_WCE\r
-       #error atlctrlw.h is not supported on Windows CE\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlctrlw.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLCTRLS_H__\r
-       #error atlctrlw.h requires atlctrls.h to be included first\r
-#endif\r
-\r
-#if (_WIN32_IE < 0x0400)\r
-       #error atlctrlw.h requires _WIN32_IE >= 0x0400\r
-#endif\r
-\r
-// Define _WTL_CMDBAR_VISTA_MENUS as 0 to exclude Vista menus support\r
-#if !defined(_WTL_CMDBAR_VISTA_MENUS) && (WINVER >= 0x0500) && (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)\r
-  #define _WTL_CMDBAR_VISTA_MENUS 1\r
-#endif\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-  #if !((_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501))\r
-       #error _WTL_CMDBAR_VISTA_MENUS requires (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)\r
-  #endif\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CCommandBarCtrlImpl<T, TBase, TWinTraits>\r
-// CCommandBarCtrl\r
-// CMDICommandBarCtrlImpl<T, TBase, TWinTraits>\r
-// CMDICommandBarCtrl\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Command Bars\r
-\r
-// Window Styles:\r
-#define CBRWS_TOP              CCS_TOP\r
-#define CBRWS_BOTTOM           CCS_BOTTOM\r
-#define CBRWS_NORESIZE         CCS_NORESIZE\r
-#define CBRWS_NOPARENTALIGN    CCS_NOPARENTALIGN\r
-#define CBRWS_NODIVIDER                CCS_NODIVIDER\r
-\r
-// Extended styles\r
-#define CBR_EX_TRANSPARENT     0x00000001L\r
-#define CBR_EX_SHAREMENU       0x00000002L\r
-#define CBR_EX_ALTFOCUSMODE    0x00000004L\r
-#define CBR_EX_TRACKALWAYS     0x00000008L\r
-#define CBR_EX_NOVISTAMENUS    0x00000010L\r
-\r
-// standard command bar styles\r
-#define ATL_SIMPLE_CMDBAR_PANE_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CBRWS_NODIVIDER | CBRWS_NORESIZE | CBRWS_NOPARENTALIGN)\r
-\r
-// Messages - support chevrons for frame windows\r
-#define CBRM_GETCMDBAR                 (WM_USER + 301) // returns command bar HWND\r
-#define CBRM_GETMENU                   (WM_USER + 302) // returns loaded or attached menu\r
-#define CBRM_TRACKPOPUPMENU            (WM_USER + 303) // displays a popup menu\r
-\r
-typedef struct tagCBRPOPUPMENU\r
-{\r
-       int cbSize;\r
-       HMENU hMenu;         // popup menu do display\r
-       UINT uFlags;         // TPM_* flags for ::TrackPopupMenuEx\r
-       int x;\r
-       int y;\r
-       LPTPMPARAMS lptpm;   // ptr to TPMPARAMS for ::TrackPopupMenuEx\r
-} CBRPOPUPMENU, *LPCBRPOPUPMENU;\r
-\r
-// helper class\r
-template <class T>\r
-class CSimpleStack : public ATL::CSimpleArray< T >\r
-{\r
-public:\r
-       BOOL Push(T t)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - STACK-PUSH (%8.8X) size = %i\n"), t, GetSize());\r
-#endif\r
-               return Add(t);\r
-       }\r
-\r
-       T Pop()\r
-       {\r
-               int nLast = GetSize() - 1;\r
-               if(nLast < 0)\r
-                       return NULL;   // must be able to convert to NULL\r
-               T t = m_aT[nLast];\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - STACK-POP (%8.8X) size = %i\n"), t, GetSize());\r
-#endif\r
-               if(!RemoveAt(nLast))\r
-                       return NULL;\r
-               return t;\r
-       }\r
-\r
-       T GetCurrent()\r
-       {\r
-               int nLast = GetSize() - 1;\r
-               if(nLast < 0)\r
-                       return NULL;   // must be able to convert to NULL\r
-               return m_aT[nLast];\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCommandBarCtrlBase - base class for the Command Bar implementation\r
-\r
-class CCommandBarCtrlBase : public CToolBarCtrl\r
-{\r
-public:\r
-       struct _MsgHookData\r
-       {\r
-               HHOOK hMsgHook;\r
-               DWORD dwUsage;\r
-\r
-               _MsgHookData() : hMsgHook(NULL), dwUsage(0)\r
-               { }\r
-       };\r
-\r
-       typedef ATL::CSimpleMap<DWORD, _MsgHookData*>   CMsgHookMap;\r
-       static CMsgHookMap* s_pmapMsgHook;\r
-\r
-       static HHOOK s_hCreateHook;\r
-       static bool s_bW2K;  // For animation flag\r
-       static CCommandBarCtrlBase* s_pCurrentBar;\r
-       static bool s_bStaticInit;\r
-\r
-       CSimpleStack<HWND> m_stackMenuWnd;\r
-       CSimpleStack<HMENU> m_stackMenuHandle;\r
-\r
-       HWND m_hWndHook;\r
-       DWORD m_dwMagic;\r
-\r
-\r
-       CCommandBarCtrlBase() : m_hWndHook(NULL), m_dwMagic(1314)\r
-       {\r
-               // init static variables\r
-               if(!s_bStaticInit)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CCommandBarCtrlBase::CCommandBarCtrlBase.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return;\r
-                       }\r
-\r
-                       if(!s_bStaticInit)\r
-                       {\r
-                               // Just in case...\r
-                               AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES);\r
-                               // Animation on Win2000 only\r
-                               s_bW2K = !AtlIsOldWindows();\r
-                               // done\r
-                               s_bStaticInit = true;\r
-                       }\r
-\r
-                       lock.Unlock();\r
-               }\r
-       }\r
-\r
-       bool IsCommandBarBase() const { return m_dwMagic == 1314; }\r
-};\r
-\r
-__declspec(selectany) CCommandBarCtrlBase::CMsgHookMap* CCommandBarCtrlBase::s_pmapMsgHook = NULL;\r
-__declspec(selectany) HHOOK CCommandBarCtrlBase::s_hCreateHook = NULL;\r
-__declspec(selectany) CCommandBarCtrlBase* CCommandBarCtrlBase::s_pCurrentBar = NULL;\r
-__declspec(selectany) bool CCommandBarCtrlBase::s_bW2K = false;\r
-__declspec(selectany) bool CCommandBarCtrlBase::s_bStaticInit = false;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCommandBarCtrl - ATL implementation of Command Bars\r
-\r
-template <class T, class TBase = CCommandBarCtrlBase, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CCommandBarCtrlImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())\r
-\r
-// Declarations\r
-       struct _MenuItemData    // menu item data\r
-       {\r
-               DWORD dwMagic;\r
-               LPTSTR lpstrText;\r
-               UINT fType;\r
-               UINT fState;\r
-               int iButton;\r
-\r
-               _MenuItemData() { dwMagic = 0x1313; }\r
-               bool IsCmdBarMenuItem() { return (dwMagic == 0x1313); }\r
-       };\r
-\r
-       struct _ToolBarData     // toolbar resource data\r
-       {\r
-               WORD wVersion;\r
-               WORD wWidth;\r
-               WORD wHeight;\r
-               WORD wItemCount;\r
-               //WORD aItems[wItemCount]\r
-\r
-               WORD* items()\r
-                       { return (WORD*)(this+1); }\r
-       };\r
-\r
-// Constants\r
-       enum _CmdBarDrawConstants\r
-       {\r
-               s_kcxGap = 1,\r
-               s_kcxTextMargin = 2,\r
-               s_kcxButtonMargin = 3,\r
-               s_kcyButtonMargin = 3\r
-       };\r
-\r
-       enum\r
-       {\r
-               _nMaxMenuItemTextLength = 100,\r
-               _chChevronShortcut = _T('/')\r
-       };\r
-\r
-#ifndef DT_HIDEPREFIX\r
-       enum { DT_HIDEPREFIX = 0x00100000 };\r
-#endif // !DT_HIDEPREFIX\r
-\r
-// Data members\r
-       HMENU m_hMenu;\r
-       HIMAGELIST m_hImageList;\r
-       ATL::CSimpleValArray<WORD> m_arrCommand;\r
-\r
-       DWORD m_dwExtendedStyle;   // Command Bar specific extended styles\r
-\r
-       ATL::CContainedWindow m_wndParent;\r
-\r
-       bool m_bMenuActive:1;\r
-       bool m_bAttachedMenu:1;\r
-       bool m_bImagesVisible:1;\r
-       bool m_bPopupItem:1;\r
-       bool m_bContextMenu:1;\r
-       bool m_bEscapePressed:1;\r
-       bool m_bSkipMsg:1;\r
-       bool m_bParentActive:1;\r
-       bool m_bFlatMenus:1;\r
-       bool m_bUseKeyboardCues:1;\r
-       bool m_bShowKeyboardCues:1;\r
-       bool m_bAllowKeyboardCues:1;\r
-       bool m_bKeyboardInput:1;\r
-       bool m_bAlphaImages:1;\r
-       bool m_bLayoutRTL:1;\r
-       bool m_bSkipPostDown:1;\r
-       bool m_bVistaMenus:1;\r
-\r
-       int m_nPopBtn;\r
-       int m_nNextPopBtn;\r
-\r
-       SIZE m_szBitmap;\r
-       SIZE m_szButton;\r
-\r
-       COLORREF m_clrMask;\r
-       CFont m_fontMenu;   // used internally, only to measure text\r
-\r
-       UINT m_uSysKey;\r
-\r
-       HWND m_hWndFocus;   // Alternate focus mode\r
-\r
-       int m_cxExtraSpacing;\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-       ATL::CSimpleValArray<HBITMAP> m_arrVistaBitmap;   // Bitmaps for Vista menus\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-// Constructor/destructor\r
-       CCommandBarCtrlImpl() : \r
-                       m_hMenu(NULL), \r
-                       m_hImageList(NULL), \r
-                       m_wndParent(this, 1), \r
-                       m_bMenuActive(false), \r
-                       m_bAttachedMenu(false), \r
-                       m_nPopBtn(-1), \r
-                       m_nNextPopBtn(-1), \r
-                       m_bPopupItem(false),\r
-                       m_bImagesVisible(true),\r
-                       m_bSkipMsg(false),\r
-                       m_uSysKey(0),\r
-                       m_hWndFocus(NULL),\r
-                       m_bContextMenu(false),\r
-                       m_bEscapePressed(false),\r
-                       m_clrMask(RGB(192, 192, 192)),\r
-                       m_dwExtendedStyle(CBR_EX_TRANSPARENT | CBR_EX_SHAREMENU | CBR_EX_TRACKALWAYS),\r
-                       m_bParentActive(true),\r
-                       m_bFlatMenus(false),\r
-                       m_bUseKeyboardCues(false),\r
-                       m_bShowKeyboardCues(false),\r
-                       m_bAllowKeyboardCues(true),\r
-                       m_bKeyboardInput(false),\r
-                       m_cxExtraSpacing(0),\r
-                       m_bAlphaImages(false),\r
-                       m_bLayoutRTL(false),\r
-                       m_bSkipPostDown(false),\r
-                       m_bVistaMenus(false)\r
-       {\r
-               SetImageSize(16, 15);   // default\r
-       }\r
-\r
-       ~CCommandBarCtrlImpl()\r
-       {\r
-               if(m_wndParent.IsWindow())\r
-/*scary!*/                     m_wndParent.UnsubclassWindow();\r
-\r
-               if(m_hMenu != NULL && (m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0)\r
-                       ::DestroyMenu(m_hMenu);\r
-\r
-               if(m_hImageList != NULL)\r
-                       ::ImageList_Destroy(m_hImageList);\r
-       }\r
-\r
-// Attributes\r
-       DWORD GetCommandBarExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-       DWORD SetCommandBarExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               return dwPrevStyle;\r
-       }\r
-\r
-       CMenuHandle GetMenu() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return m_hMenu;\r
-       }\r
-\r
-       COLORREF GetImageMaskColor() const\r
-       {\r
-               return m_clrMask;\r
-       }\r
-\r
-       COLORREF SetImageMaskColor(COLORREF clrMask)\r
-       {\r
-               COLORREF clrOld = m_clrMask;\r
-               m_clrMask = clrMask;\r
-               return clrOld;\r
-       }\r
-\r
-       bool GetImagesVisible() const\r
-       {\r
-               return m_bImagesVisible;\r
-       }\r
-\r
-       bool SetImagesVisible(bool bVisible)\r
-       {\r
-               bool bOld = m_bImagesVisible;\r
-               m_bImagesVisible = bVisible;\r
-               return bOld;\r
-       }\r
-\r
-       void GetImageSize(SIZE& size) const\r
-       {\r
-               size = m_szBitmap;\r
-       }\r
-\r
-       bool SetImageSize(SIZE& size)\r
-       {\r
-               return SetImageSize(size.cx, size.cy);\r
-       }\r
-\r
-       bool SetImageSize(int cx, int cy)\r
-       {\r
-               if(m_hImageList != NULL)\r
-               {\r
-                       if(::ImageList_GetImageCount(m_hImageList) == 0)   // empty\r
-                       {\r
-                               ::ImageList_Destroy(m_hImageList);\r
-                               m_hImageList = NULL;\r
-                       }\r
-                       else\r
-                       {\r
-                               return false;   // can't set, image list exists\r
-                       }\r
-               }\r
-\r
-               if(cx == 0 || cy == 0)\r
-                       return false;\r
-\r
-               m_szBitmap.cx = cx;\r
-               m_szBitmap.cy = cy;\r
-               m_szButton.cx = m_szBitmap.cx + 2 * s_kcxButtonMargin;\r
-               m_szButton.cy = m_szBitmap.cy + 2 * s_kcyButtonMargin;\r
-\r
-               return true;\r
-       }\r
-\r
-       bool GetAlphaImages() const\r
-       {\r
-               return m_bAlphaImages;\r
-       }\r
-\r
-       bool SetAlphaImages(bool bAlphaImages)\r
-       {\r
-               if(m_hImageList != NULL)\r
-               {\r
-                       if(::ImageList_GetImageCount(m_hImageList) == 0)   // empty\r
-                       {\r
-                               ::ImageList_Destroy(m_hImageList);\r
-                               m_hImageList = NULL;\r
-                       }\r
-                       else\r
-                       {\r
-                               return false;   // can't set, image list exists\r
-                       }\r
-               }\r
-\r
-               m_bAlphaImages = bAlphaImages;\r
-               return true;\r
-       }\r
-\r
-       HWND GetCmdBar() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HWND)::SendMessage(m_hWnd, CBRM_GETCMDBAR, 0, 0L);\r
-       }\r
-\r
-// Methods\r
-       HWND Create(HWND hWndParent, RECT& rcPos, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       UINT nID = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               // These styles are required for command bars\r
-               dwStyle |= TBSTYLE_LIST | TBSTYLE_FLAT;\r
-#if (_MSC_VER >= 1300)\r
-               return ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, rcPos, szWindowName, dwStyle, dwExStyle, nID, lpCreateParam);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImpl< T, TBase, TWinTraits >   _baseClass;\r
-               return _baseClass::Create(hWndParent, rcPos, szWindowName, dwStyle, dwExStyle, nID, lpCreateParam);\r
-#endif // !(_MSC_VER >= 1300)\r
-       }\r
-\r
-       BOOL AttachToWindow(HWND hWnd)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ATLASSERT(::IsWindow(hWnd));\r
-               BOOL bRet = SubclassWindow(hWnd);\r
-               if(bRet)\r
-               {\r
-                       m_bAttachedMenu = true;\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->GetSystemSettings();\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       BOOL LoadMenu(ATL::_U_STRINGorID menu)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               if(m_bAttachedMenu)   // doesn't work in this mode\r
-                       return FALSE;\r
-               if(menu.m_lpstr == NULL)\r
-                       return FALSE;\r
-\r
-               HMENU hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), menu.m_lpstr);\r
-               if(hMenu == NULL)\r
-                       return FALSE;\r
-\r
-               return AttachMenu(hMenu);\r
-       }\r
-\r
-       BOOL AttachMenu(HMENU hMenu)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hMenu == NULL || ::IsMenu(hMenu));\r
-               if(hMenu != NULL && !::IsMenu(hMenu))\r
-                       return FALSE;\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               // remove Vista bitmaps if used\r
-               if(m_bVistaMenus && (m_hMenu != NULL))\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->_RemoveVistaBitmapsFromMenu();\r
-               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-               // destroy old menu, if needed, and set new one\r
-               if(m_hMenu != NULL && (m_dwExtendedStyle & CBR_EX_SHAREMENU) == 0)\r
-                       ::DestroyMenu(m_hMenu);\r
-\r
-               m_hMenu = hMenu;\r
-\r
-               if(m_bAttachedMenu)   // Nothing else in this mode\r
-                       return TRUE;\r
-\r
-               // Build buttons according to menu\r
-               SetRedraw(FALSE);\r
-\r
-               // Clear all buttons\r
-               int nCount = GetButtonCount();\r
-               for(int i = 0; i < nCount; i++)\r
-                       ATLVERIFY(DeleteButton(0) != FALSE);\r
-\r
-               // Add buttons for each menu item\r
-               if(m_hMenu != NULL)\r
-               {\r
-                       int nItems = ::GetMenuItemCount(m_hMenu);\r
-\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT;   // avoid level 4 warning\r
-                       TCHAR szString[pT->_nMaxMenuItemTextLength];\r
-                       for(int i = 0; i < nItems; i++)\r
-                       {\r
-                               CMenuItemInfo mii;\r
-                               mii.fMask = MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU;\r
-                               mii.fType = MFT_STRING;\r
-                               mii.dwTypeData = szString;\r
-                               mii.cch = pT->_nMaxMenuItemTextLength;\r
-                               BOOL bRet = ::GetMenuItemInfo(m_hMenu, i, TRUE, &mii);\r
-                               ATLASSERT(bRet);\r
-                               // If we have more than the buffer, we assume we have bitmaps bits\r
-                               if(lstrlen(szString) > pT->_nMaxMenuItemTextLength - 1)\r
-                               {\r
-                                       mii.fType = MFT_BITMAP;\r
-                                       ::SetMenuItemInfo(m_hMenu, i, TRUE, &mii);\r
-                                       szString[0] = 0;\r
-                               }\r
-\r
-                               // NOTE: Command Bar currently supports only drop-down menu items\r
-                               ATLASSERT(mii.hSubMenu != NULL);\r
-\r
-                               TBBUTTON btn = { 0 };\r
-                               btn.iBitmap = 0;\r
-                               btn.idCommand = i;\r
-                               btn.fsState = (BYTE)(((mii.fState & MFS_DISABLED) == 0) ? TBSTATE_ENABLED : 0);\r
-                               btn.fsStyle = TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE | TBSTYLE_DROPDOWN;\r
-                               btn.dwData = 0;\r
-                               btn.iString = 0;\r
-\r
-                               bRet = InsertButton(-1, &btn);\r
-                               ATLASSERT(bRet);\r
-\r
-                               TBBUTTONINFO bi = { 0 };\r
-                               bi.cbSize = sizeof(TBBUTTONINFO);\r
-                               bi.dwMask = TBIF_TEXT;\r
-                               bi.pszText = szString;\r
-\r
-                               bRet = SetButtonInfo(i, &bi);\r
-                               ATLASSERT(bRet);\r
-                       }\r
-               }\r
-\r
-               SetRedraw(TRUE);\r
-               Invalidate();\r
-               UpdateWindow();\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL LoadImages(ATL::_U_STRINGorID image)\r
-       {\r
-               return _LoadImagesHelper(image, false);\r
-       }\r
-\r
-       BOOL LoadMappedImages(UINT nIDImage, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)\r
-       {\r
-               return _LoadImagesHelper(nIDImage, true, nFlags , lpColorMap, nMapSize);\r
-       }\r
-\r
-       BOOL _LoadImagesHelper(ATL::_U_STRINGorID image, bool bMapped, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HINSTANCE hInstance = ModuleHelper::GetResourceInstance();\r
-\r
-               HRSRC hRsrc = ::FindResource(hInstance, image.m_lpstr, (LPTSTR)RT_TOOLBAR);\r
-               if(hRsrc == NULL)\r
-                       return FALSE;\r
-\r
-               HGLOBAL hGlobal = ::LoadResource(hInstance, hRsrc);\r
-               if(hGlobal == NULL)\r
-                       return FALSE;\r
-\r
-               _ToolBarData* pData = (_ToolBarData*)::LockResource(hGlobal);\r
-               if(pData == NULL)\r
-                       return FALSE;\r
-               ATLASSERT(pData->wVersion == 1);\r
-\r
-               WORD* pItems = pData->items();\r
-               int nItems = pData->wItemCount;\r
-\r
-               // Set internal data\r
-               SetImageSize(pData->wWidth, pData->wHeight);\r
-\r
-               // Create image list if needed\r
-               if(m_hImageList == NULL)\r
-               {\r
-                       // Check if the bitmap is 32-bit (alpha channel) bitmap (valid for Windows XP only)\r
-                       T* pT = static_cast<T*>(this);\r
-                       m_bAlphaImages = AtlIsAlphaBitmapResource(image);\r
-\r
-                       if(!pT->CreateInternalImageList(pData->wItemCount))\r
-                               return FALSE;\r
-               }\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               int nOldImageCount = ::ImageList_GetImageCount(m_hImageList);\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-               // Add bitmap to our image list\r
-               CBitmap bmp;\r
-               if(bMapped)\r
-               {\r
-                       ATLASSERT(HIWORD(PtrToUlong(image.m_lpstr)) == 0);   // if mapped, must be a numeric ID\r
-                       int nIDImage = (int)(short)LOWORD(PtrToUlong(image.m_lpstr));\r
-                       bmp.LoadMappedBitmap(nIDImage, (WORD)nFlags, lpColorMap, nMapSize);\r
-               }\r
-               else\r
-               {\r
-                       if(m_bAlphaImages)\r
-                               bmp = (HBITMAP)::LoadImage(ModuleHelper::GetResourceInstance(), image.m_lpstr, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE);\r
-                       else\r
-                               bmp.LoadBitmap(image.m_lpstr);\r
-               }\r
-               ATLASSERT(bmp.m_hBitmap != NULL);\r
-               if(bmp.m_hBitmap == NULL)\r
-                       return FALSE;\r
-               if(::ImageList_AddMasked(m_hImageList, bmp, m_clrMask) == -1)\r
-                       return FALSE;\r
-\r
-               // Fill the array with command IDs\r
-               for(int i = 0; i < nItems; i++)\r
-               {\r
-                       if(pItems[i] != 0)\r
-                               m_arrCommand.Add(pItems[i]);\r
-               }\r
-\r
-               int nImageCount = ::ImageList_GetImageCount(m_hImageList);\r
-               ATLASSERT(nImageCount == m_arrCommand.GetSize());\r
-               if(nImageCount != m_arrCommand.GetSize())\r
-                       return FALSE;\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               if(RunTimeHelper::IsVista())\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->_AddVistaBitmapsFromImageList(nOldImageCount, nImageCount - nOldImageCount);\r
-                       ATLASSERT(nImageCount == m_arrVistaBitmap.GetSize());\r
-               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL AddBitmap(ATL::_U_STRINGorID bitmap, int nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               CBitmap bmp;\r
-               bmp.LoadBitmap(bitmap.m_lpstr);\r
-               if(bmp.m_hBitmap == NULL)\r
-                       return FALSE;\r
-               return AddBitmap(bmp, nCommandID);\r
-       }\r
-\r
-       BOOL AddBitmap(HBITMAP hBitmap, UINT nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               // Create image list if it doesn't exist\r
-               if(m_hImageList == NULL)\r
-               {\r
-                       if(!pT->CreateInternalImageList(1))\r
-                               return FALSE;\r
-               }\r
-               // check bitmap size\r
-               CBitmapHandle bmp = hBitmap;\r
-               SIZE size = { 0, 0 };\r
-               bmp.GetSize(size);\r
-               if(size.cx != m_szBitmap.cx || size.cy != m_szBitmap.cy)\r
-               {\r
-                       ATLASSERT(FALSE);   // must match size!\r
-                       return FALSE;\r
-               }\r
-               // add bitmap\r
-               int nRet = ::ImageList_AddMasked(m_hImageList, hBitmap, m_clrMask);\r
-               if(nRet == -1)\r
-                       return FALSE;\r
-               BOOL bRet = m_arrCommand.Add((WORD)nCommandID);\r
-               ATLASSERT(::ImageList_GetImageCount(m_hImageList) == m_arrCommand.GetSize());\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               if(RunTimeHelper::IsVista())\r
-               {\r
-                       pT->_AddVistaBitmapFromImageList(m_arrCommand.GetSize() - 1);\r
-                       ATLASSERT(m_arrVistaBitmap.GetSize() == m_arrCommand.GetSize());\r
-               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-               return bRet;\r
-       }\r
-\r
-       BOOL AddIcon(ATL::_U_STRINGorID icon, UINT nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HICON hIcon = ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\r
-               if(hIcon == NULL)\r
-                       return FALSE;\r
-               return AddIcon(hIcon, nCommandID);\r
-       }\r
-\r
-       BOOL AddIcon(HICON hIcon, UINT nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               // create image list if it doesn't exist\r
-               if(m_hImageList == NULL)\r
-               {\r
-                       if(!pT->CreateInternalImageList(1))\r
-                               return FALSE;\r
-               }\r
-\r
-               int nRet = ::ImageList_AddIcon(m_hImageList, hIcon);\r
-               if(nRet == -1)\r
-                       return FALSE;\r
-               BOOL bRet = m_arrCommand.Add((WORD)nCommandID);\r
-               ATLASSERT(::ImageList_GetImageCount(m_hImageList) == m_arrCommand.GetSize());\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               if(RunTimeHelper::IsVista())\r
-               {\r
-                       pT->_AddVistaBitmapFromImageList(m_arrCommand.GetSize() - 1);\r
-                       ATLASSERT(m_arrVistaBitmap.GetSize() == m_arrCommand.GetSize());\r
-               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-               return bRet;\r
-       }\r
-\r
-       BOOL ReplaceBitmap(ATL::_U_STRINGorID bitmap, int nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               CBitmap bmp;\r
-               bmp.LoadBitmap(bitmap.m_lpstr);\r
-               if(bmp.m_hBitmap == NULL)\r
-                       return FALSE;\r
-               return ReplaceBitmap(bmp, nCommandID);\r
-       }\r
-\r
-       BOOL ReplaceBitmap(HBITMAP hBitmap, UINT nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               BOOL bRet = FALSE;\r
-               for(int i = 0; i < m_arrCommand.GetSize(); i++)\r
-               {\r
-                       if(m_arrCommand[i] == nCommandID)\r
-                       {\r
-                               bRet = ::ImageList_Remove(m_hImageList, i);\r
-                               if(bRet)\r
-                               {\r
-                                       m_arrCommand.RemoveAt(i);\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-                                       if(RunTimeHelper::IsVista())\r
-                                       {\r
-                                               if(m_arrVistaBitmap[i] != NULL)\r
-                                                       ::DeleteObject(m_arrVistaBitmap[i]);\r
-                                               m_arrVistaBitmap.RemoveAt(i);\r
-                                       }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-                               }\r
-                               break;\r
-                       }\r
-               }\r
-               if(bRet)\r
-                       bRet = AddBitmap(hBitmap, nCommandID);\r
-               return bRet;\r
-       }\r
-\r
-       BOOL ReplaceIcon(ATL::_U_STRINGorID icon, UINT nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HICON hIcon = ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\r
-               if(hIcon == NULL)\r
-                       return FALSE;\r
-               return ReplaceIcon(hIcon, nCommandID);\r
-       }\r
-\r
-       BOOL ReplaceIcon(HICON hIcon, UINT nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               BOOL bRet = FALSE;\r
-               for(int i = 0; i < m_arrCommand.GetSize(); i++)\r
-               {\r
-                       if(m_arrCommand[i] == nCommandID)\r
-                       {\r
-                               bRet = (::ImageList_ReplaceIcon(m_hImageList, i, hIcon) != -1);\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-                               if(RunTimeHelper::IsVista() && bRet != FALSE)\r
-                               {\r
-                                       T* pT = static_cast<T*>(this);\r
-                                       pT->_ReplaceVistaBitmapFromImageList(i);\r
-                               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-                               break;\r
-                       }\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       BOOL RemoveImage(int nCommandID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               BOOL bRet = FALSE;\r
-               for(int i = 0; i < m_arrCommand.GetSize(); i++)\r
-               {\r
-                       if(m_arrCommand[i] == nCommandID)\r
-                       {\r
-                               bRet = ::ImageList_Remove(m_hImageList, i);\r
-                               if(bRet)\r
-                               {\r
-                                       m_arrCommand.RemoveAt(i);\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-                                       if(RunTimeHelper::IsVista())\r
-                                       {\r
-                                               if(m_arrVistaBitmap[i] != NULL)\r
-                                                       ::DeleteObject(m_arrVistaBitmap[i]);\r
-                                               m_arrVistaBitmap.RemoveAt(i);\r
-                                       }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-                               }\r
-                               break;\r
-                       }\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       BOOL RemoveAllImages()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Removing all images\n"));\r
-               BOOL bRet = ::ImageList_RemoveAll(m_hImageList);\r
-               if(bRet)\r
-               {\r
-                       m_arrCommand.RemoveAll();\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-                       for(int i = 0; i < m_arrVistaBitmap.GetSize(); i++)\r
-                       {\r
-                               if(m_arrVistaBitmap[i] != NULL)\r
-                                       ::DeleteObject(m_arrVistaBitmap[i]);\r
-                       }\r
-                       m_arrVistaBitmap.RemoveAll();\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       BOOL TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, LPTPMPARAMS lpParams = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(::IsMenu(hMenu));\r
-               if(!::IsMenu(hMenu))\r
-                       return FALSE;\r
-               m_bContextMenu = true;\r
-               if(m_bUseKeyboardCues)\r
-                       m_bShowKeyboardCues = m_bKeyboardInput;\r
-               T* pT = static_cast<T*>(this);\r
-               return pT->DoTrackPopupMenu(hMenu, uFlags, x, y, lpParams);\r
-       }\r
-\r
-       BOOL SetMDIClient(HWND /*hWndMDIClient*/)\r
-       {\r
-               // Use CMDICommandBarCtrl for MDI support\r
-               ATLASSERT(FALSE);\r
-               return FALSE;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CCommandBarCtrlImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_INITMENU, OnInitMenu)\r
-               MESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)\r
-               MESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)\r
-               MESSAGE_HANDLER(GetAutoPopupMessage(), OnInternalAutoPopup)\r
-               MESSAGE_HANDLER(GetGetBarMessage(), OnInternalGetBar)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-               MESSAGE_HANDLER(WM_MENUCHAR, OnMenuChar)\r
-\r
-               MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\r
-               MESSAGE_HANDLER(WM_KEYUP, OnKeyUp)\r
-               MESSAGE_HANDLER(WM_CHAR, OnChar)\r
-               MESSAGE_HANDLER(WM_SYSKEYDOWN, OnSysKeyDown)\r
-               MESSAGE_HANDLER(WM_SYSKEYUP, OnSysKeyUp)\r
-               MESSAGE_HANDLER(WM_SYSCHAR, OnSysChar)\r
-// public API handlers - these stay to support chevrons in atlframe.h\r
-               MESSAGE_HANDLER(CBRM_GETMENU, OnAPIGetMenu)\r
-               MESSAGE_HANDLER(CBRM_TRACKPOPUPMENU, OnAPITrackPopupMenu)\r
-               MESSAGE_HANDLER(CBRM_GETCMDBAR, OnAPIGetCmdBar)\r
-\r
-               MESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)\r
-               MESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)\r
-\r
-               MESSAGE_HANDLER(WM_FORWARDMSG, OnForwardMsg)\r
-       ALT_MSG_MAP(1)   // Parent window messages\r
-               NOTIFY_CODE_HANDLER(TBN_HOTITEMCHANGE, OnParentHotItemChange)\r
-               NOTIFY_CODE_HANDLER(TBN_DROPDOWN, OnParentDropDown)\r
-               MESSAGE_HANDLER(WM_INITMENUPOPUP, OnParentInitMenuPopup)\r
-               MESSAGE_HANDLER(GetGetBarMessage(), OnParentInternalGetBar)\r
-               MESSAGE_HANDLER(WM_SYSCOMMAND, OnParentSysCommand)\r
-               MESSAGE_HANDLER(CBRM_GETMENU, OnParentAPIGetMenu)\r
-               MESSAGE_HANDLER(WM_MENUCHAR, OnParentMenuChar)\r
-               MESSAGE_HANDLER(CBRM_TRACKPOPUPMENU, OnParentAPITrackPopupMenu)\r
-               MESSAGE_HANDLER(CBRM_GETCMDBAR, OnParentAPIGetCmdBar)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnParentSettingChange)\r
-\r
-               MESSAGE_HANDLER(WM_DRAWITEM, OnParentDrawItem)\r
-               MESSAGE_HANDLER(WM_MEASUREITEM, OnParentMeasureItem)\r
-\r
-               MESSAGE_HANDLER(WM_ACTIVATE, OnParentActivate)\r
-               NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnParentCustomDraw)\r
-       ALT_MSG_MAP(2)   // MDI client window messages\r
-               // Use CMDICommandBarCtrl for MDI support\r
-       ALT_MSG_MAP(3)   // Message hook messages\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, OnHookMouseMove)\r
-               MESSAGE_HANDLER(WM_SYSKEYDOWN, OnHookSysKeyDown)\r
-               MESSAGE_HANDLER(WM_SYSKEYUP, OnHookSysKeyUp)\r
-               MESSAGE_HANDLER(WM_SYSCHAR, OnHookSysChar)\r
-               MESSAGE_HANDLER(WM_KEYDOWN, OnHookKeyDown)\r
-               MESSAGE_HANDLER(WM_NEXTMENU, OnHookNextMenu)\r
-               MESSAGE_HANDLER(WM_CHAR, OnHookChar)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LPMSG pMsg = (LPMSG)lParam;\r
-               if(pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MOUSELAST)\r
-                       m_bKeyboardInput = false;\r
-               else if(pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)\r
-                       m_bKeyboardInput = true;\r
-               LRESULT lRet = 0;\r
-               ProcessWindowMessage(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam, lRet, 3);\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               // Let the toolbar initialize itself\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               // get and use system settings\r
-               T* pT = static_cast<T*>(this);\r
-               pT->GetSystemSettings();\r
-               // Parent init\r
-               ATL::CWindow wndParent = GetParent();\r
-               ATL::CWindow wndTopLevelParent = wndParent.GetTopLevelParent();\r
-               m_wndParent.SubclassWindow(wndTopLevelParent);\r
-               // Toolbar Init\r
-               SetButtonStructSize();\r
-               SetImageList(NULL);\r
-\r
-               // Create message hook if needed\r
-               CWindowCreateCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CCommandBarCtrlImpl::OnCreate.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return -1;\r
-               }\r
-\r
-               if(s_pmapMsgHook == NULL)\r
-               {\r
-                       ATLTRY(s_pmapMsgHook = new CMsgHookMap);\r
-                       ATLASSERT(s_pmapMsgHook != NULL);\r
-               }\r
-\r
-               if(s_pmapMsgHook != NULL)\r
-               {\r
-                       DWORD dwThreadID = ::GetCurrentThreadId();\r
-                       _MsgHookData* pData = s_pmapMsgHook->Lookup(dwThreadID);\r
-                       if(pData == NULL)\r
-                       {\r
-                               ATLTRY(pData = new _MsgHookData);\r
-                               ATLASSERT(pData != NULL);\r
-                               HHOOK hMsgHook = ::SetWindowsHookEx(WH_GETMESSAGE, MessageHookProc, ModuleHelper::GetModuleInstance(), dwThreadID);\r
-                               ATLASSERT(hMsgHook != NULL);\r
-                               if(pData != NULL && hMsgHook != NULL)\r
-                               {\r
-                                       pData->hMsgHook = hMsgHook;\r
-                                       pData->dwUsage = 1;\r
-                                       BOOL bRet = s_pmapMsgHook->Add(dwThreadID, pData);\r
-                                       bRet;\r
-                                       ATLASSERT(bRet);\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               (pData->dwUsage)++;\r
-                       }\r
-               }\r
-               lock.Unlock();\r
-\r
-               // Get layout\r
-#if (WINVER >= 0x0500)\r
-               m_bLayoutRTL = ((GetExStyle() & WS_EX_LAYOUTRTL) != 0);\r
-#endif // (WINVER >= 0x0500)\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               if(m_bVistaMenus && (m_hMenu != NULL))\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->_RemoveVistaBitmapsFromMenu();\r
-               }\r
-\r
-               for(int i = 0; i < m_arrVistaBitmap.GetSize(); i++)\r
-               {\r
-                       if(m_arrVistaBitmap[i] != NULL)\r
-                               ::DeleteObject(m_arrVistaBitmap[i]);\r
-               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-               if(m_bAttachedMenu)   // nothing to do in this mode\r
-                       return lRet;\r
-\r
-               CWindowCreateCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CCommandBarCtrlImpl::OnDestroy.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return lRet;\r
-               }\r
-\r
-               if(s_pmapMsgHook != NULL)\r
-               {\r
-                       DWORD dwThreadID = ::GetCurrentThreadId();\r
-                       _MsgHookData* pData = s_pmapMsgHook->Lookup(dwThreadID);\r
-                       if(pData != NULL)\r
-                       {\r
-                               (pData->dwUsage)--;\r
-                               if(pData->dwUsage == 0)\r
-                               {\r
-                                       BOOL bRet = ::UnhookWindowsHookEx(pData->hMsgHook);\r
-                                       ATLASSERT(bRet);\r
-                                       bRet = s_pmapMsgHook->Remove(dwThreadID);\r
-                                       ATLASSERT(bRet);\r
-                                       if(bRet)\r
-                                               delete pData;\r
-                               }\r
-\r
-                               if(s_pmapMsgHook->GetSize() == 0)\r
-                               {\r
-                                       delete s_pmapMsgHook;\r
-                                       s_pmapMsgHook = NULL;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               lock.Unlock();\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnKeyDown\n"));\r
-#endif\r
-               bHandled = FALSE;\r
-               // Simulate Alt+Space for the parent\r
-               if(wParam == VK_SPACE)\r
-               {\r
-                       m_wndParent.PostMessage(WM_SYSKEYDOWN, wParam, lParam | (1 << 29));\r
-                       bHandled = TRUE;\r
-               }\r
-#if (_WIN32_IE >= 0x0500)\r
-               else if(wParam == VK_LEFT || wParam == VK_RIGHT)\r
-               {\r
-                       WPARAM wpNext = m_bLayoutRTL ? VK_LEFT : VK_RIGHT;\r
-\r
-                       if(!m_bMenuActive)\r
-                       {\r
-                               T* pT = static_cast<T*>(this);\r
-                               int nBtn = GetHotItem();\r
-                               int nNextBtn = (wParam == wpNext) ? pT->GetNextMenuItem(nBtn) : pT->GetPreviousMenuItem(nBtn);\r
-                               if(nNextBtn == -2)\r
-                               {\r
-                                       SetHotItem(-1);\r
-                                       if(pT->DisplayChevronMenu())\r
-                                               bHandled = TRUE;\r
-                               }\r
-                       }\r
-               }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnKeyUp\n"));\r
-#endif\r
-               if(wParam != VK_SPACE)\r
-                       bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnChar\n"));\r
-#endif\r
-               if(wParam != VK_SPACE)\r
-                       bHandled = FALSE;\r
-               else\r
-                       return 0;\r
-               // Security\r
-               if(!m_wndParent.IsWindowEnabled() || ::GetFocus() != m_hWnd)\r
-                       return 0;\r
-\r
-               // Handle mnemonic press when we have focus\r
-               int nBtn = 0;\r
-               if(wParam != VK_RETURN && !MapAccelerator((TCHAR)LOWORD(wParam), nBtn))\r
-               {\r
-#if (_WIN32_IE >= 0x0500)\r
-                       if((TCHAR)LOWORD(wParam) != _chChevronShortcut)\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                               ::MessageBeep(0);\r
-               }\r
-               else\r
-               {\r
-#if (_WIN32_IE >= 0x0500)\r
-                       RECT rcClient = { 0 };\r
-                       GetClientRect(&rcClient);\r
-                       RECT rcBtn = { 0 };\r
-                       GetItemRect(nBtn, &rcBtn);\r
-                       TBBUTTON tbb = { 0 };\r
-                       GetButton(nBtn, &tbb);\r
-                       if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0 && rcBtn.right <= rcClient.right)\r
-                       {\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                               PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\r
-                               if(wParam != VK_RETURN)\r
-                                       SetHotItem(nBtn);\r
-#if (_WIN32_IE >= 0x0500)\r
-                       }\r
-                       else\r
-                       {\r
-                               ::MessageBeep(0);\r
-                               bHandled = TRUE;\r
-                       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSysKeyDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnSysKeyDown\n"));\r
-#endif\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSysKeyUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnSysKeyUp\n"));\r
-#endif\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSysChar(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnSysChar\n"));\r
-#endif\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_bAttachedMenu || (m_dwExtendedStyle & CBR_EX_TRANSPARENT))\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 0;\r
-               }\r
-\r
-               CDCHandle dc = (HDC)wParam;\r
-               RECT rect = { 0 };\r
-               GetClientRect(&rect);\r
-               dc.FillRect(&rect, COLOR_MENU);\r
-\r
-               return 1;   // don't do the default erase\r
-       }\r
-\r
-       LRESULT OnInitMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               int nIndex = GetHotItem();\r
-               SendMessage(WM_MENUSELECT, MAKEWPARAM(nIndex, MF_POPUP|MF_HILITE), (LPARAM)m_hMenu);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if((BOOL)HIWORD(lParam))   // System menu, do nothing\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               if(!(m_bAttachedMenu || m_bMenuActive))   // Not attached or ours, do nothing\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnInitMenuPopup\n"));\r
-#endif\r
-               // forward to the parent or subclassed window, so it can handle update UI\r
-               LRESULT lRet = 0;\r
-               if(m_bAttachedMenu)\r
-                       lRet = DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : GetHotItem());\r
-               else\r
-                       lRet = m_wndParent.DefWindowProc(uMsg, wParam, (lParam || m_bContextMenu) ? lParam : GetHotItem());\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               // If Vista menus are active, just set bitmaps and return\r
-               if(m_bVistaMenus)\r
-               {\r
-                       CMenuHandle menu = (HMENU)wParam;\r
-                       ATLASSERT(menu.m_hMenu != NULL);\r
-\r
-                       for(int i = 0; i < menu.GetMenuItemCount(); i++)\r
-                       {\r
-                               WORD nID = (WORD)menu.GetMenuItemID(i);\r
-                               int nIndex = m_arrCommand.Find(nID);\r
-\r
-                               CMenuItemInfo mii;\r
-                               mii.fMask = MIIM_BITMAP;\r
-                               mii.hbmpItem = (m_bImagesVisible && (nIndex != -1)) ? m_arrVistaBitmap[nIndex] : NULL;\r
-                               menu.SetMenuItemInfo(i, TRUE, &mii);\r
-                       }\r
-\r
-                       return lRet;\r
-               }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-               // Convert menu items to ownerdraw, add our data\r
-               if(m_bImagesVisible)\r
-               {\r
-                       CMenuHandle menuPopup = (HMENU)wParam;\r
-                       ATLASSERT(menuPopup.m_hMenu != NULL);\r
-\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT;   // avoid level 4 warning\r
-                       TCHAR szString[pT->_nMaxMenuItemTextLength];\r
-                       BOOL bRet = FALSE;\r
-                       for(int i = 0; i < menuPopup.GetMenuItemCount(); i++)\r
-                       {\r
-                               CMenuItemInfo mii;\r
-                               mii.cch = pT->_nMaxMenuItemTextLength;\r
-                               mii.fMask = MIIM_CHECKMARKS | MIIM_DATA | MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE;\r
-                               mii.dwTypeData = szString;\r
-                               bRet = menuPopup.GetMenuItemInfo(i, TRUE, &mii);\r
-                               ATLASSERT(bRet);\r
-\r
-                               if(!(mii.fType & MFT_OWNERDRAW))   // Not already an ownerdraw item\r
-                               {\r
-                                       mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;\r
-                                       _MenuItemData* pMI = NULL;\r
-                                       ATLTRY(pMI = new _MenuItemData);\r
-                                       ATLASSERT(pMI != NULL);\r
-                                       if(pMI != NULL)\r
-                                       {\r
-                                               pMI->fType = mii.fType;\r
-                                               pMI->fState = mii.fState;\r
-                                               mii.fType |= MFT_OWNERDRAW;\r
-                                               pMI->iButton = -1;\r
-                                               for(int j = 0; j < m_arrCommand.GetSize(); j++)\r
-                                               {\r
-                                                       if(m_arrCommand[j] == mii.wID)\r
-                                                       {\r
-                                                               pMI->iButton = j;\r
-                                                               break;\r
-                                                       }\r
-                                               }\r
-                                               int cchLen = lstrlen(szString) + 1;\r
-                                               pMI->lpstrText = NULL;\r
-                                               ATLTRY(pMI->lpstrText = new TCHAR[cchLen]);\r
-                                               ATLASSERT(pMI->lpstrText != NULL);\r
-                                               if(pMI->lpstrText != NULL)\r
-                                                       SecureHelper::strcpy_x(pMI->lpstrText, cchLen, szString);\r
-                                               mii.dwItemData = (ULONG_PTR)pMI;\r
-                                               bRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);\r
-                                               ATLASSERT(bRet);\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       // Add it to the list\r
-                       m_stackMenuHandle.Push(menuPopup.m_hMenu);\r
-               }\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(!m_bAttachedMenu)   // Not attached, do nothing, forward to parent\r
-               {\r
-                       m_bPopupItem = (lParam != NULL) && ((HMENU)lParam != m_hMenu) && (HIWORD(wParam) & MF_POPUP);\r
-                       if(m_wndParent.IsWindow())\r
-                               m_wndParent.SendMessage(uMsg, wParam, lParam);\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               // Check if a menu is closing, do a cleanup\r
-               if(HIWORD(wParam) == 0xFFFF && lParam == NULL)   // Menu closing\r
-               {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnMenuSelect - CLOSING!!!!\n"));\r
-#endif\r
-                       ATLASSERT(m_stackMenuWnd.GetSize() == 0);\r
-                       // Restore the menu items to the previous state for all menus that were converted\r
-                       if(m_bImagesVisible)\r
-                       {\r
-                               HMENU hMenu = NULL;\r
-                               while((hMenu = m_stackMenuHandle.Pop()) != NULL)\r
-                               {\r
-                                       CMenuHandle menuPopup = hMenu;\r
-                                       ATLASSERT(menuPopup.m_hMenu != NULL);\r
-                                       // Restore state and delete menu item data\r
-                                       BOOL bRet = FALSE;\r
-                                       for(int i = 0; i < menuPopup.GetMenuItemCount(); i++)\r
-                                       {\r
-                                               CMenuItemInfo mii;\r
-                                               mii.fMask = MIIM_DATA | MIIM_TYPE;\r
-                                               bRet = menuPopup.GetMenuItemInfo(i, TRUE, &mii);\r
-                                               ATLASSERT(bRet);\r
-\r
-                                               _MenuItemData* pMI = (_MenuItemData*)mii.dwItemData;\r
-                                               if(pMI != NULL && pMI->IsCmdBarMenuItem())\r
-                                               {\r
-                                                       mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;\r
-                                                       mii.fType = pMI->fType;\r
-                                                       mii.dwTypeData = pMI->lpstrText;\r
-                                                       mii.cch = lstrlen(pMI->lpstrText);\r
-                                                       mii.dwItemData = NULL;\r
-\r
-                                                       bRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);\r
-                                                       ATLASSERT(bRet);\r
-\r
-                                                       delete [] pMI->lpstrText;\r
-                                                       pMI->dwMagic = 0x6666;\r
-                                                       delete pMI;\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnInternalAutoPopup(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               int nIndex = (int)wParam;\r
-               T* pT = static_cast<T*>(this);\r
-               pT->DoPopupMenu(nIndex, false);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnInternalGetBar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               // Let's make sure we're not embedded in another process\r
-               if((LPVOID)wParam != NULL)\r
-                       *((DWORD*)wParam) = GetCurrentProcessId();\r
-               if(IsWindowVisible())\r
-                       return (LRESULT)static_cast<CCommandBarCtrlBase*>(this);\r
-               else\r
-                       return NULL;\r
-       }\r
-\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-#ifndef SPI_GETKEYBOARDCUES\r
-               const UINT SPI_SETKEYBOARDCUES = 0x100B;\r
-#endif // !SPI_GETKEYBOARDCUES\r
-#ifndef SPI_GETFLATMENU\r
-               const UINT SPI_SETFLATMENU = 0x1023;\r
-#endif // !SPI_GETFLATMENU\r
-\r
-               if(wParam == SPI_SETNONCLIENTMETRICS || wParam == SPI_SETKEYBOARDCUES || wParam == SPI_SETFLATMENU)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->GetSystemSettings();\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-\r
-               LPWINDOWPOS lpWP = (LPWINDOWPOS)lParam;\r
-               int cyMin = ::GetSystemMetrics(SM_CYMENU);\r
-               if(lpWP->cy < cyMin)\r
-               lpWP->cy = cyMin;\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnMenuChar(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - OnMenuChar\n"));\r
-#endif\r
-               bHandled = TRUE;\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               LRESULT lRet;\r
-               if(m_bMenuActive && LOWORD(wParam) != 0x0D)\r
-                       lRet = 0;\r
-               else\r
-                       lRet = MAKELRESULT(1, 1);\r
-\r
-               if(m_bMenuActive && HIWORD(wParam) == MF_POPUP)\r
-               {\r
-                       // Convert character to lower/uppercase and possibly Unicode, using current keyboard layout\r
-                       TCHAR ch = (TCHAR)LOWORD(wParam);\r
-                       CMenuHandle menu = (HMENU)lParam;\r
-                       int nCount = ::GetMenuItemCount(menu);\r
-                       int nRetCode = MNC_EXECUTE;\r
-                       BOOL bRet = FALSE;\r
-                       TCHAR szString[pT->_nMaxMenuItemTextLength];\r
-                       WORD wMnem = 0;\r
-                       bool bFound = false;\r
-                       for(int i = 0; i < nCount; i++)\r
-                       {\r
-                               CMenuItemInfo mii;\r
-                               mii.cch = pT->_nMaxMenuItemTextLength;\r
-                               mii.fMask = MIIM_CHECKMARKS | MIIM_DATA | MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE;\r
-                               mii.dwTypeData = szString;\r
-                               bRet = menu.GetMenuItemInfo(i, TRUE, &mii);\r
-                               if(!bRet || (mii.fType & MFT_SEPARATOR))\r
-                                       continue;\r
-                               _MenuItemData* pmd = (_MenuItemData*)mii.dwItemData;\r
-                               if(pmd != NULL && pmd->IsCmdBarMenuItem())\r
-                               {\r
-                                       LPTSTR p = pmd->lpstrText;\r
-\r
-                                       if(p != NULL)\r
-                                       {\r
-                                               while(*p && *p != _T('&'))\r
-                                                       p = ::CharNext(p);\r
-                                               if(p != NULL && *p)\r
-                                               {\r
-                                                       DWORD dwP = MAKELONG(*(++p), 0);\r
-                                                       DWORD dwC = MAKELONG(ch, 0);\r
-                                                       if(::CharLower((LPTSTR)ULongToPtr(dwP)) == ::CharLower((LPTSTR)ULongToPtr(dwC)))\r
-                                                       {\r
-                                                               if(!bFound)\r
-                                                               {\r
-                                                                       wMnem = (WORD)i;\r
-                                                                       bFound = true;\r
-                                                               }\r
-                                                               else\r
-                                                               {\r
-                                                                       nRetCode = MNC_SELECT;\r
-                                                                       break;\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-                       if(bFound)\r
-                       {\r
-                               if(nRetCode == MNC_EXECUTE)\r
-                               {\r
-                                       PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\r
-                                       pT->GiveFocusBack();\r
-                               }\r
-                               bHandled = TRUE;\r
-                               lRet = MAKELRESULT(wMnem, nRetCode);\r
-                       }\r
-               } \r
-               else if(!m_bMenuActive)\r
-               {\r
-                       int nBtn = 0;\r
-                       if(!MapAccelerator((TCHAR)LOWORD(wParam), nBtn))\r
-                       {\r
-                               bHandled = FALSE;\r
-                               PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\r
-                               pT->GiveFocusBack();\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-                               // check if we should display chevron menu\r
-                               if((TCHAR)LOWORD(wParam) == pT->_chChevronShortcut)\r
-                               {\r
-                                       if(pT->DisplayChevronMenu())\r
-                                               bHandled = TRUE;\r
-                               }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                       }\r
-                       else if(m_wndParent.IsWindowEnabled())\r
-                       {\r
-#if (_WIN32_IE >= 0x0500)\r
-                               RECT rcClient = { 0 };\r
-                               GetClientRect(&rcClient);\r
-                               RECT rcBtn = { 0 };\r
-                               GetItemRect(nBtn, &rcBtn);\r
-                               TBBUTTON tbb = { 0 };\r
-                               GetButton(nBtn, &tbb);\r
-                               if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0 && rcBtn.right <= rcClient.right)\r
-                               {\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                                       if(m_bUseKeyboardCues && !m_bShowKeyboardCues)\r
-                                       {\r
-                                               m_bAllowKeyboardCues = true;\r
-                                               ShowKeyboardCues(true);\r
-                                       }\r
-                                       pT->TakeFocus();\r
-                                       PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\r
-                                       SetHotItem(nBtn);\r
-#if (_WIN32_IE >= 0x0500)\r
-                               }\r
-                               else\r
-                               {\r
-                                       ::MessageBeep(0);\r
-                               }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                       }\r
-               }\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnDrawItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               LPDRAWITEMSTRUCT lpDrawItemStruct = (LPDRAWITEMSTRUCT)lParam;\r
-               _MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;\r
-               if(lpDrawItemStruct->CtlType == ODT_MENU && pmd != NULL && pmd->IsCmdBarMenuItem())\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->DrawItem(lpDrawItemStruct);\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-               return (LRESULT)TRUE;\r
-       }\r
-\r
-       LRESULT OnMeasureItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               LPMEASUREITEMSTRUCT lpMeasureItemStruct = (LPMEASUREITEMSTRUCT)lParam;\r
-               _MenuItemData* pmd = (_MenuItemData*)lpMeasureItemStruct->itemData;\r
-               if(lpMeasureItemStruct->CtlType == ODT_MENU && pmd != NULL && pmd->IsCmdBarMenuItem())\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->MeasureItem(lpMeasureItemStruct);\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-               return (LRESULT)TRUE;\r
-       }\r
-\r
-// API message handlers\r
-       LRESULT OnAPIGetMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return (LRESULT)m_hMenu;\r
-       }\r
-\r
-       LRESULT OnAPITrackPopupMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               if(lParam == NULL)\r
-                       return FALSE;\r
-               LPCBRPOPUPMENU lpCBRPopupMenu = (LPCBRPOPUPMENU)lParam;\r
-               if(lpCBRPopupMenu->cbSize != sizeof(CBRPOPUPMENU))\r
-                       return FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               return pT->TrackPopupMenu(lpCBRPopupMenu->hMenu, lpCBRPopupMenu->uFlags, lpCBRPopupMenu->x, lpCBRPopupMenu->y, lpCBRPopupMenu->lptpm);\r
-       }\r
-\r
-       LRESULT OnAPIGetCmdBar(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return (LRESULT)m_hWnd;\r
-       }\r
-\r
-// Parent window message handlers\r
-       LRESULT OnParentHotItemChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               LPNMTBHOTITEM lpNMHT = (LPNMTBHOTITEM)pnmh;\r
-\r
-               // Check if this comes from us\r
-               if(pnmh->hwndFrom != m_hWnd)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 0;\r
-               }\r
-\r
-               bool bBlockTracking = false;\r
-               if((m_dwExtendedStyle & CBR_EX_TRACKALWAYS) == 0)\r
-               {\r
-                       DWORD dwProcessID;\r
-                       ::GetWindowThreadProcessId(::GetActiveWindow(), &dwProcessID);\r
-                       bBlockTracking = (::GetCurrentProcessId() != dwProcessID);\r
-               }\r
-\r
-               if((!m_wndParent.IsWindowEnabled() || bBlockTracking) && (lpNMHT->dwFlags & HICF_MOUSE))\r
-               {\r
-                       return 1;\r
-               }\r
-               else\r
-               {\r
-#ifndef HICF_LMOUSE\r
-                       const DWORD HICF_LMOUSE = 0x00000080;   // left mouse button selected\r
-#endif\r
-                       bHandled = FALSE;\r
-\r
-                       // Send WM_MENUSELECT to the app if it needs to display a status text\r
-                       if(!(lpNMHT->dwFlags & HICF_MOUSE)\r
-                               && !(lpNMHT->dwFlags & HICF_ACCELERATOR)\r
-                               && !(lpNMHT->dwFlags & HICF_LMOUSE))\r
-                       {\r
-                               if(lpNMHT->dwFlags & HICF_ENTERING)\r
-                                       m_wndParent.SendMessage(WM_MENUSELECT, 0, (LPARAM)m_hMenu);\r
-                               if(lpNMHT->dwFlags & HICF_LEAVING)\r
-                                       m_wndParent.SendMessage(WM_MENUSELECT, MAKEWPARAM(0, 0xFFFF), NULL);\r
-                       }\r
-\r
-                       return 0;\r
-               }\r
-       }\r
-\r
-       LRESULT OnParentDropDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               // Check if this comes from us\r
-               if(pnmh->hwndFrom != m_hWnd)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(::GetFocus() != m_hWnd)\r
-                       pT->TakeFocus();\r
-               LPNMTOOLBAR pNMToolBar = (LPNMTOOLBAR)pnmh;\r
-               int nIndex = CommandToIndex(pNMToolBar->iItem);\r
-               m_bContextMenu = false;\r
-               m_bEscapePressed = false;\r
-               pT->DoPopupMenu(nIndex, true);\r
-\r
-               return TBDDRET_DEFAULT;\r
-       }\r
-\r
-       LRESULT OnParentInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnInitMenuPopup(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentInternalGetBar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnInternalGetBar(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentSysCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-               if((m_uSysKey == VK_MENU \r
-                       || (m_uSysKey == VK_F10 && !(::GetKeyState(VK_SHIFT) & 0x80))\r
-                       || m_uSysKey == VK_SPACE) \r
-                       && wParam == SC_KEYMENU)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       if(::GetFocus() == m_hWnd)\r
-                       {\r
-                               pT->GiveFocusBack();   // exit menu "loop"\r
-                               PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\r
-                       }\r
-                       else if(m_uSysKey != VK_SPACE && !m_bSkipMsg)\r
-                       {\r
-                               if(m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)\r
-                                       ShowKeyboardCues(true);\r
-\r
-                               pT->TakeFocus();      // enter menu "loop"\r
-                               bHandled = TRUE;\r
-                       }\r
-                       else if(m_uSysKey != VK_SPACE)\r
-                       {\r
-                               bHandled = TRUE;\r
-                       }\r
-               }\r
-               m_bSkipMsg = false;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnParentAPIGetMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnAPIGetMenu(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentMenuChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnMenuChar(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentAPITrackPopupMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnAPITrackPopupMenu(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentAPIGetCmdBar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnAPIGetCmdBar(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentSettingChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               OnSettingChange(uMsg, wParam, lParam, bHandled);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnParentDrawItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnDrawItem(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               return OnMeasureItem(uMsg, wParam, lParam, bHandled);\r
-       }\r
-\r
-       LRESULT OnParentActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               m_bParentActive = (LOWORD(wParam) != WA_INACTIVE);\r
-               if(!m_bParentActive && m_bUseKeyboardCues && m_bShowKeyboardCues)\r
-               {\r
-                       ShowKeyboardCues(false);   // this will repaint our window\r
-               }\r
-               else\r
-               {\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnParentCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               LRESULT lRet = CDRF_DODEFAULT;\r
-               bHandled = FALSE;\r
-               if(pnmh->hwndFrom == m_hWnd)\r
-               {\r
-                       LPNMTBCUSTOMDRAW lpTBCustomDraw = (LPNMTBCUSTOMDRAW)pnmh;\r
-                       if(lpTBCustomDraw->nmcd.dwDrawStage == CDDS_PREPAINT)\r
-                       {\r
-                               lRet = CDRF_NOTIFYITEMDRAW;\r
-                               bHandled = TRUE;\r
-                       }\r
-                       else if(lpTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)\r
-                       {\r
-                               if(m_bFlatMenus)\r
-                               {\r
-#ifndef COLOR_MENUHILIGHT\r
-                                       const int COLOR_MENUHILIGHT = 29;\r
-#endif // !COLOR_MENUHILIGHT\r
-                                       bool bDisabled = ((lpTBCustomDraw->nmcd.uItemState & CDIS_DISABLED) == CDIS_DISABLED);\r
-                                       if(!bDisabled && ((lpTBCustomDraw->nmcd.uItemState & CDIS_HOT) == CDIS_HOT || \r
-                                               (lpTBCustomDraw->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED))\r
-                                       {\r
-                                               ::FillRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_MENUHILIGHT));\r
-                                               ::FrameRect(lpTBCustomDraw->nmcd.hdc, &lpTBCustomDraw->nmcd.rc, ::GetSysColorBrush(COLOR_HIGHLIGHT));\r
-                                               lpTBCustomDraw->clrText = ::GetSysColor(m_bParentActive ? COLOR_HIGHLIGHTTEXT : COLOR_GRAYTEXT);\r
-                                       }\r
-                                       else if(bDisabled || !m_bParentActive)\r
-                                       {\r
-                                               lpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);\r
-                                       }\r
-                                       CDCHandle dc = lpTBCustomDraw->nmcd.hdc;\r
-                                       dc.SetTextColor(lpTBCustomDraw->clrText);\r
-                                       dc.SetBkMode(lpTBCustomDraw->nStringBkMode);\r
-                                       HFONT hFont = GetFont();\r
-                                       HFONT hFontOld = NULL;\r
-                                       if(hFont != NULL)\r
-                                               hFontOld = dc.SelectFont(hFont);\r
-                                       const int cchText = 200;\r
-                                       TCHAR szText[cchText] = { 0 };\r
-                                       TBBUTTONINFO tbbi = { 0 };\r
-                                       tbbi.cbSize = sizeof(TBBUTTONINFO);\r
-                                       tbbi.dwMask = TBIF_TEXT;\r
-                                       tbbi.pszText = szText;\r
-                                       tbbi.cchText = cchText;\r
-                                       GetButtonInfo((int)lpTBCustomDraw->nmcd.dwItemSpec, &tbbi);\r
-                                       dc.DrawText(szText, -1, &lpTBCustomDraw->nmcd.rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));\r
-                                       if(hFont != NULL)\r
-                                               dc.SelectFont(hFontOld);\r
-                                       lRet = CDRF_SKIPDEFAULT;\r
-                                       bHandled = TRUE;\r
-                               }\r
-                               else if(!m_bParentActive)\r
-                               {\r
-                                       lpTBCustomDraw->clrText = ::GetSysColor(COLOR_GRAYTEXT);\r
-                                       bHandled = TRUE;\r
-                               }\r
-                       }\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-// Message hook handlers\r
-       LRESULT OnHookMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               static POINT s_point = { -1, -1 };\r
-               DWORD dwPoint = ::GetMessagePos();\r
-               POINT point = { GET_X_LPARAM(dwPoint), GET_Y_LPARAM(dwPoint) };\r
-\r
-               bHandled = FALSE;\r
-               if(m_bMenuActive)\r
-               {\r
-                       if(::WindowFromPoint(point) == m_hWnd)\r
-                       {\r
-                               ScreenToClient(&point);\r
-                               int nHit = HitTest(&point);\r
-\r
-                               if((point.x != s_point.x || point.y != s_point.y) && nHit >= 0 && nHit < ::GetMenuItemCount(m_hMenu) && nHit != m_nPopBtn && m_nPopBtn != -1)\r
-                               {\r
-                                       TBBUTTON tbb = { 0 };\r
-                                       GetButton(nHit, &tbb);\r
-                                       if((tbb.fsState & TBSTATE_ENABLED) != 0)\r
-                                       {\r
-                                               m_nNextPopBtn = nHit | 0xFFFF0000;\r
-                                               HWND hWndMenu = m_stackMenuWnd.GetCurrent();\r
-                                               ATLASSERT(hWndMenu != NULL);\r
-\r
-                                               // this one is needed to close a menu if mouse button was down\r
-                                               ::PostMessage(hWndMenu, WM_LBUTTONUP, 0, MAKELPARAM(point.x, point.y));\r
-                                               // this one closes a popup menu\r
-                                               ::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);\r
-\r
-                                               bHandled = TRUE;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       ScreenToClient(&point);\r
-               }\r
-\r
-               s_point = point;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnHookSysKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_SYSKEYDOWN (0x%2.2X)\n"), wParam);\r
-#endif\r
-\r
-               if(wParam == VK_MENU && m_bParentActive && m_bUseKeyboardCues && !m_bShowKeyboardCues && m_bAllowKeyboardCues)\r
-                       ShowKeyboardCues(true);\r
-\r
-               if(wParam != VK_SPACE && !m_bMenuActive && ::GetFocus() == m_hWnd)\r
-               {\r
-                       m_bAllowKeyboardCues = false;\r
-                       PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->GiveFocusBack();\r
-                       m_bSkipMsg = true;\r
-               }\r
-               else\r
-               {\r
-                       if(wParam == VK_SPACE && m_bUseKeyboardCues && m_bShowKeyboardCues)\r
-                       {\r
-                               m_bAllowKeyboardCues = true;\r
-                               ShowKeyboardCues(false);\r
-                       }\r
-                       m_uSysKey = (UINT)wParam;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnHookSysKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(!m_bAllowKeyboardCues)\r
-                       m_bAllowKeyboardCues = true;\r
-               bHandled = FALSE;\r
-               wParam;\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_SYSKEYUP (0x%2.2X)\n"), wParam);\r
-#endif\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnHookSysChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_SYSCHAR (0x%2.2X)\n"), wParam);\r
-#endif\r
-\r
-               if(!m_bMenuActive && m_hWndHook != m_hWnd && wParam != VK_SPACE)\r
-                       bHandled = TRUE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnHookKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_KEYDOWN (0x%2.2X)\n"), wParam);\r
-#endif\r
-               bHandled = FALSE;\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               if(wParam == VK_ESCAPE && m_stackMenuWnd.GetSize() <= 1)\r
-               {\r
-                       if(m_bMenuActive && !m_bContextMenu)\r
-                       {\r
-                               int nHot = GetHotItem();\r
-                               if(nHot == -1)\r
-                                       nHot = m_nPopBtn;\r
-                               if(nHot == -1)\r
-                                       nHot = 0;\r
-                               SetHotItem(nHot);\r
-                               bHandled = TRUE;\r
-                               pT->TakeFocus();\r
-                               m_bEscapePressed = true; // To keep focus\r
-                               m_bSkipPostDown = false;\r
-                       }\r
-                       else if(::GetFocus() == m_hWnd && m_wndParent.IsWindow())\r
-                       {\r
-                               SetHotItem(-1);\r
-                               pT->GiveFocusBack();\r
-                               bHandled = TRUE;\r
-                       }\r
-               }\r
-               else if(wParam == VK_RETURN || wParam == VK_UP || wParam == VK_DOWN)\r
-               {\r
-                       if(!m_bMenuActive && ::GetFocus() == m_hWnd && m_wndParent.IsWindow())\r
-                       {\r
-                               int nHot = GetHotItem();\r
-                               if(nHot != -1)\r
-                               {\r
-                                       if(wParam != VK_RETURN)\r
-                                       {\r
-                                               if(!m_bSkipPostDown)\r
-                                               {\r
-// IE4 only: WM_KEYDOWN doesn't generate TBN_DROPDOWN, we need to simulate a mouse click\r
-#if (_WIN32_IE < 0x0500)\r
-                                                       DWORD dwMajor = 0, dwMinor = 0;\r
-                                                       ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);\r
-                                                       if(dwMajor <= 4 || (dwMajor == 5 && dwMinor < 80))\r
-                                                       {\r
-                                                               RECT rect;\r
-                                                               GetItemRect(nHot, &rect);\r
-                                                               PostMessage(WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(rect.left, rect.top));\r
-                                                       }\r
-#endif // (_WIN32_IE < 0x0500)\r
-                                                       PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\r
-                                                       m_bSkipPostDown = true;\r
-                                               }\r
-                                               else\r
-                                               {\r
-                                                       ATLTRACE2(atlTraceUI, 0, _T("CmdBar - skipping posting another VK_DOWN\n"));\r
-                                                       m_bSkipPostDown = false;\r
-                                               }\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Can't find hot button\n"));\r
-                               }\r
-                       }\r
-                       if(wParam == VK_RETURN && m_bMenuActive)\r
-                       {\r
-                               PostMessage(TB_SETHOTITEM, (WPARAM)-1, 0L);\r
-                               m_nNextPopBtn = -1;\r
-                               pT->GiveFocusBack();\r
-                       }\r
-               }\r
-               else if(wParam == VK_LEFT || wParam == VK_RIGHT)\r
-               {\r
-                       WPARAM wpNext = m_bLayoutRTL ? VK_LEFT : VK_RIGHT;\r
-                       WPARAM wpPrev = m_bLayoutRTL ? VK_RIGHT : VK_LEFT;\r
-\r
-                       if(m_bMenuActive && !m_bContextMenu && !(wParam == wpNext && m_bPopupItem))\r
-                       {\r
-                               bool bAction = false;\r
-                               if(wParam == wpPrev && s_pCurrentBar->m_stackMenuWnd.GetSize() == 1)\r
-                               {\r
-                                       m_nNextPopBtn = pT->GetPreviousMenuItem(m_nPopBtn);\r
-                                       if(m_nNextPopBtn != -1)\r
-                                               bAction = true;\r
-                               }\r
-                               else if(wParam == wpNext)\r
-                               {\r
-                                       m_nNextPopBtn = pT->GetNextMenuItem(m_nPopBtn);\r
-                                       if(m_nNextPopBtn != -1)\r
-                                               bAction = true;\r
-                               }\r
-                               HWND hWndMenu = m_stackMenuWnd.GetCurrent();\r
-                               ATLASSERT(hWndMenu != NULL);\r
-\r
-                               // Close the popup menu\r
-                               if(bAction)\r
-                               {\r
-                                       ::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);\r
-                                       if(wParam == wpNext)\r
-                                       {\r
-                                               int cItem = m_stackMenuWnd.GetSize() - 1;\r
-                                               while(cItem >= 0)\r
-                                               {\r
-                                                       hWndMenu = m_stackMenuWnd[cItem];\r
-                                                       if(hWndMenu != NULL)\r
-                                                               ::PostMessage(hWndMenu, WM_KEYDOWN, VK_ESCAPE, 0L);\r
-                                                       cItem--;\r
-                                               }\r
-                                       }\r
-#if (_WIN32_IE >= 0x0500)\r
-                                       if(m_nNextPopBtn == -2)\r
-                                       {\r
-                                               m_nNextPopBtn = -1;\r
-                                               pT->DisplayChevronMenu();\r
-                                       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                                       bHandled = TRUE;\r
-                               }\r
-                       }\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnHookNextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_NEXTMENU\n"));\r
-#endif\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnHookChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook WM_CHAR (0x%2.2X)\n"), wParam);\r
-#endif\r
-               bHandled = (wParam == VK_ESCAPE);\r
-               return 0;\r
-       }\r
-\r
-// Implementation - ownerdraw overrideables and helpers\r
-       void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if(m_bFlatMenus)\r
-                       pT->DrawItemFlat(lpDrawItemStruct);\r
-               else\r
-                       pT->DrawItem3D(lpDrawItemStruct);\r
-\r
-       }\r
-\r
-       void DrawItem3D(LPDRAWITEMSTRUCT lpDrawItemStruct)\r
-       {\r
-               _MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;\r
-               CDCHandle dc = lpDrawItemStruct->hDC;\r
-               const RECT& rcItem = lpDrawItemStruct->rcItem;\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               if(pmd->fType & MFT_SEPARATOR)\r
-               {\r
-                       // draw separator\r
-                       RECT rc = rcItem;\r
-                       rc.top += (rc.bottom - rc.top) / 2;      // vertical center\r
-                       dc.DrawEdge(&rc, EDGE_ETCHED, BF_TOP);   // draw separator line\r
-               }\r
-               else            // not a separator\r
-               {\r
-                       BOOL bDisabled = lpDrawItemStruct->itemState & ODS_GRAYED;\r
-                       BOOL bSelected = lpDrawItemStruct->itemState & ODS_SELECTED;\r
-                       BOOL bChecked = lpDrawItemStruct->itemState & ODS_CHECKED;\r
-                       BOOL bHasImage = FALSE;\r
-\r
-                       if(LOWORD(lpDrawItemStruct->itemID) == (WORD)-1)\r
-                               bSelected = FALSE;\r
-                       RECT rcButn = { rcItem.left, rcItem.top, rcItem.left + m_szButton.cx, rcItem.top + m_szButton.cy };   // button rect\r
-                       ::OffsetRect(&rcButn, 0, ((rcItem.bottom - rcItem.top) - (rcButn.bottom - rcButn.top)) / 2);          // center vertically\r
-\r
-                       int iButton = pmd->iButton;\r
-                       if(iButton >= 0)\r
-                       {\r
-                               bHasImage = TRUE;\r
-\r
-                               // calc drawing point\r
-                               SIZE sz = { rcButn.right - rcButn.left - m_szBitmap.cx, rcButn.bottom - rcButn.top - m_szBitmap.cy };\r
-                               sz.cx /= 2;\r
-                               sz.cy /= 2;\r
-                               POINT point = { rcButn.left + sz.cx, rcButn.top + sz.cy };\r
-\r
-                               // fill background depending on state\r
-                               if(!bChecked || (bSelected && !bDisabled))\r
-                               {\r
-                                       if(!bDisabled)\r
-                                               dc.FillRect(&rcButn, (bChecked && !bSelected) ? COLOR_3DLIGHT : COLOR_MENU);\r
-                                       else\r
-                                               dc.FillRect(&rcButn, COLOR_MENU);\r
-                               }\r
-                               else\r
-                               {\r
-                                       COLORREF crTxt = dc.SetTextColor(::GetSysColor(COLOR_BTNFACE));\r
-                                       COLORREF crBk = dc.SetBkColor(::GetSysColor(COLOR_BTNHILIGHT));\r
-                                       CBrush hbr(CDCHandle::GetHalftoneBrush());\r
-                                       dc.SetBrushOrg(rcButn.left, rcButn.top);\r
-                                       dc.FillRect(&rcButn, hbr);\r
-                                       dc.SetTextColor(crTxt);\r
-                                       dc.SetBkColor(crBk);\r
-                               }\r
-\r
-                               // draw disabled or normal\r
-                               if(!bDisabled)\r
-                               {\r
-                                       // draw pushed-in or popped-out edge\r
-                                       if(bSelected || bChecked)\r
-                                       {\r
-                                               RECT rc2 = rcButn;\r
-                                               dc.DrawEdge(&rc2, bChecked ? BDR_SUNKENOUTER : BDR_RAISEDINNER, BF_RECT);\r
-                                       }\r
-                                       // draw the image\r
-                                       ::ImageList_Draw(m_hImageList, iButton, dc, point.x, point.y, ILD_TRANSPARENT);\r
-                               }\r
-                               else\r
-                               {\r
-                                       HBRUSH hBrushBackground = bChecked ? NULL : ::GetSysColorBrush(COLOR_MENU);\r
-                                       pT->DrawBitmapDisabled(dc, iButton, point, hBrushBackground);\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               // no image - look for custom checked/unchecked bitmaps\r
-                               CMenuItemInfo info;\r
-                               info.fMask = MIIM_CHECKMARKS | MIIM_TYPE;\r
-                               ::GetMenuItemInfo((HMENU)lpDrawItemStruct->hwndItem, lpDrawItemStruct->itemID, MF_BYCOMMAND, &info);\r
-                               if(bChecked || info.hbmpUnchecked != NULL)\r
-                               {\r
-                                       BOOL bRadio = ((info.fType & MFT_RADIOCHECK) != 0);\r
-                                       bHasImage = pT->DrawCheckmark(dc, rcButn, bSelected, bDisabled, bRadio, bChecked ? info.hbmpChecked : info.hbmpUnchecked);\r
-                               }\r
-                       }\r
-\r
-                       // draw item text\r
-                       int cxButn = m_szButton.cx;\r
-                       COLORREF colorBG = ::GetSysColor(bSelected ? COLOR_HIGHLIGHT : COLOR_MENU);\r
-                       if(bSelected || lpDrawItemStruct->itemAction == ODA_SELECT)\r
-                       {\r
-                               RECT rcBG = rcItem;\r
-                               if(bHasImage)\r
-                                       rcBG.left += cxButn + s_kcxGap;\r
-                               dc.FillRect(&rcBG, bSelected ? COLOR_HIGHLIGHT : COLOR_MENU);\r
-                       }\r
-\r
-                       // calc text rectangle and colors\r
-                       RECT rcText = rcItem;\r
-                       rcText.left += cxButn + s_kcxGap + s_kcxTextMargin;\r
-                       rcText.right -= cxButn;\r
-                       dc.SetBkMode(TRANSPARENT);\r
-                       COLORREF colorText = ::GetSysColor(bDisabled ?  (bSelected ? COLOR_GRAYTEXT : COLOR_3DSHADOW) : (bSelected ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT));\r
-\r
-                       // font already selected by Windows\r
-                       if(bDisabled && (!bSelected || colorText == colorBG))\r
-                       {\r
-                               // disabled - draw shadow text shifted down and right 1 pixel (unles selected)\r
-                               RECT rcDisabled = rcText;\r
-                               ::OffsetRect(&rcDisabled, 1, 1);\r
-                               pT->DrawMenuText(dc, rcDisabled, pmd->lpstrText, ::GetSysColor(COLOR_3DHILIGHT));\r
-                       }\r
-                       pT->DrawMenuText(dc, rcText, pmd->lpstrText, colorText); // finally!\r
-               }\r
-       }\r
-\r
-       void DrawItemFlat(LPDRAWITEMSTRUCT lpDrawItemStruct)\r
-       {\r
-               _MenuItemData* pmd = (_MenuItemData*)lpDrawItemStruct->itemData;\r
-               CDCHandle dc = lpDrawItemStruct->hDC;\r
-               const RECT& rcItem = lpDrawItemStruct->rcItem;\r
-               T* pT = static_cast<T*>(this);\r
-\r
-#ifndef COLOR_MENUHILIGHT\r
-               const int COLOR_MENUHILIGHT = 29;\r
-#endif // !COLOR_MENUHILIGHT\r
-\r
-               BOOL bDisabled = lpDrawItemStruct->itemState & ODS_GRAYED;\r
-               BOOL bSelected = lpDrawItemStruct->itemState & ODS_SELECTED;\r
-               BOOL bChecked = lpDrawItemStruct->itemState & ODS_CHECKED;\r
-\r
-               // paint background\r
-               if(bSelected || lpDrawItemStruct->itemAction == ODA_SELECT)\r
-               {\r
-                       if(bSelected)\r
-                       {\r
-                               dc.FillRect(&rcItem, ::GetSysColorBrush(COLOR_MENUHILIGHT));\r
-                               dc.FrameRect(&rcItem, ::GetSysColorBrush(COLOR_HIGHLIGHT));\r
-                       }\r
-                       else\r
-                       {\r
-                               dc.FillRect(&rcItem, ::GetSysColorBrush(COLOR_MENU));\r
-                       }\r
-               }\r
-\r
-               if(pmd->fType & MFT_SEPARATOR)\r
-               {\r
-                       // draw separator\r
-                       RECT rc = rcItem;\r
-                       rc.top += (rc.bottom - rc.top) / 2;      // vertical center\r
-                       dc.DrawEdge(&rc, EDGE_ETCHED, BF_TOP);   // draw separator line\r
-               }\r
-               else            // not a separator\r
-               {\r
-                       if(LOWORD(lpDrawItemStruct->itemID) == (WORD)-1)\r
-                               bSelected = FALSE;\r
-                       RECT rcButn = { rcItem.left, rcItem.top, rcItem.left + m_szButton.cx, rcItem.top + m_szButton.cy };   // button rect\r
-                       ::OffsetRect(&rcButn, 0, ((rcItem.bottom - rcItem.top) - (rcButn.bottom - rcButn.top)) / 2);          // center vertically\r
-\r
-                       // draw background and border for checked items\r
-                       if(bChecked)\r
-                       {\r
-                               RECT rcCheck = rcButn;\r
-                               ::InflateRect(&rcCheck, -1, -1);\r
-                               if(bSelected)\r
-                                       dc.FillRect(&rcCheck, ::GetSysColorBrush(COLOR_MENU));\r
-                               dc.FrameRect(&rcCheck, ::GetSysColorBrush(COLOR_HIGHLIGHT));\r
-                       }\r
-\r
-                       int iButton = pmd->iButton;\r
-                       if(iButton >= 0)\r
-                       {\r
-                               // calc drawing point\r
-                               SIZE sz = { rcButn.right - rcButn.left - m_szBitmap.cx, rcButn.bottom - rcButn.top - m_szBitmap.cy };\r
-                               sz.cx /= 2;\r
-                               sz.cy /= 2;\r
-                               POINT point = { rcButn.left + sz.cx, rcButn.top + sz.cy };\r
-\r
-                               // draw disabled or normal\r
-                               if(!bDisabled)\r
-                               {\r
-                                       ::ImageList_Draw(m_hImageList, iButton, dc, point.x, point.y, ILD_TRANSPARENT);\r
-                               }\r
-                               else\r
-                               {\r
-                                       HBRUSH hBrushBackground = ::GetSysColorBrush((bSelected && !(bDisabled && bChecked)) ? COLOR_MENUHILIGHT : COLOR_MENU);\r
-                                       HBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW);\r
-                                       pT->DrawBitmapDisabled(dc, iButton, point, hBrushBackground, hBrushBackground, hBrushDisabledImage);\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               // no image - look for custom checked/unchecked bitmaps\r
-                               CMenuItemInfo info;\r
-                               info.fMask = MIIM_CHECKMARKS | MIIM_TYPE;\r
-                               ::GetMenuItemInfo((HMENU)lpDrawItemStruct->hwndItem, lpDrawItemStruct->itemID, MF_BYCOMMAND, &info);\r
-                               if(bChecked || info.hbmpUnchecked != NULL)\r
-                               {\r
-                                       BOOL bRadio = ((info.fType & MFT_RADIOCHECK) != 0);\r
-                                       pT->DrawCheckmark(dc, rcButn, bSelected, bDisabled, bRadio, bChecked ? info.hbmpChecked : info.hbmpUnchecked);\r
-                               }\r
-                       }\r
-\r
-                       // draw item text\r
-                       int cxButn = m_szButton.cx;\r
-                       // calc text rectangle and colors\r
-                       RECT rcText = rcItem;\r
-                       rcText.left += cxButn + s_kcxGap + s_kcxTextMargin;\r
-                       rcText.right -= cxButn;\r
-                       dc.SetBkMode(TRANSPARENT);\r
-                       COLORREF colorText = ::GetSysColor(bDisabled ?  (bSelected ? COLOR_GRAYTEXT : COLOR_3DSHADOW) : (bSelected ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT));\r
-\r
-                       pT->DrawMenuText(dc, rcText, pmd->lpstrText, colorText); // finally!\r
-               }\r
-       }\r
-\r
-       void DrawMenuText(CDCHandle& dc, RECT& rc, LPCTSTR lpstrText, COLORREF color)\r
-       {\r
-               int nTab = -1;\r
-               for(int i = 0; i < lstrlen(lpstrText); i++)\r
-               {\r
-                       if(lpstrText[i] == _T('\t'))\r
-                       {\r
-                               nTab = i;\r
-                               break;\r
-                       }\r
-               }\r
-               dc.SetTextColor(color);\r
-               dc.DrawText(lpstrText, nTab, &rc, DT_SINGLELINE | DT_LEFT | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));\r
-               if(nTab != -1)\r
-                       dc.DrawText(&lpstrText[nTab + 1], -1, &rc, DT_SINGLELINE | DT_RIGHT | DT_VCENTER | (m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX));\r
-       }\r
-\r
-       void DrawBitmapDisabled(CDCHandle& dc, int nImage, POINT point,\r
-                       HBRUSH hBrushBackground = ::GetSysColorBrush(COLOR_3DFACE),\r
-                       HBRUSH hBrush3DEffect = ::GetSysColorBrush(COLOR_3DHILIGHT),\r
-                       HBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW))\r
-       {\r
-#if (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)\r
-               if(m_bAlphaImages)\r
-               {\r
-                       IMAGELISTDRAWPARAMS ildp = { 0 };\r
-                       ildp.cbSize = sizeof(IMAGELISTDRAWPARAMS);\r
-                       ildp.himl = m_hImageList;\r
-                       ildp.i = nImage;\r
-                       ildp.hdcDst = dc;\r
-                       ildp.x = point.x;\r
-                       ildp.y = point.y;\r
-                       ildp.cx = 0;\r
-                       ildp.cy = 0;\r
-                       ildp.xBitmap = 0;\r
-                       ildp.yBitmap = 0;\r
-                       ildp.fStyle = ILD_TRANSPARENT;\r
-                       ildp.fState = ILS_SATURATE;\r
-                       ildp.Frame = 0;\r
-                       ::ImageList_DrawIndirect(&ildp);\r
-               }\r
-               else\r
-#endif // (_WIN32_WINNT >= 0x0501) && (_WIN32_IE >= 0x0501)\r
-               {\r
-                       // create memory DC\r
-                       CDC dcMem;\r
-                       dcMem.CreateCompatibleDC(dc);\r
-                       // create mono or color bitmap\r
-                       CBitmap bmp;\r
-                       bmp.CreateCompatibleBitmap(dc, m_szBitmap.cx, m_szBitmap.cy);\r
-                       ATLASSERT(bmp.m_hBitmap != NULL);\r
-                       // draw image into memory DC--fill BG white first\r
-                       HBITMAP hBmpOld = dcMem.SelectBitmap(bmp);\r
-                       dcMem.PatBlt(0, 0, m_szBitmap.cx, m_szBitmap.cy, WHITENESS);\r
-                       // If white is the text color, we can't use the normal painting since\r
-                       // it would blend with the WHITENESS, but the mask is OK\r
-                       UINT uDrawStyle = (::GetSysColor(COLOR_BTNTEXT) == RGB(255, 255, 255)) ? ILD_MASK : ILD_NORMAL;\r
-                       ::ImageList_Draw(m_hImageList, nImage, dcMem, 0, 0, uDrawStyle);\r
-                       dc.DitherBlt(point.x, point.y, m_szBitmap.cx, m_szBitmap.cy, dcMem, NULL, 0, 0, hBrushBackground, hBrush3DEffect, hBrushDisabledImage);\r
-                       dcMem.SelectBitmap(hBmpOld);   // restore\r
-               }\r
-       }\r
-\r
-       // old name\r
-       BOOL Draw3DCheckmark(CDCHandle& dc, const RECT& rc, BOOL bSelected, BOOL bDisabled, BOOL bRadio, HBITMAP hBmpCheck)\r
-       {\r
-               return DrawCheckmark(dc, rc, bSelected, bDisabled, bRadio, hBmpCheck);\r
-       }\r
-\r
-       BOOL DrawCheckmark(CDCHandle& dc, const RECT& rc, BOOL bSelected, BOOL bDisabled, BOOL bRadio, HBITMAP hBmpCheck)\r
-       {\r
-               // get checkmark bitmap, if none, use Windows standard\r
-               SIZE size = { 0, 0 };\r
-               CBitmapHandle bmp = hBmpCheck;\r
-               if(hBmpCheck != NULL)\r
-               {\r
-                       bmp.GetSize(size);\r
-               }\r
-               else\r
-               {\r
-                       size.cx = ::GetSystemMetrics(SM_CXMENUCHECK); \r
-                       size.cy = ::GetSystemMetrics(SM_CYMENUCHECK); \r
-                       bmp.CreateCompatibleBitmap(dc, size.cx, size.cy);\r
-                       ATLASSERT(bmp.m_hBitmap != NULL);\r
-               }\r
-               // center bitmap in caller's rectangle\r
-               RECT rcDest = rc;\r
-               if((rc.right - rc.left) > size.cx)\r
-               {\r
-                       rcDest.left = rc.left + (rc.right - rc.left - size.cx) / 2;\r
-                       rcDest.right = rcDest.left + size.cx;\r
-               }\r
-               if((rc.bottom - rc.top) > size.cy)\r
-               {\r
-                       rcDest.top = rc.top + (rc.bottom - rc.top - size.cy) / 2;\r
-                       rcDest.bottom = rcDest.top + size.cy;\r
-               }\r
-               // paint background\r
-               if(!m_bFlatMenus)\r
-               {\r
-                       if(bSelected && !bDisabled)\r
-                       {\r
-                               dc.FillRect(&rcDest, COLOR_MENU);\r
-                       }\r
-                       else\r
-                       {\r
-                               COLORREF clrTextOld = dc.SetTextColor(::GetSysColor(COLOR_BTNFACE));\r
-                               COLORREF clrBkOld = dc.SetBkColor(::GetSysColor(COLOR_BTNHILIGHT));\r
-                               CBrush hbr(CDCHandle::GetHalftoneBrush());\r
-                               dc.SetBrushOrg(rcDest.left, rcDest.top);\r
-                               dc.FillRect(&rcDest, hbr);\r
-                               dc.SetTextColor(clrTextOld);\r
-                               dc.SetBkColor(clrBkOld);\r
-                       }\r
-               }\r
-\r
-               // create source image\r
-               CDC dcSource;\r
-               dcSource.CreateCompatibleDC(dc);\r
-               HBITMAP hBmpOld = dcSource.SelectBitmap(bmp);\r
-               // set colors\r
-               const COLORREF clrBlack = RGB(0, 0, 0);\r
-               const COLORREF clrWhite = RGB(255, 255, 255);\r
-               COLORREF clrTextOld = dc.SetTextColor(clrBlack);\r
-               COLORREF clrBkOld = dc.SetBkColor(clrWhite);\r
-               // create mask\r
-               CDC dcMask;\r
-               dcMask.CreateCompatibleDC(dc);\r
-               CBitmap bmpMask;\r
-               bmpMask.CreateBitmap(size.cx, size.cy, 1, 1, NULL);\r
-               HBITMAP hBmpOld1 = dcMask.SelectBitmap(bmpMask);\r
-\r
-               // draw the checkmark transparently\r
-               int cx = rcDest.right - rcDest.left;\r
-               int cy = rcDest.bottom - rcDest.top;\r
-               if(hBmpCheck != NULL)\r
-               {\r
-                       // build mask based on transparent color        \r
-                       dcSource.SetBkColor(m_clrMask);\r
-                       dcMask.SetBkColor(clrBlack);\r
-                       dcMask.SetTextColor(clrWhite);\r
-                       dcMask.BitBlt(0, 0, size.cx, size.cy, dcSource, 0, 0, SRCCOPY);\r
-                       // draw bitmap using the mask\r
-                       dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, SRCINVERT);\r
-                       dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcMask, 0, 0, SRCAND);\r
-                       dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, SRCINVERT);\r
-               }\r
-               else\r
-               {\r
-                       const DWORD ROP_DSno = 0x00BB0226L;\r
-                       const DWORD ROP_DSa = 0x008800C6L;\r
-                       const DWORD ROP_DSo = 0x00EE0086L;\r
-                       const DWORD ROP_DSna = 0x00220326L;\r
-\r
-                       // draw mask\r
-                       RECT rcSource = { 0, 0, min(size.cx, rc.right - rc.left), min(size.cy, rc.bottom - rc.top) };\r
-                       dcMask.DrawFrameControl(&rcSource, DFC_MENU, bRadio ? DFCS_MENUBULLET : DFCS_MENUCHECK);\r
-\r
-                       // draw shadow if disabled\r
-                       if(!m_bFlatMenus && bDisabled)\r
-                       {\r
-                               // offset by one pixel\r
-                               int x = rcDest.left + 1;\r
-                               int y = rcDest.top + 1;\r
-                               // paint source bitmap\r
-                               const int nColor = COLOR_3DHILIGHT;\r
-                               dcSource.FillRect(&rcSource, nColor);\r
-                               // draw checkmark - special case black and white colors\r
-                               COLORREF clrCheck = ::GetSysColor(nColor);\r
-                               if(clrCheck == clrWhite)\r
-                               {\r
-                                       dc.BitBlt(x, y, cx, cy, dcMask,  0, 0,   ROP_DSno);\r
-                                       dc.BitBlt(x, y, cx, cy, dcSource, 0, 0, ROP_DSa);\r
-                               }\r
-                               else\r
-                               {\r
-                                       if(clrCheck != clrBlack)\r
-                                       {\r
-                                               ATLASSERT(dcSource.GetTextColor() == clrBlack);\r
-                                               ATLASSERT(dcSource.GetBkColor() == clrWhite);\r
-                                               dcSource.BitBlt(0, 0, size.cx, size.cy, dcMask, 0, 0, ROP_DSna);\r
-                                       }\r
-                                       dc.BitBlt(x, y, cx, cy, dcMask,  0,  0,  ROP_DSa);\r
-                                       dc.BitBlt(x, y, cx, cy, dcSource, 0, 0, ROP_DSo);\r
-                               }\r
-                       }\r
-\r
-                       // paint source bitmap\r
-                       const int nColor = bDisabled ? COLOR_BTNSHADOW : COLOR_MENUTEXT;\r
-                       dcSource.FillRect(&rcSource, nColor);\r
-                       // draw checkmark - special case black and white colors\r
-                       COLORREF clrCheck = ::GetSysColor(nColor);\r
-                       if(clrCheck == clrWhite)\r
-                       {\r
-                               dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcMask,  0, 0,   ROP_DSno);\r
-                               dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, ROP_DSa);\r
-                       }\r
-                       else\r
-                       {\r
-                               if(clrCheck != clrBlack)\r
-                               {\r
-                                       ATLASSERT(dcSource.GetTextColor() == clrBlack);\r
-                                       ATLASSERT(dcSource.GetBkColor() == clrWhite);\r
-                                       dcSource.BitBlt(0, 0, size.cx, size.cy, dcMask, 0, 0, ROP_DSna);\r
-                               }\r
-                               dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcMask,  0,  0,  ROP_DSa);\r
-                               dc.BitBlt(rcDest.left, rcDest.top, cx, cy, dcSource, 0, 0, ROP_DSo);\r
-                       }\r
-               }\r
-               // restore all\r
-               dc.SetTextColor(clrTextOld);\r
-               dc.SetBkColor(clrBkOld);\r
-               dcSource.SelectBitmap(hBmpOld);\r
-               dcMask.SelectBitmap(hBmpOld1);\r
-               if(hBmpCheck == NULL)\r
-                       bmp.DeleteObject();\r
-               // draw pushed-in hilight\r
-               if(!m_bFlatMenus && !bDisabled)\r
-               {\r
-                       if(rc.right - rc.left > size.cx)\r
-                               ::InflateRect(&rcDest, 1,1);   // inflate checkmark by one pixel all around\r
-                       dc.DrawEdge(&rcDest, BDR_SUNKENOUTER, BF_RECT);\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)\r
-       {\r
-               _MenuItemData* pmd = (_MenuItemData*)lpMeasureItemStruct->itemData;\r
-\r
-               if(pmd->fType & MFT_SEPARATOR)   // separator - use half system height and zero width\r
-               {\r
-                       lpMeasureItemStruct->itemHeight = ::GetSystemMetrics(SM_CYMENU) / 2;\r
-                       lpMeasureItemStruct->itemWidth  = 0;\r
-               }\r
-               else\r
-               {\r
-                       // compute size of text - use DrawText with DT_CALCRECT\r
-                       CWindowDC dc(NULL);\r
-                       CFont fontBold;\r
-                       HFONT hOldFont = NULL;\r
-                       if(pmd->fState & MFS_DEFAULT)\r
-                       {\r
-                               // need bold version of font\r
-                               LOGFONT lf = { 0 };\r
-                               m_fontMenu.GetLogFont(lf);\r
-                               lf.lfWeight += 200;\r
-                               fontBold.CreateFontIndirect(&lf);\r
-                               ATLASSERT(fontBold.m_hFont != NULL);\r
-                               hOldFont = dc.SelectFont(fontBold);\r
-                       }\r
-                       else\r
-                       {\r
-                               hOldFont = dc.SelectFont(m_fontMenu);\r
-                       }\r
-\r
-                       RECT rcText = { 0, 0, 0, 0 };\r
-                       dc.DrawText(pmd->lpstrText, -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);\r
-                       int cx = rcText.right - rcText.left;\r
-                       dc.SelectFont(hOldFont);\r
-\r
-                       LOGFONT lf = { 0 };\r
-                       m_fontMenu.GetLogFont(lf);\r
-                       int cy = lf.lfHeight;\r
-                       if(cy < 0)\r
-                               cy = -cy;\r
-                       const int cyMargin = 8;\r
-                       cy += cyMargin;\r
-\r
-                       // height of item is the bigger of these two\r
-                       lpMeasureItemStruct->itemHeight = max(cy, (int)m_szButton.cy);\r
-\r
-                       // width is width of text plus a bunch of stuff\r
-                       cx += 2 * s_kcxTextMargin;   // L/R margin for readability\r
-                       cx += s_kcxGap;              // space between button and menu text\r
-                       cx += 2 * m_szButton.cx;     // button width (L=button; R=empty margin)\r
-                       cx += m_cxExtraSpacing;      // extra between item text and accelerator keys\r
-\r
-                       // Windows adds 1 to returned value\r
-                       cx -= ::GetSystemMetrics(SM_CXMENUCHECK) - 1;\r
-                       lpMeasureItemStruct->itemWidth = cx;   // done deal\r
-               }\r
-       }\r
-\r
-// Implementation - Hook procs\r
-       static LRESULT CALLBACK CreateHookProc(int nCode, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               const int cchClassName = 7;\r
-               TCHAR szClassName[cchClassName] = { 0 };\r
-\r
-               if(nCode == HCBT_CREATEWND)\r
-               {\r
-                       HWND hWndMenu = (HWND)wParam;\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("CmdBar - HCBT_CREATEWND (HWND = %8.8X)\n"), hWndMenu);\r
-#endif\r
-\r
-                       ::GetClassName(hWndMenu, szClassName, cchClassName);\r
-                       if(!lstrcmp(_T("#32768"), szClassName))\r
-                               s_pCurrentBar->m_stackMenuWnd.Push(hWndMenu);\r
-               }\r
-               else if(nCode == HCBT_DESTROYWND)\r
-               {\r
-                       HWND hWndMenu = (HWND)wParam;\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("CmdBar - HCBT_DESTROYWND (HWND = %8.8X)\n"), hWndMenu);\r
-#endif\r
-\r
-                       ::GetClassName(hWndMenu, szClassName, cchClassName);\r
-                       if(!lstrcmp(_T("#32768"), szClassName))\r
-                       {\r
-                               ATLASSERT(hWndMenu == s_pCurrentBar->m_stackMenuWnd.GetCurrent());\r
-                               s_pCurrentBar->m_stackMenuWnd.Pop();\r
-                       }\r
-               }\r
-\r
-               return ::CallNextHookEx(s_hCreateHook, nCode, wParam, lParam);\r
-       }\r
-\r
-       static LRESULT CALLBACK MessageHookProc(int nCode, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               LPMSG pMsg = (LPMSG)lParam;\r
-\r
-               if(nCode == HC_ACTION && wParam == PM_REMOVE && pMsg->message != GetGetBarMessage() && pMsg->message != WM_FORWARDMSG)\r
-               {\r
-                       CCommandBarCtrlBase* pCmdBar = NULL;\r
-                       HWND hWnd = pMsg->hwnd;\r
-                       DWORD dwPID = 0;\r
-                       while(pCmdBar == NULL && hWnd != NULL)\r
-                       {\r
-                               pCmdBar = (CCommandBarCtrlBase*)::SendMessage(hWnd, GetGetBarMessage(), (WPARAM)&dwPID, 0L);\r
-                               hWnd = ::GetParent(hWnd);\r
-                       }\r
-\r
-                       if(pCmdBar != NULL && dwPID == GetCurrentProcessId())\r
-                       {\r
-                               pCmdBar->m_hWndHook = pMsg->hwnd;\r
-                               ATLASSERT(pCmdBar->IsCommandBarBase());\r
-\r
-                               if(::IsWindow(pCmdBar->m_hWnd))\r
-                                       pCmdBar->SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);\r
-                               else\r
-                                       ATLTRACE2(atlTraceUI, 0, _T("CmdBar - Hook skipping message, can't find command bar!\n"));\r
-                       }\r
-               }\r
-\r
-               LRESULT lRet = 0;\r
-               ATLASSERT(s_pmapMsgHook != NULL);\r
-               if(s_pmapMsgHook != NULL)\r
-               {\r
-                       DWORD dwThreadID = ::GetCurrentThreadId();\r
-                       _MsgHookData* pData = s_pmapMsgHook->Lookup(dwThreadID);\r
-                       if(pData != NULL)\r
-                       {\r
-                               lRet = ::CallNextHookEx(pData->hMsgHook, nCode, wParam, lParam);\r
-                       }\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-// Implementation\r
-       void DoPopupMenu(int nIndex, bool bAnimate)\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - DoPopupMenu, bAnimate = %s\n"), bAnimate ? "true" : "false");\r
-#endif\r
-\r
-               // Menu animation flags\r
-#ifndef TPM_VERPOSANIMATION\r
-               const UINT TPM_VERPOSANIMATION = 0x1000L;\r
-#endif\r
-#ifndef TPM_NOANIMATION\r
-               const UINT TPM_NOANIMATION = 0x4000L;\r
-#endif\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               // get popup menu and it's position\r
-               RECT rect = { 0 };\r
-               GetItemRect(nIndex, &rect);\r
-               POINT pt = { rect.left, rect.bottom };\r
-               MapWindowPoints(NULL, &pt, 1);\r
-               MapWindowPoints(NULL, &rect);\r
-               TPMPARAMS TPMParams = { 0 };\r
-               TPMParams.cbSize = sizeof(TPMPARAMS);\r
-               TPMParams.rcExclude = rect;\r
-               HMENU hMenuPopup = ::GetSubMenu(m_hMenu, nIndex);\r
-               ATLASSERT(hMenuPopup != NULL);\r
-\r
-               // get button ID\r
-               TBBUTTON tbb = { 0 };\r
-               GetButton(nIndex, &tbb);\r
-               int nCmdID = tbb.idCommand;\r
-\r
-               m_nPopBtn = nIndex;   // remember current button's index\r
-\r
-               // press button and display popup menu\r
-               PressButton(nCmdID, TRUE);\r
-               SetHotItem(nCmdID);\r
-               pT->DoTrackPopupMenu(hMenuPopup, TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN |\r
-                       (s_bW2K ? (bAnimate ? TPM_VERPOSANIMATION : TPM_NOANIMATION) : 0), pt.x, pt.y, &TPMParams);\r
-               PressButton(nCmdID, FALSE);\r
-               if(::GetFocus() != m_hWnd)\r
-                       SetHotItem(-1);\r
-\r
-               m_nPopBtn = -1;   // restore\r
-\r
-               // eat next message if click is on the same button\r
-               MSG msg = { 0 };\r
-               if(::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rect, msg.pt))\r
-                       ::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);\r
-\r
-               // check if another popup menu should be displayed\r
-               if(m_nNextPopBtn != -1)\r
-               {\r
-                       PostMessage(GetAutoPopupMessage(), m_nNextPopBtn & 0xFFFF);\r
-                       if(!(m_nNextPopBtn & 0xFFFF0000) && !m_bPopupItem)\r
-                               PostMessage(WM_KEYDOWN, VK_DOWN, 0);\r
-                       m_nNextPopBtn = -1;\r
-               }\r
-               else\r
-               {\r
-                       m_bContextMenu = false;\r
-                       // If user didn't hit escape, give focus back\r
-                       if(!m_bEscapePressed)\r
-                       {\r
-                               if(m_bUseKeyboardCues && m_bShowKeyboardCues)\r
-                                       m_bAllowKeyboardCues = false;\r
-                               pT->GiveFocusBack();\r
-                       }\r
-                       else\r
-                       {\r
-                               SetHotItem(nCmdID);\r
-                               SetAnchorHighlight(TRUE);\r
-                       }\r
-               }\r
-       }\r
-\r
-       BOOL DoTrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, LPTPMPARAMS lpParams = NULL)\r
-       {\r
-               CMenuHandle menuPopup = hMenu;\r
-\r
-               CWindowCreateCriticalSectionLock lock;\r
-               if(FAILED(lock.Lock()))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CCommandBarCtrlImpl::DoTrackPopupMenu.\n"));\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               ATLASSERT(s_hCreateHook == NULL);\r
-\r
-               s_pCurrentBar = static_cast<CCommandBarCtrlBase*>(this);\r
-\r
-               s_hCreateHook = ::SetWindowsHookEx(WH_CBT, CreateHookProc, ModuleHelper::GetModuleInstance(), GetCurrentThreadId());\r
-               ATLASSERT(s_hCreateHook != NULL);\r
-\r
-               m_bPopupItem = false;\r
-               m_bMenuActive = true;\r
-\r
-               BOOL bTrackRet = menuPopup.TrackPopupMenuEx(uFlags, x, y, m_hWnd, lpParams);\r
-               m_bMenuActive = false;\r
-\r
-               ::UnhookWindowsHookEx(s_hCreateHook);\r
-\r
-               s_hCreateHook = NULL;\r
-               s_pCurrentBar = NULL;\r
-\r
-               lock.Unlock();\r
-\r
-               // cleanup - convert menus back to original state\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - TrackPopupMenu - cleanup\n"));\r
-#endif\r
-\r
-               ATLASSERT(m_stackMenuWnd.GetSize() == 0);\r
-\r
-               UpdateWindow();\r
-               ATL::CWindow wndTL = GetTopLevelParent();\r
-               wndTL.UpdateWindow();\r
-\r
-               // restore the menu items to the previous state for all menus that were converted\r
-               if(m_bImagesVisible)\r
-               {\r
-                       HMENU hMenuSav = NULL;\r
-                       while((hMenuSav = m_stackMenuHandle.Pop()) != NULL)\r
-                       {\r
-                               menuPopup = hMenuSav;\r
-                               BOOL bRet = FALSE;\r
-                               // restore state and delete menu item data\r
-                               for(int i = 0; i < menuPopup.GetMenuItemCount(); i++)\r
-                               {\r
-                                       CMenuItemInfo mii;\r
-                                       mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID;\r
-                                       bRet = menuPopup.GetMenuItemInfo(i, TRUE, &mii);\r
-                                       ATLASSERT(bRet);\r
-\r
-                                       _MenuItemData* pMI = (_MenuItemData*)mii.dwItemData;\r
-                                       if(pMI != NULL && pMI->IsCmdBarMenuItem())\r
-                                       {\r
-                                               mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_STATE;\r
-                                               mii.fType = pMI->fType;\r
-                                               mii.fState = pMI->fState;\r
-                                               mii.dwTypeData = pMI->lpstrText;\r
-                                               mii.cch = lstrlen(pMI->lpstrText);\r
-                                               mii.dwItemData = NULL;\r
-\r
-                                               bRet = menuPopup.SetMenuItemInfo(i, TRUE, &mii);\r
-                                               // this one triggers WM_MEASUREITEM\r
-                                               menuPopup.ModifyMenu(i, MF_BYPOSITION | mii.fType | mii.fState, mii.wID, pMI->lpstrText);\r
-                                               ATLASSERT(bRet);\r
-\r
-                                               delete [] pMI->lpstrText;\r
-                                               delete pMI;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               return bTrackRet;\r
-       }\r
-\r
-       int GetPreviousMenuItem(int nBtn) const\r
-       {\r
-               if(nBtn == -1)\r
-                       return -1;\r
-#if (_WIN32_IE >= 0x0500)\r
-               RECT rcClient;\r
-               GetClientRect(&rcClient);\r
-#endif // (_WIN32_IE >= 0x0500)\r
-               int nNextBtn;\r
-               for(nNextBtn = nBtn - 1; nNextBtn != nBtn; nNextBtn--)\r
-               {\r
-                       if(nNextBtn < 0)\r
-                               nNextBtn = ::GetMenuItemCount(m_hMenu) - 1;\r
-                       TBBUTTON tbb = { 0 };\r
-                       GetButton(nNextBtn, &tbb);\r
-#if (_WIN32_IE >= 0x0500)\r
-                       RECT rcBtn;\r
-                       GetItemRect(nNextBtn, &rcBtn);\r
-                       if(rcBtn.right > rcClient.right)\r
-                       {\r
-                               nNextBtn = -2;   // chevron\r
-                               break;\r
-                       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                       if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0)\r
-                               break;\r
-               }\r
-               return (nNextBtn != nBtn) ? nNextBtn : -1;\r
-       }\r
-\r
-       int GetNextMenuItem(int nBtn) const\r
-       {\r
-               if(nBtn == -1)\r
-                       return -1;\r
-#if (_WIN32_IE >= 0x0500)\r
-               RECT rcClient = { 0 };\r
-               GetClientRect(&rcClient);\r
-#endif // (_WIN32_IE >= 0x0500)\r
-               int nNextBtn = 0;\r
-               int nCount = ::GetMenuItemCount(m_hMenu);\r
-               for(nNextBtn = nBtn + 1; nNextBtn != nBtn; nNextBtn++)\r
-               {\r
-                       if(nNextBtn >= nCount)\r
-                               nNextBtn = 0;\r
-                       TBBUTTON tbb = { 0 };\r
-                       GetButton(nNextBtn, &tbb);\r
-#if (_WIN32_IE >= 0x0500)\r
-                       RECT rcBtn = { 0 };\r
-                       GetItemRect(nNextBtn, &rcBtn);\r
-                       if(rcBtn.right > rcClient.right)\r
-                       {\r
-                               nNextBtn = -2;   // chevron\r
-                               break;\r
-                       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-                       if((tbb.fsState & TBSTATE_ENABLED) != 0 && (tbb.fsState & TBSTATE_HIDDEN) == 0)\r
-                               break;\r
-               }\r
-               return (nNextBtn != nBtn) ? nNextBtn : -1;\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       bool DisplayChevronMenu()\r
-       {\r
-               // assume we are in a rebar\r
-               HWND hWndReBar = GetParent();\r
-               int nCount = (int)::SendMessage(hWndReBar, RB_GETBANDCOUNT, 0, 0L);\r
-               bool bRet = false;\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       REBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_STYLE };\r
-                       BOOL bRetBandInfo = (BOOL)::SendMessage(hWndReBar, RB_GETBANDINFO, i, (LPARAM)&rbbi);\r
-                       if(bRetBandInfo && rbbi.hwndChild == m_hWnd)\r
-                       {\r
-                               if((rbbi.fStyle & RBBS_USECHEVRON) != 0)\r
-                               {\r
-                                       ::PostMessage(hWndReBar, RB_PUSHCHEVRON, i, 0L);\r
-                                       PostMessage(WM_KEYDOWN, VK_DOWN, 0L);\r
-                                       bRet = true;\r
-                               }\r
-                               break;\r
-                       }\r
-               }\r
-               return bRet;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-\r
-       void GetSystemSettings()\r
-       {\r
-               // refresh our font\r
-               NONCLIENTMETRICS info = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\r
-               BOOL bRet = ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0);\r
-               ATLASSERT(bRet);\r
-               if(bRet)\r
-               {\r
-                       LOGFONT logfont = { 0 };\r
-                       if(m_fontMenu.m_hFont != NULL)\r
-                               m_fontMenu.GetLogFont(logfont);\r
-                       if(logfont.lfHeight != info.lfMenuFont.lfHeight ||\r
-                          logfont.lfWidth != info.lfMenuFont.lfWidth ||\r
-                          logfont.lfEscapement != info.lfMenuFont.lfEscapement ||\r
-                          logfont.lfOrientation != info.lfMenuFont.lfOrientation ||\r
-                          logfont.lfWeight != info.lfMenuFont.lfWeight ||\r
-                          logfont.lfItalic != info.lfMenuFont.lfItalic ||\r
-                          logfont.lfUnderline != info.lfMenuFont.lfUnderline ||\r
-                          logfont.lfStrikeOut != info.lfMenuFont.lfStrikeOut ||\r
-                          logfont.lfCharSet != info.lfMenuFont.lfCharSet ||\r
-                          logfont.lfOutPrecision != info.lfMenuFont.lfOutPrecision ||\r
-                          logfont.lfClipPrecision != info.lfMenuFont.lfClipPrecision ||\r
-                          logfont.lfQuality != info.lfMenuFont.lfQuality ||\r
-                          logfont.lfPitchAndFamily != info.lfMenuFont.lfPitchAndFamily ||\r
-                          lstrcmp(logfont.lfFaceName, info.lfMenuFont.lfFaceName) != 0)\r
-                       {\r
-                               HFONT hFontMenu = ::CreateFontIndirect(&info.lfMenuFont);\r
-                               ATLASSERT(hFontMenu != NULL);\r
-                               if(hFontMenu != NULL)\r
-                               {\r
-                                       if(m_fontMenu.m_hFont != NULL)\r
-                                               m_fontMenu.DeleteObject();\r
-                                       m_fontMenu.Attach(hFontMenu);\r
-                                       SetFont(m_fontMenu);\r
-                                       AddStrings(_T("NS\0"));   // for proper item height\r
-                                       AutoSize();\r
-                               }\r
-                       }\r
-               }\r
-\r
-               // check if we need extra spacing for menu item text\r
-               CWindowDC dc(m_hWnd);\r
-               HFONT hFontOld = dc.SelectFont(m_fontMenu);\r
-               RECT rcText = { 0, 0, 0, 0 };\r
-               dc.DrawText(_T("\t"), -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);\r
-               if((rcText.right - rcText.left) < 4)\r
-               {\r
-                       ::SetRectEmpty(&rcText);\r
-                       dc.DrawText(_T("x"), -1, &rcText, DT_SINGLELINE | DT_LEFT | DT_VCENTER | DT_CALCRECT);\r
-                       m_cxExtraSpacing = rcText.right - rcText.left;\r
-               }\r
-               else\r
-               {\r
-                       m_cxExtraSpacing = 0;\r
-               }\r
-               dc.SelectFont(hFontOld);\r
-\r
-               // get Windows version\r
-               OSVERSIONINFO ovi = { sizeof(OSVERSIONINFO) };\r
-               ::GetVersionEx(&ovi);\r
-\r
-               // query keyboard cues mode (Windows 2000 or later)\r
-               if(ovi.dwMajorVersion >= 5)\r
-               {\r
-#ifndef SPI_GETKEYBOARDCUES\r
-                       const UINT SPI_GETKEYBOARDCUES = 0x100A;\r
-#endif // !SPI_GETKEYBOARDCUES\r
-                       BOOL bRetVal = TRUE;\r
-                       bRet = ::SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &bRetVal, 0);\r
-                       m_bUseKeyboardCues = (bRet && !bRetVal);\r
-                       m_bAllowKeyboardCues = true;\r
-                       ShowKeyboardCues(!m_bUseKeyboardCues);\r
-               }\r
-\r
-               // query flat menu mode (Windows XP or later)\r
-               if((ovi.dwMajorVersion == 5 && ovi.dwMinorVersion >= 1) || (ovi.dwMajorVersion > 5))\r
-               {\r
-#ifndef SPI_GETFLATMENU\r
-                       const UINT SPI_GETFLATMENU = 0x1022;\r
-#endif // !SPI_GETFLATMENU\r
-                       BOOL bRetVal = FALSE;\r
-                       bRet = ::SystemParametersInfo(SPI_GETFLATMENU, 0, &bRetVal, 0);\r
-                       m_bFlatMenus = (bRet && bRetVal);\r
-               }\r
-\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-               // check if we should use Vista menus\r
-               bool bVistaMenus = (RunTimeHelper::IsVista() && RunTimeHelper::IsCommCtrl6() && ((m_dwExtendedStyle & CBR_EX_NOVISTAMENUS) == 0));\r
-\r
-               if(bVistaMenus)\r
-               {\r
-                       HMODULE hThemeDLL = ::LoadLibrary(_T("uxtheme.dll"));\r
-                       if(hThemeDLL != NULL)\r
-                       {\r
-                               typedef BOOL (STDAPICALLTYPE *PFN_IsThemeActive)();\r
-                               PFN_IsThemeActive pfnIsThemeActive = (PFN_IsThemeActive)::GetProcAddress(hThemeDLL, "IsThemeActive");\r
-                               ATLASSERT(pfnIsThemeActive != NULL);\r
-                               bVistaMenus = bVistaMenus && (pfnIsThemeActive != NULL) && (pfnIsThemeActive() != FALSE);\r
-\r
-                               typedef BOOL (STDAPICALLTYPE *PFN_IsAppThemed)();\r
-                               PFN_IsAppThemed pfnIsAppThemed = (PFN_IsAppThemed)::GetProcAddress(hThemeDLL, "IsAppThemed");\r
-                               ATLASSERT(pfnIsAppThemed != NULL);\r
-                               bVistaMenus = bVistaMenus && (pfnIsAppThemed != NULL) && (pfnIsAppThemed() != FALSE);\r
-\r
-                               ::FreeLibrary(hThemeDLL);\r
-                       }\r
-               }\r
-\r
-               if(!bVistaMenus && m_bVistaMenus && (m_hMenu != NULL) && (m_arrCommand.GetSize() > 0))\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->_RemoveVistaBitmapsFromMenu();\r
-               }\r
-\r
-               m_bVistaMenus = bVistaMenus;\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("CmdBar - GetSystemSettings:\n     m_bFlatMenus = %s\n     m_bUseKeyboardCues = %s     m_bVistaMenus = %s\n"),\r
-                       m_bFlatMenus ? "true" : "false", m_bUseKeyboardCues ? "true" : "false", m_bVistaMenus ? "true" : "false");\r
-#endif\r
-       }\r
-\r
-// Implementation - alternate focus mode support\r
-       void TakeFocus()\r
-       {\r
-               if((m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && m_hWndFocus == NULL)\r
-                       m_hWndFocus = ::GetFocus();\r
-               SetFocus();\r
-       }\r
-\r
-       void GiveFocusBack()\r
-       {\r
-               if(m_bParentActive)\r
-               {\r
-                       if((m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && ::IsWindow(m_hWndFocus))\r
-                               ::SetFocus(m_hWndFocus);\r
-                       else if(!(m_dwExtendedStyle & CBR_EX_ALTFOCUSMODE) && m_wndParent.IsWindow())\r
-                               m_wndParent.SetFocus();\r
-               }\r
-               m_hWndFocus = NULL;\r
-               SetAnchorHighlight(FALSE);\r
-               if(m_bUseKeyboardCues && m_bShowKeyboardCues)\r
-                       ShowKeyboardCues(false);\r
-               m_bSkipPostDown = false;\r
-       }\r
-\r
-       void ShowKeyboardCues(bool bShow)\r
-       {\r
-               m_bShowKeyboardCues = bShow;\r
-               SetDrawTextFlags(DT_HIDEPREFIX, m_bShowKeyboardCues ? 0 : DT_HIDEPREFIX);\r
-               Invalidate();\r
-               UpdateWindow();\r
-       }\r
-\r
-// Implementation - internal message helpers\r
-       static UINT GetAutoPopupMessage()\r
-       {\r
-               static UINT uAutoPopupMessage = 0;\r
-               if(uAutoPopupMessage == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CCommandBarCtrlImpl::GetAutoPopupMessage.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uAutoPopupMessage == 0)\r
-                               uAutoPopupMessage = ::RegisterWindowMessage(_T("WTL_CmdBar_InternalAutoPopupMsg"));\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uAutoPopupMessage != 0);\r
-               return uAutoPopupMessage;\r
-       }\r
-\r
-       static UINT GetGetBarMessage()\r
-       {\r
-               static UINT uGetBarMessage = 0;\r
-               if(uGetBarMessage == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CCommandBarCtrlImpl::GetGetBarMessage.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uGetBarMessage == 0)\r
-                               uGetBarMessage = ::RegisterWindowMessage(_T("WTL_CmdBar_InternalGetBarMsg"));\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uGetBarMessage != 0);\r
-               return uGetBarMessage;\r
-       }\r
-\r
-// Implementation\r
-       bool CreateInternalImageList(int cImages)\r
-       {\r
-               UINT uFlags = (m_bAlphaImages ? ILC_COLOR32 : ILC_COLOR24) | ILC_MASK;\r
-               m_hImageList = ::ImageList_Create(m_szBitmap.cx, m_szBitmap.cy, uFlags, cImages, 1);\r
-               ATLASSERT(m_hImageList != NULL);\r
-               return (m_hImageList != NULL);\r
-       }\r
-\r
-// Implementation - support for Vista menus\r
-#if _WTL_CMDBAR_VISTA_MENUS\r
-       void _AddVistaBitmapsFromImageList(int nStartIndex, int nCount)\r
-       {\r
-               // Create display compatible memory DC\r
-               HDC hDC = ::GetDC(NULL);\r
-               CDC dcMem;\r
-               dcMem.CreateCompatibleDC(hDC);\r
-               HBITMAP hBitmapSave = dcMem.GetCurrentBitmap();\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               // Create bitmaps for all menu items\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       HBITMAP hBitmap = pT->_CreateVistaBitmapHelper(nStartIndex + i, hDC, dcMem);\r
-                       dcMem.SelectBitmap(hBitmapSave);\r
-                       m_arrVistaBitmap.Add(hBitmap);\r
-               }\r
-       }\r
-\r
-       void _AddVistaBitmapFromImageList(int nIndex)\r
-       {\r
-               // Create display compatible memory DC\r
-               HDC hDC = ::GetDC(NULL);\r
-               CDC dcMem;\r
-               dcMem.CreateCompatibleDC(hDC);\r
-               HBITMAP hBitmapSave = dcMem.GetCurrentBitmap();\r
-\r
-               // Create bitmap for menu item\r
-               T* pT = static_cast<T*>(this);\r
-               HBITMAP hBitmap = pT->_CreateVistaBitmapHelper(nIndex, hDC, dcMem);\r
-\r
-               // Select saved bitmap back and add bitmap to the array\r
-               dcMem.SelectBitmap(hBitmapSave);\r
-               m_arrVistaBitmap.Add(hBitmap);\r
-       }\r
-\r
-       void _ReplaceVistaBitmapFromImageList(int nIndex)\r
-       {\r
-               // Delete existing bitmap\r
-               if(m_arrVistaBitmap[nIndex] != NULL)\r
-                       ::DeleteObject(m_arrVistaBitmap[nIndex]);\r
-\r
-               // Create display compatible memory DC\r
-               HDC hDC = ::GetDC(NULL);\r
-               CDC dcMem;\r
-               dcMem.CreateCompatibleDC(hDC);\r
-               HBITMAP hBitmapSave = dcMem.GetCurrentBitmap();\r
-\r
-               // Create bitmap for menu item\r
-               T* pT = static_cast<T*>(this);\r
-               HBITMAP hBitmap = pT->_CreateVistaBitmapHelper(nIndex, hDC, dcMem);\r
-\r
-               // Select saved bitmap back and replace bitmap in the array\r
-               dcMem.SelectBitmap(hBitmapSave);\r
-               m_arrVistaBitmap.SetAtIndex(nIndex, hBitmap);\r
-       }\r
-\r
-       HBITMAP _CreateVistaBitmapHelper(int nIndex, HDC hDCSource, HDC hDCTarget)\r
-       {\r
-               // Create 32-bit bitmap\r
-               BITMAPINFO bi = { 0 };\r
-               bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\r
-               bi.bmiHeader.biWidth = m_szBitmap.cx;\r
-               bi.bmiHeader.biHeight = m_szBitmap.cy;\r
-               bi.bmiHeader.biPlanes = 1;\r
-               bi.bmiHeader.biBitCount = 32;\r
-               bi.bmiHeader.biCompression = BI_RGB;\r
-               bi.bmiHeader.biSizeImage = 0;\r
-               bi.bmiHeader.biXPelsPerMeter = 0;\r
-               bi.bmiHeader.biYPelsPerMeter = 0;\r
-               bi.bmiHeader.biClrUsed = 0;\r
-               bi.bmiHeader.biClrImportant = 0;\r
-               HBITMAP hBitmap = ::CreateDIBSection(hDCSource, &bi, DIB_RGB_COLORS, NULL, NULL, 0);\r
-               ATLASSERT(hBitmap != NULL);\r
-\r
-               // Select bitmap into target DC and draw from image list to it\r
-               if(hBitmap != NULL)\r
-               {\r
-                       ::SelectObject(hDCTarget, hBitmap);\r
-\r
-                       IMAGELISTDRAWPARAMS ildp = { 0 };\r
-                       ildp.cbSize = sizeof(IMAGELISTDRAWPARAMS);\r
-                       ildp.himl = m_hImageList;\r
-                       ildp.i = nIndex;\r
-                       ildp.hdcDst = hDCTarget;\r
-                       ildp.x = 0;\r
-                       ildp.y = 0;\r
-                       ildp.cx = 0;\r
-                       ildp.cy = 0;\r
-                       ildp.xBitmap = 0;\r
-                       ildp.yBitmap = 0;\r
-                       ildp.fStyle = ILD_TRANSPARENT;\r
-                       ildp.fState = ILS_ALPHA;\r
-                       ildp.Frame = 255;\r
-                       ::ImageList_DrawIndirect(&ildp);\r
-               }\r
-\r
-               return hBitmap;\r
-       }\r
-\r
-       void _RemoveVistaBitmapsFromMenu()\r
-       {\r
-               CMenuHandle menu = m_hMenu;\r
-               for(int i = 0; i < m_arrCommand.GetSize(); i++)\r
-               {\r
-                       CMenuItemInfo mii;\r
-                       mii.fMask = MIIM_BITMAP;\r
-                       mii.hbmpItem = NULL;\r
-                       menu.SetMenuItemInfo(m_arrCommand[i], FALSE, &mii);\r
-               }\r
-       }\r
-#endif // _WTL_CMDBAR_VISTA_MENUS\r
-};\r
-\r
-\r
-class CCommandBarCtrl : public CCommandBarCtrlImpl<CCommandBarCtrl>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(_T("WTL_CommandBar"), GetWndClassName())\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMDICommandBarCtrl - ATL implementation of Command Bars for MDI apps\r
-\r
-template <class T, class TBase = CCommandBarCtrlBase, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CMDICommandBarCtrlImpl : public CCommandBarCtrlImpl< T, TBase, TWinTraits>\r
-{\r
-public:\r
-// Data members\r
-       ATL::CContainedWindow m_wndMDIClient;\r
-       bool m_bChildMaximized;\r
-       HWND m_hWndChildMaximized;\r
-       HICON m_hIconChildMaximized;\r
-       int m_nBtnPressed;\r
-       int m_nBtnWasPressed;\r
-\r
-       int m_cxyOffset;      // offset between nonclient elements\r
-       int m_cxIconWidth;    // small icon width\r
-       int m_cyIconHeight;   // small icon height\r
-       int m_cxBtnWidth;     // nonclient button width\r
-       int m_cyBtnHeight;    // nonclient button height\r
-       int m_cxLeft;         // left nonclient area width\r
-       int m_cxRight;        // right nonclient area width\r
-\r
-// Theme declarations and data members\r
-#ifndef _WTL_NO_AUTO_THEME\r
-#ifndef _UXTHEME_H_\r
-       typedef HANDLE HTHEME;\r
-#endif // !_UXTHEME_H_\r
-       typedef HTHEME (STDAPICALLTYPE *PFN_OpenThemeData)(HWND hwnd, LPCWSTR pszClassList);\r
-       typedef HRESULT (STDAPICALLTYPE *PFN_CloseThemeData)(HTHEME hTheme);\r
-       typedef HRESULT (STDAPICALLTYPE *PFN_DrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect);\r
-       typedef HRESULT (STDAPICALLTYPE *PFN_DrawThemeParentBackground)(HWND hwnd, HDC hdc, OPTIONAL RECT* prc);\r
-\r
-       HMODULE m_hThemeDLL;\r
-       HTHEME m_hTheme;\r
-       PFN_DrawThemeBackground m_pfnDrawThemeBackground;\r
-       PFN_DrawThemeParentBackground m_pfnDrawThemeParentBackground;\r
-#endif // !_WTL_NO_AUTO_THEME\r
-\r
-// Constructor/destructor\r
-       CMDICommandBarCtrlImpl() : \r
-                       m_wndMDIClient(this, 2), m_bChildMaximized(false), \r
-                       m_hWndChildMaximized(NULL), m_hIconChildMaximized(NULL), \r
-                       m_nBtnPressed(-1), m_nBtnWasPressed(-1),\r
-#ifndef _WTL_NO_AUTO_THEME\r
-                       m_hThemeDLL(NULL), m_hTheme(NULL), m_pfnDrawThemeBackground(NULL), m_pfnDrawThemeParentBackground(NULL), \r
-#endif // !_WTL_NO_AUTO_THEME\r
-                       m_cxyOffset(2),\r
-                       m_cxIconWidth(16), m_cyIconHeight(16),\r
-                       m_cxBtnWidth(16), m_cyBtnHeight(14),\r
-                       m_cxLeft(20), m_cxRight(55)\r
-       { }\r
-\r
-       ~CMDICommandBarCtrlImpl()\r
-       {\r
-               if(m_wndMDIClient.IsWindow())\r
-/*scary!*/                     m_wndMDIClient.UnsubclassWindow();\r
-       }\r
-\r
-// Operations\r
-       BOOL SetMDIClient(HWND hWndMDIClient)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(::IsWindow(hWndMDIClient));\r
-               if(!::IsWindow(hWndMDIClient))\r
-                       return FALSE;\r
-\r
-#ifdef _DEBUG\r
-               // BLOCK: Test if the passed window is MDICLIENT\r
-               {\r
-                       LPCTSTR lpszMDIClientClass = _T("MDICLIENT");\r
-                       const int nNameLen = 9 + 1;   // "MDICLIENT" + NULL\r
-                       TCHAR szClassName[nNameLen] = { 0 };\r
-                       ::GetClassName(hWndMDIClient, szClassName, nNameLen);\r
-                       ATLASSERT(lstrcmpi(szClassName, lpszMDIClientClass) == 0);\r
-               }\r
-#endif // _DEBUG\r
-\r
-               if(m_wndMDIClient.IsWindow())\r
-/*scary!*/             m_wndMDIClient.UnsubclassWindow();\r
-\r
-               return m_wndMDIClient.SubclassWindow(hWndMDIClient);\r
-       }\r
-\r
-// Message maps\r
-       typedef CCommandBarCtrlImpl< T, TBase, TWinTraits >   _baseClass;\r
-       BEGIN_MSG_MAP(CMDICommandBarCtrlImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               MESSAGE_HANDLER(_GetThemeChangedMsg(), OnThemeChanged)\r
-#endif // !_WTL_NO_AUTO_THEME\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_NCCALCSIZE, OnNcCalcSize)\r
-               MESSAGE_HANDLER(WM_NCPAINT, OnNcPaint)\r
-               MESSAGE_HANDLER(WM_NCHITTEST, OnNcHitTest)\r
-               MESSAGE_HANDLER(WM_NCLBUTTONDOWN, OnNcLButtonDown)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\r
-               MESSAGE_HANDLER(WM_NCLBUTTONDBLCLK, OnNcLButtonDblClk)\r
-               MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\r
-               CHAIN_MSG_MAP(_baseClass)\r
-       ALT_MSG_MAP(1)   // Parent window messages\r
-               MESSAGE_HANDLER(WM_ACTIVATE, OnParentActivate)\r
-               CHAIN_MSG_MAP_ALT(_baseClass, 1)\r
-       ALT_MSG_MAP(2)   // MDI client window messages\r
-               MESSAGE_HANDLER(WM_MDISETMENU, OnMDISetMenu)\r
-               // no chaining needed since this was moved from the base class here\r
-       ALT_MSG_MAP(3)   // Message hook messages\r
-               MESSAGE_RANGE_HANDLER(0, 0xFFFF, OnAllHookMessages)\r
-               CHAIN_MSG_MAP_ALT(_baseClass, 3)\r
-       END_MSG_MAP()\r
-\r
-// Additional MDI message handlers\r
-       LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               LRESULT lRet = _baseClass::OnCreate(uMsg, wParam, lParam, bHandled);\r
-               if(lRet == (LRESULT)-1)\r
-                       return lRet;\r
-\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               // this will fail if theming is not supported\r
-               m_hThemeDLL = ::LoadLibrary(_T("uxtheme.dll"));\r
-               if(m_hThemeDLL != NULL)\r
-               {\r
-                       m_pfnDrawThemeBackground = (PFN_DrawThemeBackground)::GetProcAddress(m_hThemeDLL, "DrawThemeBackground");\r
-                       ATLASSERT(m_pfnDrawThemeBackground != NULL);\r
-                       if(m_pfnDrawThemeBackground != NULL)\r
-                       {\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->_OpenThemeData();\r
-                       }\r
-                       else\r
-                       {\r
-                               ::FreeLibrary(m_hThemeDLL);\r
-                               m_hThemeDLL = NULL;\r
-                       }\r
-                       m_pfnDrawThemeParentBackground = (PFN_DrawThemeParentBackground)::GetProcAddress(m_hThemeDLL, "DrawThemeParentBackground");\r
-                       ATLASSERT(m_pfnDrawThemeParentBackground != NULL);\r
-               }\r
-#endif // !_WTL_NO_AUTO_THEME\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               LRESULT lRet = _baseClass::OnDestroy(uMsg, wParam, lParam, bHandled);\r
-\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               if(m_hThemeDLL != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->_CloseThemeData();\r
-                       ::FreeLibrary(m_hThemeDLL);\r
-                       m_hThemeDLL = NULL;\r
-               }\r
-#endif // !_WTL_NO_AUTO_THEME\r
-\r
-               return lRet;\r
-       }\r
-\r
-#ifndef _WTL_NO_AUTO_THEME\r
-       LRESULT OnThemeChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(m_hThemeDLL != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->_CloseThemeData();\r
-                       pT->_OpenThemeData();\r
-               }\r
-               return 0;\r
-       }\r
-#endif // !_WTL_NO_AUTO_THEME\r
-\r
-       LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_AdjustBtnSize(GET_Y_LPARAM(lParam));\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-\r
-               if(m_bChildMaximized && (BOOL)wParam)\r
-               {\r
-                       LPNCCALCSIZE_PARAMS lpParams = (LPNCCALCSIZE_PARAMS)lParam;\r
-                       if(m_bLayoutRTL)\r
-                       {\r
-                               lpParams->rgrc[0].left += m_cxRight;\r
-                               lpParams->rgrc[0].right -= m_cxLeft;\r
-                       }\r
-                       else\r
-                       {\r
-                               lpParams->rgrc[0].left += m_cxLeft;\r
-                               lpParams->rgrc[0].right -= m_cxRight;\r
-                       }\r
-               }\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-\r
-               if(!m_bChildMaximized)\r
-                       return lRet;\r
-\r
-               ATLASSERT(m_hWndChildMaximized != NULL && m_hIconChildMaximized != NULL);\r
-\r
-               // get DC and window rectangle\r
-               CWindowDC dc(m_hWnd);\r
-               RECT rect;\r
-               GetWindowRect(&rect);\r
-               int cxWidth = rect.right - rect.left;\r
-               int cyHeight = rect.bottom - rect.top;\r
-\r
-               // paint left side nonclient background and draw icon\r
-               ::SetRect(&rect, 0, 0, m_cxLeft, cyHeight);\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               if(m_hTheme != NULL)\r
-               {\r
-                       if(m_pfnDrawThemeParentBackground != NULL)\r
-                               m_pfnDrawThemeParentBackground(m_hWnd, dc, &rect);\r
-                       else\r
-                               dc.FillRect(&rect, COLOR_WINDOW);\r
-               }\r
-               else\r
-#endif // !_WTL_NO_AUTO_THEME\r
-               {\r
-                       if((m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)\r
-                               dc.FillRect(&rect, COLOR_3DFACE);\r
-                       else\r
-                               dc.FillRect(&rect, COLOR_MENU);\r
-               }\r
-\r
-               RECT rcIcon = { 0 };\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_CalcIconRect(cxWidth, cyHeight, rcIcon);\r
-               dc.DrawIconEx(rcIcon.left, rcIcon.top, m_hIconChildMaximized, m_cxIconWidth, m_cyIconHeight);\r
-\r
-               // paint right side nonclient background\r
-               ::SetRect(&rect, cxWidth - m_cxRight, 0, cxWidth, cyHeight);\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               if(m_hTheme != NULL)\r
-               {\r
-                       if(m_pfnDrawThemeParentBackground != NULL)\r
-                       {\r
-                               // this is to account for the left non-client area\r
-                               POINT ptOrg = { 0, 0 };\r
-                               dc.GetViewportOrg(&ptOrg);\r
-                               dc.SetViewportOrg(ptOrg.x + m_cxLeft, ptOrg.y);\r
-                               ::OffsetRect(&rect, -m_cxLeft, 0);\r
-\r
-                               m_pfnDrawThemeParentBackground(m_hWnd, dc, &rect);\r
-\r
-                               // restore\r
-                               dc.SetViewportOrg(ptOrg);\r
-                               ::OffsetRect(&rect, m_cxLeft, 0);\r
-                       }\r
-                       else\r
-                       {\r
-                               dc.FillRect(&rect, COLOR_3DFACE);\r
-                       }\r
-               }\r
-               else\r
-#endif // !_WTL_NO_AUTO_THEME\r
-               {\r
-                       if((m_dwExtendedStyle & CBR_EX_TRANSPARENT) != 0)\r
-                               dc.FillRect(&rect, COLOR_3DFACE);\r
-                       else\r
-                               dc.FillRect(&rect, COLOR_MENU);\r
-               }\r
-\r
-               // draw buttons\r
-               RECT arrRect[3] = { 0 };\r
-               pT->_CalcBtnRects(cxWidth, cyHeight, arrRect);\r
-               pT->_DrawMDIButton(dc, arrRect, -1);   // draw all buttons\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               if(m_bChildMaximized)\r
-               {\r
-                       RECT rect = { 0 };\r
-                       GetWindowRect(&rect);\r
-                       POINT pt = { GET_X_LPARAM(lParam) - rect.left, GET_Y_LPARAM(lParam) - rect.top };\r
-                       if(m_bLayoutRTL)\r
-                       {\r
-                               if((pt.x < m_cxRight) || (pt.x > ((rect.right - rect.left) - m_cxLeft)))\r
-                                       lRet = HTBORDER;\r
-                       }\r
-                       else\r
-                       {\r
-                               if((pt.x < m_cxLeft) || (pt.x > ((rect.right - rect.left) - m_cxRight)))\r
-                                       lRet = HTBORDER;\r
-                       }\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnNcLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(!m_bChildMaximized)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               ATLASSERT(_DebugCheckChild());\r
-\r
-               POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               RECT rect = { 0 };\r
-               GetWindowRect(&rect);\r
-               pt.x -= rect.left;\r
-               pt.y -= rect.top;\r
-\r
-               RECT rcIcon = { 0 };\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, m_bLayoutRTL);\r
-               RECT arrRect[3] = { 0 };\r
-               pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);\r
-\r
-               if(::PtInRect(&rcIcon, pt))\r
-               {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonDown: icon\n"));\r
-#endif\r
-#ifndef TPM_VERPOSANIMATION\r
-                       const UINT TPM_VERPOSANIMATION = 0x1000L;   // Menu animation flag\r
-#endif\r
-                       CMenuHandle menu = ::GetSystemMenu(m_hWndChildMaximized, FALSE);\r
-                       UINT uRet = (UINT)menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD |  \r
-                               (s_bW2K ? TPM_VERPOSANIMATION : 0), m_bLayoutRTL ? rect.right : rect.left, rect.bottom, m_hWndChildMaximized);\r
-\r
-                       // eat next message if click is on the same button\r
-                       ::OffsetRect(&rcIcon, rect.left, rect.top);\r
-                       MSG msg = { 0 };\r
-                       if(::PeekMessage(&msg, m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rcIcon, msg.pt))\r
-                               ::PeekMessage(&msg, m_hWnd, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, PM_REMOVE);\r
-\r
-                       if(uRet != 0)\r
-                               ::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, uRet, 0L);\r
-               }\r
-               else if(::PtInRect(&arrRect[0], pt))\r
-               {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonDown: close button\n"));\r
-#endif\r
-                       m_nBtnWasPressed = m_nBtnPressed = 0;\r
-               }\r
-               else if(::PtInRect(&arrRect[1], pt))\r
-               {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonDown: restore button\n"));\r
-#endif\r
-                       m_nBtnWasPressed = m_nBtnPressed = 1;\r
-               }\r
-               else if(::PtInRect(&arrRect[2], pt))\r
-               {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonDown: minimize button\n"));\r
-#endif\r
-                       m_nBtnWasPressed = m_nBtnPressed = 2;\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-\r
-               // draw the button state if it was pressed\r
-               if(m_nBtnPressed != -1)\r
-               {\r
-                       SetCapture();\r
-                       CWindowDC dc(m_hWnd);\r
-                       pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);\r
-                       pT->_DrawMDIButton(dc, arrRect, m_nBtnPressed);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(!m_bChildMaximized || ::GetCapture() != m_hWnd || m_nBtnWasPressed == -1)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               ClientToScreen(&pt);\r
-               RECT rect = { 0 };\r
-               GetWindowRect(&rect);\r
-               pt.x -= rect.left;\r
-               pt.y -= rect.top;\r
-               RECT arrRect[3] = { 0 };\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);\r
-               int nOldBtnPressed = m_nBtnPressed;\r
-               m_nBtnPressed = ::PtInRect(&arrRect[m_nBtnWasPressed], pt) ? m_nBtnWasPressed : -1;\r
-               if(nOldBtnPressed != m_nBtnPressed)\r
-               {\r
-                       CWindowDC dc(m_hWnd);\r
-                       pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);\r
-                       pT->_DrawMDIButton(dc, arrRect, (m_nBtnPressed != -1) ? m_nBtnPressed : nOldBtnPressed);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(!m_bChildMaximized || ::GetCapture() != m_hWnd || m_nBtnWasPressed == -1)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               ATLASSERT(_DebugCheckChild());\r
-\r
-               POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               ClientToScreen(&pt);\r
-               RECT rect = { 0 };\r
-               GetWindowRect(&rect);\r
-               pt.x -= rect.left;\r
-               pt.y -= rect.top;\r
-\r
-               int nBtn = m_nBtnWasPressed;\r
-               ReleaseCapture();\r
-\r
-               RECT arrRect[3] = { 0 };\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);\r
-               if(::PtInRect(&arrRect[nBtn], pt))\r
-               {\r
-                       switch(nBtn)\r
-                       {\r
-                       case 0:         // close\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                               ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonUp: close button\n"));\r
-#endif\r
-                               ::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, SC_CLOSE, 0L);\r
-                               break;\r
-                       case 1:         // restore\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                               ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonUp: restore button\n"));\r
-#endif\r
-                               ::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, SC_RESTORE, 0L);\r
-                               break;\r
-                       case 2:         // minimize\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                               ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - LButtonUp: minimize button\n"));\r
-#endif\r
-                               ::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, SC_MINIMIZE, 0L);\r
-                               break;\r
-                       default:\r
-                               break;\r
-                       }\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnNcLButtonDblClk(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(!m_bChildMaximized || m_nBtnWasPressed != -1)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               ATLASSERT(_DebugCheckChild());\r
-\r
-               POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               RECT rect = { 0 };\r
-               GetWindowRect(&rect);\r
-               pt.x -= rect.left;\r
-               pt.y -= rect.top;\r
-\r
-               RECT rcIcon = { 0 };\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_CalcIconRect(rect.right - rect.left, rect.bottom - rect.top, rcIcon, m_bLayoutRTL);\r
-               RECT arrRect[3] = { 0 };\r
-               pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect, m_bLayoutRTL);\r
-\r
-               if(::PtInRect(&rcIcon, pt))\r
-               {\r
-                       CMenuHandle menu = ::GetSystemMenu(m_hWndChildMaximized, FALSE);\r
-                       UINT uDefID = menu.GetMenuDefaultItem();\r
-                       if(uDefID == (UINT)-1)\r
-                               uDefID = SC_CLOSE;\r
-                       ::SendMessage(m_hWndChildMaximized, WM_SYSCOMMAND, uDefID, 0L);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_bChildMaximized)\r
-               {\r
-                       if(m_nBtnPressed != -1)\r
-                       {\r
-                               ATLASSERT(m_nBtnPressed == m_nBtnWasPressed);   // must be\r
-                               m_nBtnPressed = -1;\r
-                               RECT rect = { 0 };\r
-                               GetWindowRect(&rect);\r
-                               RECT arrRect[3] = { 0 };\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->_CalcBtnRects(rect.right - rect.left, rect.bottom - rect.top, arrRect);\r
-                               CWindowDC dc(m_hWnd);\r
-                               pT->_DrawMDIButton(dc, arrRect, m_nBtnWasPressed);\r
-                       }\r
-                       m_nBtnWasPressed = -1;\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-// Parent window message handlers\r
-       LRESULT OnParentActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               m_bParentActive = (LOWORD(wParam) != WA_INACTIVE);\r
-               RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-// MDI client window message handlers\r
-       LRESULT OnMDISetMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               m_wndMDIClient.DefWindowProc(uMsg, NULL, lParam);\r
-               HMENU hOldMenu = GetMenu();\r
-               BOOL bRet = AttachMenu((HMENU)wParam);\r
-               bRet;   // avoid level 4 warning\r
-               ATLASSERT(bRet);\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateRebarBandIdealSize();\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-               return (LRESULT)hOldMenu;\r
-       }\r
-\r
-// All messages from the message hook\r
-       LRESULT OnAllHookMessages(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_ProcessAllHookMessages(uMsg, wParam, lParam);\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-// Overrideables\r
-       // override this to provide different ideal size\r
-       void UpdateRebarBandIdealSize()\r
-       {\r
-               // assuming we are in a rebar, change ideal size to our size\r
-               // we hope that if we are not in a rebar, nCount will be 0\r
-               int nCount = (int)::SendMessage(GetParent(), RB_GETBANDCOUNT, 0, 0L);\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE };\r
-                       ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);\r
-                       if(rbi.hwndChild == m_hWnd)\r
-                       {\r
-                               rbi.fMask = RBBIM_IDEALSIZE;\r
-                               rbi.cxIdeal = m_bChildMaximized ? m_cxLeft + m_cxRight : 0;\r
-                               int nBtnCount = GetButtonCount();\r
-                               if(nBtnCount > 0)\r
-                               {\r
-                                       RECT rect = { 0 };\r
-                                       GetItemRect(nBtnCount - 1, &rect);\r
-                                       rbi.cxIdeal += rect.right;\r
-                               }\r
-                               ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);\r
-                               break;\r
-                       }\r
-               }\r
-       }\r
-\r
-       // all hook messages - check for the maximized MDI child window change\r
-       void _ProcessAllHookMessages(UINT uMsg, WPARAM /*wParam*/, LPARAM /*lParam*/)\r
-       {\r
-               if(uMsg == WM_MDIGETACTIVE || uMsg == WM_MDISETMENU)\r
-                       return;\r
-\r
-               BOOL bMaximized = FALSE;\r
-               HWND hWndChild = (HWND)::SendMessage(m_wndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);\r
-               bool bMaxOld = m_bChildMaximized;\r
-               m_bChildMaximized = (hWndChild != NULL && bMaximized);\r
-               HICON hIconOld = m_hIconChildMaximized;\r
-\r
-               if(m_bChildMaximized)\r
-               {\r
-                       if(m_hWndChildMaximized != hWndChild)\r
-                       {\r
-                               ATL::CWindow wnd = m_hWndChildMaximized = hWndChild;\r
-                               m_hIconChildMaximized = wnd.GetIcon(FALSE);\r
-                               if(m_hIconChildMaximized == NULL)\r
-                               {\r
-                                       m_hIconChildMaximized = wnd.GetIcon(TRUE);\r
-                                       if(m_hIconChildMaximized == NULL)\r
-                                       {\r
-                                               // no icon set with WM_SETICON, get the class one\r
-// need conditional code because types don't match in winuser.h\r
-#ifdef _WIN64\r
-                                               m_hIconChildMaximized = (HICON)::GetClassLongPtr(wnd, GCLP_HICONSM);\r
-#else\r
-                                               m_hIconChildMaximized = (HICON)LongToHandle(::GetClassLongPtr(wnd, GCLP_HICONSM));\r
-#endif\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       m_hWndChildMaximized = NULL;\r
-                       m_hIconChildMaximized = NULL;\r
-               }\r
-\r
-               if(bMaxOld != m_bChildMaximized)\r
-               {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-                       ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - All messages hook change: m_bChildMaximized = %s\n"), m_bChildMaximized ? "true" : "false");\r
-#endif\r
-                       // assuming we are in a rebar, change our size to accomodate new state\r
-                       // we hope that if we are not in a rebar, nCount will be 0\r
-                       int nCount = (int)::SendMessage(GetParent(), RB_GETBANDCOUNT, 0, 0L);\r
-                       int cxDiff = (m_bChildMaximized ? 1 : -1) * (m_cxLeft + m_cxRight);\r
-                       for(int i = 0; i < nCount; i++)\r
-                       {\r
-#if (_WIN32_IE >= 0x0500)\r
-                               REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_STYLE };\r
-                               ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);\r
-                               if(rbi.hwndChild == m_hWnd)\r
-                               {\r
-                                       if((rbi.fStyle & RBBS_USECHEVRON) != 0)\r
-                                       {\r
-                                               rbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;\r
-                                               rbi.cxMinChild += cxDiff;\r
-                                               rbi.cxIdeal += cxDiff;\r
-                                               ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);\r
-                                       }\r
-                                       break;\r
-                               }\r
-#elif (_WIN32_IE >= 0x0400)\r
-                               REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE };\r
-                               ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);\r
-                               if(rbi.hwndChild == m_hWnd)\r
-                               {\r
-                                       rbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;\r
-                                       rbi.cxMinChild += cxDiff;\r
-                                       rbi.cxIdeal += cxDiff;\r
-                                       ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);\r
-                                       break;\r
-                               }\r
-#else // (_WIN32_IE < 0x0400)\r
-                               REBARBANDINFO rbi = { RunTimeHelper::SizeOf_REBARBANDINFO(), RBBIM_CHILD | RBBIM_CHILDSIZE };\r
-                               ::SendMessage(GetParent(), RB_GETBANDINFO, i, (LPARAM)&rbi);\r
-                               if(rbi.hwndChild == m_hWnd)\r
-                               {\r
-                                       rbi.fMask = RBBIM_CHILDSIZE;\r
-                                       rbi.cxMinChild += cxDiff;\r
-                                       ::SendMessage(GetParent(), RB_SETBANDINFO, i, (LPARAM)&rbi);\r
-                                       break;\r
-                               }\r
-#endif // (_WIN32_IE < 0x0400)\r
-                       }\r
-               }\r
-\r
-               if(bMaxOld != m_bChildMaximized || hIconOld != m_hIconChildMaximized)\r
-               {\r
-                       // force size change and redraw everything\r
-                       RECT rect = { 0 };\r
-                       GetWindowRect(&rect);\r
-                       ::MapWindowPoints(NULL, GetParent(), (LPPOINT)&rect, 2);\r
-                       SetRedraw(FALSE);\r
-                       SetWindowPos(NULL, 0, 0, 1, 1, SWP_NOZORDER | SWP_NOMOVE);\r
-                       SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOMOVE);\r
-                       SetRedraw(TRUE);\r
-                       RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);\r
-               }\r
-       }\r
-\r
-// Implementation\r
-       void GetSystemSettings()\r
-       {\r
-#ifdef _CMDBAR_EXTRA_TRACE\r
-               ATLTRACE2(atlTraceUI, 0, _T("MDI CmdBar - GetSystemSettings\n"));\r
-#endif\r
-               _baseClass::GetSystemSettings();\r
-\r
-               NONCLIENTMETRICS info = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\r
-               BOOL bRet = ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0);\r
-               ATLASSERT(bRet);\r
-               if(bRet)\r
-               {\r
-                       m_cxIconWidth = ::GetSystemMetrics(SM_CXSMICON);\r
-                       m_cyIconHeight = ::GetSystemMetrics(SM_CYSMICON);\r
-                       m_cxLeft = m_cxIconWidth;\r
-\r
-#ifndef _WTL_NO_AUTO_THEME\r
-                       if(m_hTheme != NULL)\r
-                       {\r
-                               m_cxBtnWidth = info.iCaptionWidth - 2 * m_cxyOffset;\r
-                               m_cyBtnHeight = info.iCaptionHeight - 2 * m_cxyOffset;\r
-                               m_cxRight = 3 * m_cxBtnWidth;\r
-                       }\r
-                       else\r
-#endif // !_WTL_NO_AUTO_THEME\r
-                       {\r
-                               m_cxBtnWidth = info.iCaptionWidth - m_cxyOffset;\r
-                               m_cyBtnHeight = info.iCaptionHeight - 2 * m_cxyOffset;\r
-                               m_cxRight = 3 * m_cxBtnWidth + m_cxyOffset;\r
-                       }\r
-               }\r
-\r
-               RECT rect = { 0 };\r
-               GetClientRect(&rect);\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_AdjustBtnSize(rect.bottom);\r
-       }\r
-\r
-       void _AdjustBtnSize(int cyHeight)\r
-       {\r
-               if(cyHeight > 1 && m_cyBtnHeight > cyHeight)\r
-               {\r
-#ifndef _WTL_NO_AUTO_THEME\r
-                       if(m_hTheme != NULL)\r
-                       {\r
-                               m_cyBtnHeight = cyHeight;\r
-                               m_cxBtnWidth = cyHeight;\r
-                               m_cxRight = 3 * m_cxBtnWidth;\r
-                       }\r
-                       else\r
-#endif // !_WTL_NO_AUTO_THEME\r
-                       {\r
-                               m_cyBtnHeight = cyHeight;\r
-                               m_cxBtnWidth = cyHeight + m_cxyOffset;\r
-                               m_cxRight = 3 * m_cxBtnWidth + m_cxyOffset;\r
-                       }\r
-               }\r
-       }\r
-\r
-       void _CalcIconRect(int cxWidth, int cyHeight, RECT& rect, bool bInvertX = false) const\r
-       {\r
-               int xStart = (m_cxLeft - m_cxIconWidth) / 2;\r
-               if(xStart < 0)\r
-                       xStart = 0;\r
-               int yStart = (cyHeight - m_cyIconHeight) / 2;\r
-               if(yStart < 0)\r
-                       yStart = 0;\r
-\r
-               if(bInvertX)\r
-                       ::SetRect(&rect, cxWidth - (xStart + m_cxBtnWidth), yStart, cxWidth - xStart, yStart + m_cyBtnHeight);\r
-               else\r
-                       ::SetRect(&rect, xStart, yStart, xStart + m_cxBtnWidth, yStart + m_cyBtnHeight);\r
-       }\r
-\r
-       void _CalcBtnRects(int cxWidth, int cyHeight, RECT arrRect[3], bool bInvertX = false) const\r
-       {\r
-               int yStart = (cyHeight - m_cyBtnHeight) / 2;\r
-               if(yStart < 0)\r
-                       yStart = 0;\r
-\r
-               RECT rcBtn = { cxWidth - m_cxBtnWidth, yStart, cxWidth, yStart + m_cyBtnHeight };\r
-               int nDirection = -1;\r
-               if(bInvertX)\r
-               {\r
-                       ::SetRect(&rcBtn, 0, yStart, m_cxBtnWidth, yStart + m_cyBtnHeight);\r
-                       nDirection = 1;\r
-               }\r
-\r
-               arrRect[0] = rcBtn;\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               if(m_hTheme != NULL)\r
-                       ::OffsetRect(&rcBtn, nDirection * m_cxBtnWidth, 0);\r
-               else\r
-#endif // !_WTL_NO_AUTO_THEME\r
-                       ::OffsetRect(&rcBtn, nDirection * (m_cxBtnWidth + m_cxyOffset), 0);\r
-               arrRect[1] = rcBtn;\r
-               ::OffsetRect(&rcBtn, nDirection * m_cxBtnWidth, 0);\r
-               arrRect[2] = rcBtn;\r
-       }\r
-\r
-       void _DrawMDIButton(CWindowDC& dc, LPRECT pRects, int nBtn)\r
-       {\r
-#ifndef _WTL_NO_AUTO_THEME\r
-               if(m_hTheme != NULL)\r
-               {\r
-#ifndef TMSCHEMA_H\r
-                       const int WP_MDICLOSEBUTTON = 20;\r
-                       const int CBS_NORMAL = 1;\r
-                       const int CBS_PUSHED = 3;\r
-                       const int CBS_DISABLED = 4;\r
-                       const int WP_MDIRESTOREBUTTON = 22;\r
-                       const int RBS_NORMAL = 1;\r
-                       const int RBS_PUSHED = 3;\r
-                       const int RBS_DISABLED = 4;\r
-                       const int WP_MDIMINBUTTON = 16;\r
-                       const int MINBS_NORMAL = 1;\r
-                       const int MINBS_PUSHED = 3;\r
-                       const int MINBS_DISABLED = 4;\r
-#endif // TMSCHEMA_H\r
-                       if(nBtn == -1 || nBtn == 0)\r
-                               m_pfnDrawThemeBackground(m_hTheme, dc, WP_MDICLOSEBUTTON, m_bParentActive ? ((m_nBtnPressed == 0) ? CBS_PUSHED : CBS_NORMAL) : CBS_DISABLED, &pRects[0], NULL);\r
-                       if(nBtn == -1 || nBtn == 1)\r
-                               m_pfnDrawThemeBackground(m_hTheme, dc, WP_MDIRESTOREBUTTON, m_bParentActive ? ((m_nBtnPressed == 1) ? RBS_PUSHED : RBS_NORMAL) : RBS_DISABLED, &pRects[1], NULL);\r
-                       if(nBtn == -1 || nBtn == 2)\r
-                               m_pfnDrawThemeBackground(m_hTheme, dc, WP_MDIMINBUTTON, m_bParentActive ? ((m_nBtnPressed == 2) ? MINBS_PUSHED : MINBS_NORMAL) : MINBS_DISABLED, &pRects[2], NULL);\r
-               }\r
-               else\r
-#endif // !_WTL_NO_AUTO_THEME\r
-               {\r
-                       if(nBtn == -1 || nBtn == 0)\r
-                               dc.DrawFrameControl(&pRects[0], DFC_CAPTION, DFCS_CAPTIONCLOSE | ((m_nBtnPressed == 0) ? DFCS_PUSHED : 0));\r
-                       if(nBtn == -1 || nBtn == 1)\r
-                               dc.DrawFrameControl(&pRects[1], DFC_CAPTION, DFCS_CAPTIONRESTORE | ((m_nBtnPressed == 1) ? DFCS_PUSHED : 0));\r
-                       if(nBtn == -1 || nBtn == 2)\r
-                               dc.DrawFrameControl(&pRects[2], DFC_CAPTION, DFCS_CAPTIONMIN | ((m_nBtnPressed == 2) ? DFCS_PUSHED : 0));\r
-               }\r
-       }\r
-\r
-#ifndef _WTL_NO_AUTO_THEME\r
-       static UINT _GetThemeChangedMsg()\r
-       {\r
-#ifndef WM_THEMECHANGED\r
-               static const UINT WM_THEMECHANGED = 0x031A;\r
-#endif // !WM_THEMECHANGED\r
-               return WM_THEMECHANGED;\r
-       }\r
-\r
-       void _OpenThemeData()\r
-       {\r
-               ATLASSERT(m_hThemeDLL != NULL);\r
-\r
-               PFN_OpenThemeData pfnOpenThemeData = (PFN_OpenThemeData)::GetProcAddress(m_hThemeDLL, "OpenThemeData");\r
-               ATLASSERT(pfnOpenThemeData != NULL);\r
-               if(pfnOpenThemeData != NULL)\r
-                       m_hTheme = pfnOpenThemeData(m_hWnd, L"Window");\r
-       }\r
-\r
-       void _CloseThemeData()\r
-       {\r
-               ATLASSERT(m_hThemeDLL != NULL);\r
-\r
-               if(m_hTheme == NULL)\r
-                       return;   // nothing to do\r
-\r
-               PFN_CloseThemeData pfnCloseThemeData = (PFN_CloseThemeData)::GetProcAddress(m_hThemeDLL, "CloseThemeData");\r
-               ATLASSERT(pfnCloseThemeData != NULL);\r
-               if(pfnCloseThemeData != NULL)\r
-               {\r
-                       pfnCloseThemeData(m_hTheme);\r
-                       m_hTheme = NULL;\r
-               }\r
-       }\r
-#endif // !_WTL_NO_AUTO_THEME\r
-\r
-       bool _DebugCheckChild()\r
-       {\r
-#ifdef _DEBUG\r
-               BOOL bMaximized = FALSE;\r
-               HWND hWndChild = (HWND)::SendMessage(m_wndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);\r
-               return (bMaximized && hWndChild == m_hWndChildMaximized);\r
-#else // !_DEBUG\r
-               return true;\r
-#endif // !_DEBUG\r
-       }\r
-};\r
-\r
-class CMDICommandBarCtrl : public CMDICommandBarCtrlImpl<CMDICommandBarCtrl>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(_T("WTL_MDICommandBar"), GetWndClassName())\r
-};\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLCTRLW_H__\r
diff --git a/WTL80/include/atlctrlx.h b/WTL80/include/atlctrlx.h
deleted file mode 100644 (file)
index bd78e3f..0000000
+++ /dev/null
@@ -1,4827 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLCTRLX_H__\r
-#define __ATLCTRLX_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlctrlx.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLCTRLS_H__\r
-       #error atlctrlx.h requires atlctrls.h to be included first\r
-#endif\r
-\r
-#ifndef WM_UPDATEUISTATE\r
-  #define WM_UPDATEUISTATE                0x0128\r
-#endif // !WM_UPDATEUISTATE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CBitmapButtonImpl<T, TBase, TWinTraits>\r
-// CBitmapButton\r
-// CCheckListViewCtrlImpl<T, TBase, TWinTraits>\r
-// CCheckListViewCtrl\r
-// CHyperLinkImpl<T, TBase, TWinTraits>\r
-// CHyperLink\r
-// CWaitCursor\r
-// CCustomWaitCursor\r
-// CMultiPaneStatusBarCtrlImpl<T, TBase>\r
-// CMultiPaneStatusBarCtrl\r
-// CPaneContainerImpl<T, TBase, TWinTraits>\r
-// CPaneContainer\r
-// CSortListViewImpl<T>\r
-// CSortListViewCtrlImpl<T, TBase, TWinTraits>\r
-// CSortListViewCtrl\r
-// CTabViewImpl<T, TBase, TWinTraits>\r
-// CTabView\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBitmapButton - bitmap button implementation\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-// bitmap button extended styles\r
-#define BMPBTN_HOVER           0x00000001\r
-#define BMPBTN_AUTO3D_SINGLE   0x00000002\r
-#define BMPBTN_AUTO3D_DOUBLE   0x00000004\r
-#define BMPBTN_AUTOSIZE                0x00000008\r
-#define BMPBTN_SHAREIMAGELISTS 0x00000010\r
-#define BMPBTN_AUTOFIRE                0x00000020\r
-\r
-template <class T, class TBase = CButton, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CBitmapButtonImpl : public ATL::CWindowImpl< T, TBase, TWinTraits>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())\r
-\r
-       enum\r
-       {\r
-               _nImageNormal = 0,\r
-               _nImagePushed,\r
-               _nImageFocusOrHover,\r
-               _nImageDisabled,\r
-\r
-               _nImageCount = 4,\r
-       };\r
-\r
-       enum\r
-       {\r
-               ID_TIMER_FIRST = 1000,\r
-               ID_TIMER_REPEAT = 1001\r
-       };\r
-\r
-       // Bitmap button specific extended styles\r
-       DWORD m_dwExtendedStyle;\r
-\r
-       CImageList m_ImageList;\r
-       int m_nImage[_nImageCount];\r
-\r
-       CToolTipCtrl m_tip;\r
-       LPTSTR m_lpstrToolTipText;\r
-\r
-       // Internal states\r
-       unsigned m_fMouseOver:1;\r
-       unsigned m_fFocus:1;\r
-       unsigned m_fPressed:1;\r
-\r
-\r
-// Constructor/Destructor\r
-       CBitmapButtonImpl(DWORD dwExtendedStyle = BMPBTN_AUTOSIZE, HIMAGELIST hImageList = NULL) : \r
-                       m_ImageList(hImageList), m_dwExtendedStyle(dwExtendedStyle), \r
-                       m_lpstrToolTipText(NULL),\r
-                       m_fMouseOver(0), m_fFocus(0), m_fPressed(0)\r
-       {\r
-               m_nImage[_nImageNormal] = -1;\r
-               m_nImage[_nImagePushed] = -1;\r
-               m_nImage[_nImageFocusOrHover] = -1;\r
-               m_nImage[_nImageDisabled] = -1;\r
-       }\r
-\r
-       ~CBitmapButtonImpl()\r
-       {\r
-               if((m_dwExtendedStyle & BMPBTN_SHAREIMAGELISTS) == 0)\r
-                       m_ImageList.Destroy();\r
-               delete [] m_lpstrToolTipText;\r
-       }\r
-\r
-       // overridden to provide proper initialization\r
-       BOOL SubclassWindow(HWND hWnd)\r
-       {\r
-#if (_MSC_VER >= 1300)\r
-               BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits>::SubclassWindow(hWnd);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImpl< T, TBase, TWinTraits>   _baseClass;\r
-               BOOL bRet = _baseClass::SubclassWindow(hWnd);\r
-#endif // !(_MSC_VER >= 1300)\r
-               if(bRet)\r
-                       Init();\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       DWORD GetBitmapButtonExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-       DWORD SetBitmapButtonExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               return dwPrevStyle;\r
-       }\r
-\r
-       HIMAGELIST GetImageList() const\r
-       {\r
-               return m_ImageList;\r
-       }\r
-\r
-       HIMAGELIST SetImageList(HIMAGELIST hImageList)\r
-       {\r
-               HIMAGELIST hImageListPrev = m_ImageList;\r
-               m_ImageList = hImageList;\r
-               if((m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0 && ::IsWindow(m_hWnd))\r
-                       SizeToImage();\r
-               return hImageListPrev;\r
-       }\r
-\r
-       int GetToolTipTextLength() const\r
-       {\r
-               return (m_lpstrToolTipText == NULL) ? -1 : lstrlen(m_lpstrToolTipText);\r
-       }\r
-\r
-       bool GetToolTipText(LPTSTR lpstrText, int nLength) const\r
-       {\r
-               ATLASSERT(lpstrText != NULL);\r
-               if(m_lpstrToolTipText == NULL)\r
-                       return false;\r
-\r
-               errno_t nRet = SecureHelper::strncpy_x(lpstrText, nLength, m_lpstrToolTipText, _TRUNCATE);\r
-\r
-               return (nRet == 0 || nRet == STRUNCATE);\r
-       }\r
-\r
-       bool SetToolTipText(LPCTSTR lpstrText)\r
-       {\r
-               if(m_lpstrToolTipText != NULL)\r
-               {\r
-                       delete [] m_lpstrToolTipText;\r
-                       m_lpstrToolTipText = NULL;\r
-               }\r
-\r
-               if(lpstrText == NULL)\r
-               {\r
-                       if(m_tip.IsWindow())\r
-                               m_tip.Activate(FALSE);\r
-                       return true;\r
-               }\r
-\r
-               int cchLen = lstrlen(lpstrText) + 1;\r
-               ATLTRY(m_lpstrToolTipText = new TCHAR[cchLen]);\r
-               if(m_lpstrToolTipText == NULL)\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(m_lpstrToolTipText, cchLen, lpstrText);\r
-               if(m_tip.IsWindow())\r
-               {\r
-                       m_tip.Activate(TRUE);\r
-                       m_tip.AddTool(m_hWnd, m_lpstrToolTipText);\r
-               }\r
-\r
-               return true;\r
-       }\r
-\r
-// Operations\r
-       void SetImages(int nNormal, int nPushed = -1, int nFocusOrHover = -1, int nDisabled = -1)\r
-       {\r
-               if(nNormal != -1)\r
-                       m_nImage[_nImageNormal] = nNormal;\r
-               if(nPushed != -1)\r
-                       m_nImage[_nImagePushed] = nPushed;\r
-               if(nFocusOrHover != -1)\r
-                       m_nImage[_nImageFocusOrHover] = nFocusOrHover;\r
-               if(nDisabled != -1)\r
-                       m_nImage[_nImageDisabled] = nDisabled;\r
-       }\r
-\r
-       BOOL SizeToImage()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd) && m_ImageList.m_hImageList != NULL);\r
-               int cx = 0;\r
-               int cy = 0;\r
-               if(!m_ImageList.GetIconSize(cx, cy))\r
-                       return FALSE;\r
-               return ResizeClient(cx, cy);\r
-       }\r
-\r
-// Overrideables\r
-       void DoPaint(CDCHandle dc)\r
-       {\r
-               ATLASSERT(m_ImageList.m_hImageList != NULL);   // image list must be set\r
-               ATLASSERT(m_nImage[0] != -1);                  // main bitmap must be set\r
-\r
-               // set bitmap according to the current button state\r
-               int nImage = -1;\r
-               bool bHover = IsHoverMode();\r
-               if(!IsWindowEnabled())\r
-                       nImage = m_nImage[_nImageDisabled];\r
-               else if(m_fPressed == 1)\r
-                       nImage = m_nImage[_nImagePushed];\r
-               else if((!bHover && m_fFocus == 1) || (bHover && m_fMouseOver == 1))\r
-                       nImage = m_nImage[_nImageFocusOrHover];\r
-               if(nImage == -1)   // not there, use default one\r
-                       nImage = m_nImage[_nImageNormal];\r
-\r
-               // draw the button image\r
-               int xyPos = 0;\r
-               if((m_fPressed == 1) && ((m_dwExtendedStyle & (BMPBTN_AUTO3D_SINGLE | BMPBTN_AUTO3D_DOUBLE)) != 0) && (m_nImage[_nImagePushed] == -1))\r
-                       xyPos = 1;\r
-               m_ImageList.Draw(dc, nImage, xyPos, xyPos, ILD_NORMAL);\r
-\r
-               // draw 3D border if required\r
-               if((m_dwExtendedStyle & (BMPBTN_AUTO3D_SINGLE | BMPBTN_AUTO3D_DOUBLE)) != 0)\r
-               {\r
-                       RECT rect;\r
-                       GetClientRect(&rect);\r
-\r
-                       if(m_fPressed == 1)\r
-                               dc.DrawEdge(&rect, ((m_dwExtendedStyle & BMPBTN_AUTO3D_SINGLE) != 0) ? BDR_SUNKENOUTER : EDGE_SUNKEN, BF_RECT);\r
-                       else if(!bHover || m_fMouseOver == 1)\r
-                               dc.DrawEdge(&rect, ((m_dwExtendedStyle & BMPBTN_AUTO3D_SINGLE) != 0) ? BDR_RAISEDINNER : EDGE_RAISED, BF_RECT);\r
-\r
-                       if(!bHover && m_fFocus == 1)\r
-                       {\r
-                               ::InflateRect(&rect, -2 * ::GetSystemMetrics(SM_CXEDGE), -2 * ::GetSystemMetrics(SM_CYEDGE));\r
-                               dc.DrawFocusRect(&rect);\r
-                       }\r
-               }\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CBitmapButtonImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               MESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseMessage)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnFocus)\r
-               MESSAGE_HANDLER(WM_KILLFOCUS, OnFocus)\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDblClk)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\r
-               MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\r
-               MESSAGE_HANDLER(WM_ENABLE, OnEnable)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\r
-               MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)\r
-               MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\r
-               MESSAGE_HANDLER(WM_KEYUP, OnKeyUp)\r
-               MESSAGE_HANDLER(WM_TIMER, OnTimer)\r
-               MESSAGE_HANDLER(WM_UPDATEUISTATE, OnUpdateUiState)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               Init();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_tip.IsWindow())\r
-               {\r
-                       m_tip.DestroyWindow();\r
-                       m_tip.m_hWnd = NULL;\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               MSG msg = { m_hWnd, uMsg, wParam, lParam };\r
-               if(m_tip.IsWindow())\r
-                       m_tip.RelayEvent(&msg);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background needed\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if(wParam != NULL)\r
-               {\r
-                       pT->DoPaint((HDC)wParam);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(m_hWnd);\r
-                       pT->DoPaint(dc.m_hDC);\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnFocus(UINT uMsg, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               m_fFocus = (uMsg == WM_SETFOCUS) ? 1 : 0;\r
-               Invalidate();\r
-               UpdateWindow();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = 0;\r
-               if(IsHoverMode())\r
-                       SetCapture();\r
-               else\r
-                       lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               if(::GetCapture() == m_hWnd)\r
-               {\r
-                       m_fPressed = 1;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               if((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0)\r
-               {\r
-                       int nElapse = 250;\r
-                       int nDelay = 0;\r
-                       if(::SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &nDelay, 0))\r
-                               nElapse += nDelay * 250;   // all milli-seconds\r
-                       SetTimer(ID_TIMER_FIRST, nElapse);\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnLButtonDblClk(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = 0;\r
-               if(!IsHoverMode())\r
-                       lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               if(::GetCapture() != m_hWnd)\r
-                       SetCapture();\r
-               if(m_fPressed == 0)\r
-               {\r
-                       m_fPressed = 1;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = 0;\r
-               bool bHover = IsHoverMode();\r
-               if(!bHover)\r
-                       lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               if(::GetCapture() == m_hWnd)\r
-               {\r
-                       if(bHover && m_fPressed == 1)\r
-                               ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);\r
-                       ::ReleaseCapture();\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_fPressed == 1)\r
-               {\r
-                       m_fPressed = 0;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnEnable(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               Invalidate();\r
-               UpdateWindow();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(::GetCapture() == m_hWnd)\r
-               {\r
-                       POINT ptCursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-                       ClientToScreen(&ptCursor);\r
-                       RECT rect = { 0 };\r
-                       GetWindowRect(&rect);\r
-                       unsigned int uPressed = ::PtInRect(&rect, ptCursor) ? 1 : 0;\r
-                       if(m_fPressed != uPressed)\r
-                       {\r
-                               m_fPressed = uPressed;\r
-                               Invalidate();\r
-                               UpdateWindow();\r
-                       }\r
-               }\r
-               else if(IsHoverMode() && m_fMouseOver == 0)\r
-               {\r
-                       m_fMouseOver = 1;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-                       StartTrackMouseLeave();\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(m_fMouseOver == 1)\r
-               {\r
-                       m_fMouseOver = 0;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(wParam == VK_SPACE && IsHoverMode())\r
-                       return 0;   // ignore if in hover mode\r
-               if(wParam == VK_SPACE && m_fPressed == 0)\r
-               {\r
-                       m_fPressed = 1;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnKeyUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(wParam == VK_SPACE && IsHoverMode())\r
-                       return 0;   // ignore if in hover mode\r
-               if(wParam == VK_SPACE && m_fPressed == 1)\r
-               {\r
-                       m_fPressed = 0;\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT((m_dwExtendedStyle & BMPBTN_AUTOFIRE) != 0);\r
-               switch(wParam)   // timer ID\r
-               {\r
-               case ID_TIMER_FIRST:\r
-                       KillTimer(ID_TIMER_FIRST);\r
-                       if(m_fPressed == 1)\r
-                       {\r
-                               ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);\r
-                               int nElapse = 250;\r
-                               int nRepeat = 40;\r
-                               if(::SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &nRepeat, 0))\r
-                                       nElapse = 10000 / (10 * nRepeat + 25);   // milli-seconds, approximated\r
-                               SetTimer(ID_TIMER_REPEAT, nElapse);\r
-                       }\r
-                       break;\r
-               case ID_TIMER_REPEAT:\r
-                       if(m_fPressed == 1)\r
-                               ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);\r
-                       else if(::GetCapture() != m_hWnd)\r
-                               KillTimer(ID_TIMER_REPEAT);\r
-                       break;\r
-               default:        // not our timer\r
-                       break;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnUpdateUiState(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               // If the control is subclassed or superclassed, this message can cause\r
-               // repainting without WM_PAINT. We don't use this state, so just do nothing.\r
-               return 0;\r
-       }\r
-\r
-// Implementation\r
-       void Init()\r
-       {\r
-               // We need this style to prevent Windows from painting the button\r
-               ModifyStyle(0, BS_OWNERDRAW);\r
-\r
-               // create a tool tip\r
-               m_tip.Create(m_hWnd);\r
-               ATLASSERT(m_tip.IsWindow());\r
-               if(m_tip.IsWindow() && m_lpstrToolTipText != NULL)\r
-               {\r
-                       m_tip.Activate(TRUE);\r
-                       m_tip.AddTool(m_hWnd, m_lpstrToolTipText);\r
-               }\r
-\r
-               if(m_ImageList.m_hImageList != NULL && (m_dwExtendedStyle & BMPBTN_AUTOSIZE) != 0)\r
-                       SizeToImage();\r
-       }\r
-\r
-       BOOL StartTrackMouseLeave()\r
-       {\r
-               TRACKMOUSEEVENT tme = { 0 };\r
-               tme.cbSize = sizeof(tme);\r
-               tme.dwFlags = TME_LEAVE;\r
-               tme.hwndTrack = m_hWnd;\r
-               return _TrackMouseEvent(&tme);\r
-       }\r
-\r
-       bool IsHoverMode() const\r
-       {\r
-               return ((m_dwExtendedStyle & BMPBTN_HOVER) != 0);\r
-       }\r
-};\r
-\r
-\r
-class CBitmapButton : public CBitmapButtonImpl<CBitmapButton>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(_T("WTL_BitmapButton"), GetWndClassName())\r
-\r
-       CBitmapButton(DWORD dwExtendedStyle = BMPBTN_AUTOSIZE, HIMAGELIST hImageList = NULL) : \r
-               CBitmapButtonImpl<CBitmapButton>(dwExtendedStyle, hImageList)\r
-       { }\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCheckListCtrlView - list view control with check boxes\r
-\r
-template <DWORD t_dwStyle, DWORD t_dwExStyle, DWORD t_dwExListViewStyle>\r
-class CCheckListViewCtrlImplTraits\r
-{\r
-public:\r
-       static DWORD GetWndStyle(DWORD dwStyle)\r
-       {\r
-               return (dwStyle == 0) ? t_dwStyle : dwStyle;\r
-       }\r
-\r
-       static DWORD GetWndExStyle(DWORD dwExStyle)\r
-       {\r
-               return (dwExStyle == 0) ? t_dwExStyle : dwExStyle;\r
-       }\r
-\r
-       static DWORD GetExtendedLVStyle()\r
-       {\r
-               return t_dwExListViewStyle;\r
-       }\r
-};\r
-\r
-typedef CCheckListViewCtrlImplTraits<WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT>   CCheckListViewCtrlTraits;\r
-\r
-template <class T, class TBase = CListViewCtrl, class TWinTraits = CCheckListViewCtrlTraits>\r
-class ATL_NO_VTABLE CCheckListViewCtrlImpl : public ATL::CWindowImpl<T, TBase, TWinTraits>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())\r
-\r
-// Attributes\r
-       static DWORD GetExtendedLVStyle()\r
-       {\r
-               return TWinTraits::GetExtendedLVStyle();\r
-       }\r
-\r
-// Operations\r
-       BOOL SubclassWindow(HWND hWnd)\r
-       {\r
-#if (_MSC_VER >= 1300)\r
-               BOOL bRet = ATL::CWindowImplBaseT< TBase, TWinTraits>::SubclassWindow(hWnd);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImplBaseT< TBase, TWinTraits>   _baseClass;\r
-               BOOL bRet = _baseClass::SubclassWindow(hWnd);\r
-#endif // !(_MSC_VER >= 1300)\r
-               if(bRet)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT;\r
-                       ATLASSERT((pT->GetExtendedLVStyle() & LVS_EX_CHECKBOXES) != 0);\r
-                       SetExtendedListViewStyle(pT->GetExtendedLVStyle());\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       void CheckSelectedItems(int nCurrItem)\r
-       {\r
-               // first check if this item is selected\r
-               LVITEM lvi = { 0 };\r
-               lvi.iItem = nCurrItem;\r
-               lvi.iSubItem = 0;\r
-               lvi.mask = LVIF_STATE;\r
-               lvi.stateMask = LVIS_SELECTED;\r
-               GetItem(&lvi);\r
-               // if item is not selected, don't do anything\r
-               if(!(lvi.state & LVIS_SELECTED))\r
-                       return;\r
-               // new check state will be reverse of the current state,\r
-               BOOL bCheck = !GetCheckState(nCurrItem);\r
-               int nItem = -1;\r
-               int nOldItem = -1;\r
-               while((nItem = GetNextItem(nOldItem, LVNI_SELECTED)) != -1)\r
-               {\r
-                       if(nItem != nCurrItem)\r
-                               SetCheckState(nItem, bCheck);\r
-                       nOldItem = nItem;\r
-               }\r
-       }\r
-\r
-// Implementation\r
-       BEGIN_MSG_MAP(CCheckListViewCtrlImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               // first let list view control initialize everything\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               T* pT = static_cast<T*>(this);\r
-               pT;\r
-               ATLASSERT((pT->GetExtendedLVStyle() & LVS_EX_CHECKBOXES) != 0);\r
-               SetExtendedListViewStyle(pT->GetExtendedLVStyle());\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               POINT ptMsg = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               LVHITTESTINFO lvh = { 0 };\r
-               lvh.pt = ptMsg;\r
-               if(HitTest(&lvh) != -1 && lvh.flags == LVHT_ONITEMSTATEICON && ::GetKeyState(VK_CONTROL) >= 0)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->CheckSelectedItems(lvh.iItem);\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(wParam == VK_SPACE)\r
-               {\r
-                       int nCurrItem = GetNextItem(-1, LVNI_FOCUSED);\r
-                       if(nCurrItem != -1  && ::GetKeyState(VK_CONTROL) >= 0)\r
-                       {\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->CheckSelectedItems(nCurrItem);\r
-                       }\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-};\r
-\r
-class CCheckListViewCtrl : public CCheckListViewCtrlImpl<CCheckListViewCtrl>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(_T("WTL_CheckListView"), GetWndClassName())\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CHyperLink - hyper link control implementation\r
-\r
-#if (WINVER < 0x0500) && !defined(_WIN32_WCE)\r
-__declspec(selectany) struct\r
-{\r
-       enum { cxWidth = 32, cyHeight = 32 };\r
-       int xHotSpot;\r
-       int yHotSpot;\r
-       unsigned char arrANDPlane[cxWidth * cyHeight / 8];\r
-       unsigned char arrXORPlane[cxWidth * cyHeight / 8];\r
-} _AtlHyperLink_CursorData = \r
-{\r
-       5, 0, \r
-       {\r
-               0xF9, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, \r
-               0xF0, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xFF, 0xFF, 0xF0, 0x07, 0xFF, 0xFF, 0xF0, 0x01, 0xFF, 0xFF, \r
-               0xF0, 0x00, 0xFF, 0xFF, 0x10, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x7F, 0xFF, \r
-               0x80, 0x00, 0x7F, 0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x7F, 0xFF, \r
-               0xE0, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xF8, 0x01, 0xFF, 0xFF, \r
-               0xF8, 0x01, 0xFF, 0xFF, 0xF8, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \r
-               0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \r
-               0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF\r
-       },\r
-       {\r
-               0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, \r
-               0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0xC0, 0x00, 0x00, 0x06, 0xD8, 0x00, 0x00, \r
-               0x06, 0xDA, 0x00, 0x00, 0x06, 0xDB, 0x00, 0x00, 0x67, 0xFB, 0x00, 0x00, 0x77, 0xFF, 0x00, 0x00, \r
-               0x37, 0xFF, 0x00, 0x00, 0x17, 0xFF, 0x00, 0x00, 0x1F, 0xFF, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, \r
-               0x0F, 0xFE, 0x00, 0x00, 0x07, 0xFE, 0x00, 0x00, 0x07, 0xFE, 0x00, 0x00, 0x03, 0xFC, 0x00, 0x00, \r
-               0x03, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \r
-               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \r
-               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-       }\r
-};\r
-#endif // (WINVER < 0x0500) && !defined(_WIN32_WCE)\r
-\r
-#define HLINK_UNDERLINED      0x00000000\r
-#define HLINK_NOTUNDERLINED   0x00000001\r
-#define HLINK_UNDERLINEHOVER  0x00000002\r
-#define HLINK_COMMANDBUTTON   0x00000004\r
-#define HLINK_NOTIFYBUTTON    0x0000000C\r
-#define HLINK_USETAGS         0x00000010\r
-#define HLINK_USETAGSBOLD     0x00000030\r
-#define HLINK_NOTOOLTIP       0x00000040\r
-\r
-// Notes:\r
-// - HLINK_USETAGS and HLINK_USETAGSBOLD are always left-aligned\r
-// - When HLINK_USETAGSBOLD is used, the underlined styles will be ignored\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CHyperLinkImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >\r
-{\r
-public:\r
-       LPTSTR m_lpstrLabel;\r
-       LPTSTR m_lpstrHyperLink;\r
-\r
-       HCURSOR m_hCursor;\r
-       HFONT m_hFont;\r
-       HFONT m_hFontNormal;\r
-\r
-       RECT m_rcLink;\r
-#ifndef _WIN32_WCE\r
-       CToolTipCtrl m_tip;\r
-#endif // !_WIN32_WCE\r
-\r
-       COLORREF m_clrLink;\r
-       COLORREF m_clrVisited;\r
-\r
-       DWORD m_dwExtendedStyle;   // Hyper Link specific extended styles\r
-\r
-       bool m_bPaintLabel:1;\r
-       bool m_bVisited:1;\r
-       bool m_bHover:1;\r
-       bool m_bInternalLinkFont:1;\r
-\r
-\r
-// Constructor/Destructor\r
-       CHyperLinkImpl(DWORD dwExtendedStyle = HLINK_UNDERLINED) : \r
-                       m_lpstrLabel(NULL), m_lpstrHyperLink(NULL),\r
-                       m_hCursor(NULL), m_hFont(NULL), m_hFontNormal(NULL),\r
-                       m_clrLink(RGB(0, 0, 255)), m_clrVisited(RGB(128, 0, 128)),\r
-                       m_dwExtendedStyle(dwExtendedStyle),\r
-                       m_bPaintLabel(true), m_bVisited(false),\r
-                       m_bHover(false), m_bInternalLinkFont(false)\r
-       {\r
-               ::SetRectEmpty(&m_rcLink);\r
-       }\r
-\r
-       ~CHyperLinkImpl()\r
-       {\r
-               delete [] m_lpstrLabel;\r
-               delete [] m_lpstrHyperLink;\r
-               if(m_bInternalLinkFont && m_hFont != NULL)\r
-                       ::DeleteObject(m_hFont);\r
-#if (WINVER < 0x0500) && !defined(_WIN32_WCE)\r
-               // It was created, not loaded, so we have to destroy it\r
-               if(m_hCursor != NULL)\r
-                       ::DestroyCursor(m_hCursor);\r
-#endif // (WINVER < 0x0500) && !defined(_WIN32_WCE)\r
-       }\r
-\r
-// Attributes\r
-       DWORD GetHyperLinkExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-       DWORD SetHyperLinkExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               return dwPrevStyle;\r
-       }\r
-\r
-       bool GetLabel(LPTSTR lpstrBuffer, int nLength) const\r
-       {\r
-               if(m_lpstrLabel == NULL)\r
-                       return false;\r
-               ATLASSERT(lpstrBuffer != NULL);\r
-               if(nLength <= lstrlen(m_lpstrLabel))\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(lpstrBuffer, nLength, m_lpstrLabel);\r
-\r
-               return true;\r
-       }\r
-\r
-       bool SetLabel(LPCTSTR lpstrLabel)\r
-       {\r
-               delete [] m_lpstrLabel;\r
-               m_lpstrLabel = NULL;\r
-               int cchLen = lstrlen(lpstrLabel) + 1;\r
-               ATLTRY(m_lpstrLabel = new TCHAR[cchLen]);\r
-               if(m_lpstrLabel == NULL)\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(m_lpstrLabel, cchLen, lpstrLabel);\r
-               T* pT = static_cast<T*>(this);\r
-               pT->CalcLabelRect();\r
-\r
-               if(m_hWnd != NULL)\r
-                       SetWindowText(lpstrLabel);   // Set this for accessibility\r
-\r
-               return true;\r
-       }\r
-\r
-       bool GetHyperLink(LPTSTR lpstrBuffer, int nLength) const\r
-       {\r
-               if(m_lpstrHyperLink == NULL)\r
-                       return false;\r
-               ATLASSERT(lpstrBuffer != NULL);\r
-               if(nLength <= lstrlen(m_lpstrHyperLink))\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(lpstrBuffer, nLength, m_lpstrHyperLink);\r
-\r
-               return true;\r
-       }\r
-\r
-       bool SetHyperLink(LPCTSTR lpstrLink)\r
-       {\r
-               delete [] m_lpstrHyperLink;\r
-               m_lpstrHyperLink = NULL;\r
-               int cchLen = lstrlen(lpstrLink) + 1;\r
-               ATLTRY(m_lpstrHyperLink = new TCHAR[cchLen]);\r
-               if(m_lpstrHyperLink == NULL)\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(m_lpstrHyperLink, cchLen, lpstrLink);\r
-               if(m_lpstrLabel == NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->CalcLabelRect();\r
-               }\r
-#ifndef _WIN32_WCE\r
-               if(m_tip.IsWindow())\r
-               {\r
-                       m_tip.Activate(TRUE);\r
-                       m_tip.AddTool(m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);\r
-               }\r
-#endif // !_WIN32_WCE\r
-               return true;\r
-       }\r
-\r
-       HFONT GetLinkFont() const\r
-       {\r
-               return m_hFont;\r
-       }\r
-\r
-       void SetLinkFont(HFONT hFont)\r
-       {\r
-               if(m_bInternalLinkFont && m_hFont != NULL)\r
-               {\r
-                       ::DeleteObject(m_hFont);\r
-                       m_bInternalLinkFont = false;\r
-               }\r
-               m_hFont = hFont;\r
-       }\r
-\r
-       int GetIdealHeight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               if(m_lpstrLabel == NULL && m_lpstrHyperLink == NULL)\r
-                       return -1;\r
-               if(!m_bPaintLabel)\r
-                       return -1;\r
-\r
-               CClientDC dc(m_hWnd);\r
-               RECT rect = { 0 };\r
-               GetClientRect(&rect);\r
-               HFONT hFontOld = dc.SelectFont(m_hFontNormal);\r
-               RECT rcText = rect;\r
-               dc.DrawText(_T("NS"), -1, &rcText, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-               dc.SelectFont(m_hFont);\r
-               RECT rcLink = rect;\r
-               dc.DrawText(_T("NS"), -1, &rcLink, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-               dc.SelectFont(hFontOld);\r
-               return max(rcText.bottom - rcText.top, rcLink.bottom - rcLink.top);\r
-       }\r
-\r
-       bool GetIdealSize(SIZE& size) const\r
-       {\r
-               int cx = 0, cy = 0;\r
-               bool bRet = GetIdealSize(cx, cy);\r
-               if(bRet)\r
-               {\r
-                       size.cx = cx;\r
-                       size.cy = cy;\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       bool GetIdealSize(int& cx, int& cy) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               if(m_lpstrLabel == NULL && m_lpstrHyperLink == NULL)\r
-                       return false;\r
-               if(!m_bPaintLabel)\r
-                       return false;\r
-\r
-               CClientDC dc(m_hWnd);\r
-               RECT rcClient = { 0 };\r
-               GetClientRect(&rcClient);\r
-               RECT rcAll = rcClient;\r
-\r
-               if(IsUsingTags())\r
-               {\r
-                       // find tags and label parts\r
-                       LPTSTR lpstrLeft = NULL;\r
-                       int cchLeft = 0;\r
-                       LPTSTR lpstrLink = NULL;\r
-                       int cchLink = 0;\r
-                       LPTSTR lpstrRight = NULL;\r
-                       int cchRight = 0;\r
-\r
-                       const T* pT = static_cast<const T*>(this);\r
-                       pT->CalcLabelParts(lpstrLeft, cchLeft, lpstrLink, cchLink, lpstrRight, cchRight);\r
-\r
-                       // get label part rects\r
-                       HFONT hFontOld = dc.SelectFont(m_hFontNormal);\r
-                       RECT rcLeft = rcClient;\r
-                       dc.DrawText(lpstrLeft, cchLeft, &rcLeft, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-\r
-                       dc.SelectFont(m_hFont);\r
-                       RECT rcLink = { rcLeft.right, rcLeft.top, rcClient.right, rcClient.bottom };\r
-                       dc.DrawText(lpstrLink, cchLink, &rcLink, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-\r
-                       dc.SelectFont(m_hFontNormal);\r
-                       RECT rcRight = { rcLink.right, rcLink.top, rcClient.right, rcClient.bottom };\r
-                       dc.DrawText(lpstrRight, cchRight, &rcRight, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-\r
-                       dc.SelectFont(hFontOld);\r
-\r
-                       int cyMax = max(rcLeft.bottom, max(rcLink.bottom, rcRight.bottom));\r
-                       ::SetRect(&rcAll, rcLeft.left, rcLeft.top, rcRight.right, cyMax);\r
-               }\r
-               else\r
-               {\r
-                       HFONT hOldFont = NULL;\r
-                       if(m_hFont != NULL)\r
-                               hOldFont = dc.SelectFont(m_hFont);\r
-                       LPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\r
-                       DWORD dwStyle = GetStyle();\r
-                       int nDrawStyle = DT_LEFT;\r
-                       if (dwStyle & SS_CENTER)\r
-                               nDrawStyle = DT_CENTER;\r
-                       else if (dwStyle & SS_RIGHT)\r
-                               nDrawStyle = DT_RIGHT;\r
-                       dc.DrawText(lpstrText, -1, &rcAll, nDrawStyle | DT_WORDBREAK | DT_CALCRECT);\r
-                       if(m_hFont != NULL)\r
-                               dc.SelectFont(hOldFont);\r
-                       if (dwStyle & SS_CENTER)\r
-                       {\r
-                               int dx = (rcClient.right - rcAll.right) / 2;\r
-                               ::OffsetRect(&rcAll, dx, 0);\r
-                       }\r
-                       else if (dwStyle & SS_RIGHT)\r
-                       {\r
-                               int dx = rcClient.right - rcAll.right;\r
-                               ::OffsetRect(&rcAll, dx, 0);\r
-                       }\r
-               }\r
-\r
-               cx = rcAll.right - rcAll.left;\r
-               cy = rcAll.bottom - rcAll.top;\r
-\r
-               return true;\r
-       }\r
-\r
-       // for command buttons only\r
-       bool GetToolTipText(LPTSTR lpstrBuffer, int nLength) const\r
-       {\r
-               ATLASSERT(IsCommandButton());\r
-               return GetHyperLink(lpstrBuffer, nLength);\r
-       }\r
-\r
-       bool SetToolTipText(LPCTSTR lpstrToolTipText)\r
-       {\r
-               ATLASSERT(IsCommandButton());\r
-               return SetHyperLink(lpstrToolTipText);\r
-       }\r
-\r
-// Operations\r
-       BOOL SubclassWindow(HWND hWnd)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ATLASSERT(::IsWindow(hWnd));\r
-#if (_MSC_VER >= 1300)\r
-               BOOL bRet = ATL::CWindowImpl< T, TBase, TWinTraits>::SubclassWindow(hWnd);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImpl< T, TBase, TWinTraits>   _baseClass;\r
-               BOOL bRet = _baseClass::SubclassWindow(hWnd);\r
-#endif // !(_MSC_VER >= 1300)\r
-               if(bRet)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->Init();\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       bool Navigate()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               bool bRet = true;\r
-               if(IsNotifyButton())\r
-               {\r
-                       NMHDR nmhdr = { m_hWnd, GetDlgCtrlID(), NM_CLICK };\r
-                       ::SendMessage(GetParent(), WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&nmhdr);\r
-               }\r
-               else if(IsCommandButton())\r
-               {\r
-                       ::SendMessage(GetParent(), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd);\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(m_lpstrHyperLink != NULL);\r
-#ifndef _WIN32_WCE\r
-                       DWORD_PTR dwRet = (DWORD_PTR)::ShellExecute(0, _T("open"), m_lpstrHyperLink, 0, 0, SW_SHOWNORMAL);\r
-                       bRet = (dwRet > 32);\r
-#else // CE specific\r
-                       SHELLEXECUTEINFO shExeInfo = { sizeof(SHELLEXECUTEINFO), 0, 0, L"open", m_lpstrHyperLink, 0, 0, SW_SHOWNORMAL, 0, 0, 0, 0, 0, 0, 0 };\r
-                       ::ShellExecuteEx(&shExeInfo);\r
-                       DWORD_PTR dwRet = (DWORD_PTR)shExeInfo.hInstApp;\r
-                       bRet = (dwRet == 0) || (dwRet > 32);\r
-#endif // _WIN32_WCE\r
-                       ATLASSERT(bRet);\r
-                       if(bRet)\r
-                       {\r
-                               m_bVisited = true;\r
-                               Invalidate();\r
-                       }\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CHyperLinkImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               MESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseMessage)\r
-#endif // !_WIN32_WCE\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-#endif // !_WIN32_WCE\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnFocus)\r
-               MESSAGE_HANDLER(WM_KILLFOCUS, OnFocus)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)\r
-#endif // !_WIN32_WCE\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\r
-               MESSAGE_HANDLER(WM_CHAR, OnChar)\r
-               MESSAGE_HANDLER(WM_GETDLGCODE, OnGetDlgCode)\r
-               MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)\r
-               MESSAGE_HANDLER(WM_ENABLE, OnEnable)\r
-               MESSAGE_HANDLER(WM_GETFONT, OnGetFont)\r
-               MESSAGE_HANDLER(WM_SETFONT, OnSetFont)\r
-               MESSAGE_HANDLER(WM_UPDATEUISTATE, OnUpdateUiState)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Init();\r
-               return 0;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_tip.IsWindow())\r
-               {\r
-                       m_tip.DestroyWindow();\r
-                       m_tip.m_hWnd = NULL;\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               MSG msg = { m_hWnd, uMsg, wParam, lParam };\r
-               if(m_tip.IsWindow() && IsUsingToolTip())\r
-                       m_tip.RelayEvent(&msg);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background painting needed (we do it all during WM_PAINT)\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(!m_bPaintLabel)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(wParam != NULL)\r
-               {\r
-                       pT->DoEraseBackground((HDC)wParam);\r
-                       pT->DoPaint((HDC)wParam);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(m_hWnd);\r
-                       pT->DoEraseBackground(dc.m_hDC);\r
-                       pT->DoPaint(dc.m_hDC);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_bPaintLabel)\r
-                       Invalidate();\r
-               else\r
-                       bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               if((m_lpstrHyperLink != NULL  || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))\r
-               {\r
-                       ::SetCursor(m_hCursor);\r
-                       if(IsUnderlineHover())\r
-                       {\r
-                               if(!m_bHover)\r
-                               {\r
-                                       m_bHover = true;\r
-                                       InvalidateRect(&m_rcLink);\r
-                                       UpdateWindow();\r
-#ifndef _WIN32_WCE\r
-                                       StartTrackMouseLeave();\r
-#endif // !_WIN32_WCE\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if(IsUnderlineHover())\r
-                       {\r
-                               if(m_bHover)\r
-                               {\r
-                                       m_bHover = false;\r
-                                       InvalidateRect(&m_rcLink);\r
-                                       UpdateWindow();\r
-                               }\r
-                       }\r
-                       bHandled = FALSE;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(IsUnderlineHover() && m_bHover)\r
-               {\r
-                       m_bHover = false;\r
-                       InvalidateRect(&m_rcLink);\r
-                       UpdateWindow();\r
-               }\r
-               return 0;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-               if(::PtInRect(&m_rcLink, pt))\r
-               {\r
-                       SetFocus();\r
-                       SetCapture();\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               if(GetCapture() == m_hWnd)\r
-               {\r
-                       ReleaseCapture();\r
-                       POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-                       if(::PtInRect(&m_rcLink, pt))\r
-                       {\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->Navigate();\r
-                       }\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(wParam == VK_RETURN || wParam == VK_SPACE)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->Navigate();\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnGetDlgCode(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return DLGC_WANTCHARS;\r
-       }\r
-\r
-       LRESULT OnSetCursor(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               POINT pt = { 0, 0 };\r
-               GetCursorPos(&pt);\r
-               ScreenToClient(&pt);\r
-               if((m_lpstrHyperLink != NULL  || IsCommandButton()) && ::PtInRect(&m_rcLink, pt))\r
-               {\r
-                       return TRUE;\r
-               }\r
-               bHandled = FALSE;\r
-               return FALSE;\r
-       }\r
-\r
-       LRESULT OnEnable(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               Invalidate();\r
-               UpdateWindow();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnGetFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return (LRESULT)m_hFontNormal;\r
-       }\r
-\r
-       LRESULT OnSetFont(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               m_hFontNormal = (HFONT)wParam;\r
-               if((BOOL)lParam)\r
-               {\r
-                       Invalidate();\r
-                       UpdateWindow();\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnUpdateUiState(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               // If the control is subclassed or superclassed, this message can cause\r
-               // repainting without WM_PAINT. We don't use this state, so just do nothing.\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->CalcLabelRect();\r
-               pT->Invalidate();\r
-               return 0;\r
-       }\r
-\r
-// Implementation\r
-       void Init()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               // Check if we should paint a label\r
-               const int cchBuff = 8;\r
-               TCHAR szBuffer[cchBuff] = { 0 };\r
-               if(::GetClassName(m_hWnd, szBuffer, cchBuff))\r
-               {\r
-                       if(lstrcmpi(szBuffer, _T("static")) == 0)\r
-                       {\r
-                               ModifyStyle(0, SS_NOTIFY);   // we need this\r
-                               DWORD dwStyle = GetStyle() & 0x000000FF;\r
-#ifndef _WIN32_WCE\r
-                               if(dwStyle == SS_ICON || dwStyle == SS_BLACKRECT || dwStyle == SS_GRAYRECT || \r
-                                               dwStyle == SS_WHITERECT || dwStyle == SS_BLACKFRAME || dwStyle == SS_GRAYFRAME || \r
-                                               dwStyle == SS_WHITEFRAME || dwStyle == SS_OWNERDRAW || \r
-                                               dwStyle == SS_BITMAP || dwStyle == SS_ENHMETAFILE)\r
-#else // CE specific\r
-                               if(dwStyle == SS_ICON || dwStyle == SS_BITMAP)\r
-#endif // _WIN32_WCE\r
-                                       m_bPaintLabel = false;\r
-                       }\r
-               }\r
-\r
-               // create or load a cursor\r
-#if (WINVER >= 0x0500) || defined(_WIN32_WCE)\r
-               m_hCursor = ::LoadCursor(NULL, IDC_HAND);\r
-#else\r
-               m_hCursor = ::CreateCursor(ModuleHelper::GetModuleInstance(), _AtlHyperLink_CursorData.xHotSpot, _AtlHyperLink_CursorData.yHotSpot, _AtlHyperLink_CursorData.cxWidth, _AtlHyperLink_CursorData.cyHeight, _AtlHyperLink_CursorData.arrANDPlane, _AtlHyperLink_CursorData.arrXORPlane);\r
-#endif\r
-               ATLASSERT(m_hCursor != NULL);\r
-\r
-               // set font\r
-               if(m_bPaintLabel)\r
-               {\r
-                       ATL::CWindow wnd = GetParent();\r
-                       m_hFontNormal = wnd.GetFont();\r
-                       if(m_hFontNormal == NULL)\r
-                               m_hFontNormal = (HFONT)::GetStockObject(SYSTEM_FONT);\r
-                       if(m_hFontNormal != NULL && m_hFont == NULL)\r
-                       {\r
-                               LOGFONT lf = { 0 };\r
-                               CFontHandle font = m_hFontNormal;\r
-                               font.GetLogFont(&lf);\r
-                               if(IsUsingTagsBold())\r
-                                       lf.lfWeight = FW_BOLD;\r
-                               else if(!IsNotUnderlined())\r
-                                       lf.lfUnderline = TRUE;\r
-                               m_hFont = ::CreateFontIndirect(&lf);\r
-                               m_bInternalLinkFont = true;\r
-                               ATLASSERT(m_hFont != NULL);\r
-                       }\r
-               }\r
-\r
-#ifndef _WIN32_WCE\r
-               // create a tool tip\r
-               m_tip.Create(m_hWnd);\r
-               ATLASSERT(m_tip.IsWindow());\r
-#endif // !_WIN32_WCE\r
-\r
-               // set label (defaults to window text)\r
-               if(m_lpstrLabel == NULL)\r
-               {\r
-                       int nLen = GetWindowTextLength();\r
-                       if(nLen > 0)\r
-                       {\r
-                               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-                               LPTSTR lpstrText = buff.Allocate(nLen + 1);\r
-                               ATLASSERT(lpstrText != NULL);\r
-                               if((lpstrText != NULL) && (GetWindowText(lpstrText, nLen + 1) > 0))\r
-                                       SetLabel(lpstrText);\r
-                       }\r
-               }\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               pT->CalcLabelRect();\r
-\r
-               // set hyperlink (defaults to label), or just activate tool tip if already set\r
-               if(m_lpstrHyperLink == NULL && !IsCommandButton())\r
-               {\r
-                       if(m_lpstrLabel != NULL)\r
-                               SetHyperLink(m_lpstrLabel);\r
-               }\r
-#ifndef _WIN32_WCE\r
-               else\r
-               {\r
-                       m_tip.Activate(TRUE);\r
-                       m_tip.AddTool(m_hWnd, m_lpstrHyperLink, &m_rcLink, 1);\r
-               }\r
-#endif // !_WIN32_WCE\r
-\r
-               // set link colors\r
-               if(m_bPaintLabel)\r
-               {\r
-                       ATL::CRegKey rk;\r
-                       LONG lRet = rk.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Internet Explorer\\Settings"));\r
-                       if(lRet == 0)\r
-                       {\r
-                               const int cchValue = 12;\r
-                               TCHAR szValue[cchValue] = { 0 };\r
-#if (_ATL_VER >= 0x0700)\r
-                               ULONG ulCount = cchValue;\r
-                               lRet = rk.QueryStringValue(_T("Anchor Color"), szValue, &ulCount);\r
-#else\r
-                               DWORD dwCount = cchValue * sizeof(TCHAR);\r
-                               lRet = rk.QueryValue(szValue, _T("Anchor Color"), &dwCount);\r
-#endif\r
-                               if(lRet == 0)\r
-                               {\r
-                                       COLORREF clr = pT->_ParseColorString(szValue);\r
-                                       ATLASSERT(clr != CLR_INVALID);\r
-                                       if(clr != CLR_INVALID)\r
-                                               m_clrLink = clr;\r
-                               }\r
-\r
-#if (_ATL_VER >= 0x0700)\r
-                               ulCount = cchValue;\r
-                               lRet = rk.QueryStringValue(_T("Anchor Color Visited"), szValue, &ulCount);\r
-#else\r
-                               dwCount = cchValue * sizeof(TCHAR);\r
-                               lRet = rk.QueryValue(szValue, _T("Anchor Color Visited"), &dwCount);\r
-#endif\r
-                               if(lRet == 0)\r
-                               {\r
-                                       COLORREF clr = pT->_ParseColorString(szValue);\r
-                                       ATLASSERT(clr != CLR_INVALID);\r
-                                       if(clr != CLR_INVALID)\r
-                                               m_clrVisited = clr;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-\r
-       static COLORREF _ParseColorString(LPTSTR lpstr)\r
-       {\r
-               int c[3] = { -1, -1, -1 };\r
-               LPTSTR p = NULL;\r
-               for(int i = 0; i < 2; i++)\r
-               {\r
-                       for(p = lpstr; *p != _T('\0'); p = ::CharNext(p))\r
-                       {\r
-                               if(*p == _T(','))\r
-                               {\r
-                                       *p = _T('\0');\r
-                                       c[i] = T::_xttoi(lpstr);\r
-                                       lpstr = &p[1];\r
-                                       break;\r
-                               }\r
-                       }\r
-                       if(c[i] == -1)\r
-                               return CLR_INVALID;\r
-               }\r
-               if(*lpstr == _T('\0'))\r
-                       return CLR_INVALID;\r
-               c[2] = T::_xttoi(lpstr);\r
-\r
-               return RGB(c[0], c[1], c[2]);\r
-       }\r
-\r
-       bool CalcLabelRect()\r
-       {\r
-               if(!::IsWindow(m_hWnd))\r
-                       return false;\r
-               if(m_lpstrLabel == NULL && m_lpstrHyperLink == NULL)\r
-                       return false;\r
-\r
-               CClientDC dc(m_hWnd);\r
-               RECT rcClient = { 0 };\r
-               GetClientRect(&rcClient);\r
-               m_rcLink = rcClient;\r
-               if(!m_bPaintLabel)\r
-                       return true;\r
-\r
-               if(IsUsingTags())\r
-               {\r
-                       // find tags and label parts\r
-                       LPTSTR lpstrLeft = NULL;\r
-                       int cchLeft = 0;\r
-                       LPTSTR lpstrLink = NULL;\r
-                       int cchLink = 0;\r
-                       LPTSTR lpstrRight = NULL;\r
-                       int cchRight = 0;\r
-\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->CalcLabelParts(lpstrLeft, cchLeft, lpstrLink, cchLink, lpstrRight, cchRight);\r
-                       ATLASSERT(lpstrLink != NULL);\r
-                       ATLASSERT(cchLink > 0);\r
-\r
-                       // get label part rects\r
-                       HFONT hFontOld = dc.SelectFont(m_hFontNormal);\r
-\r
-                       RECT rcLeft = rcClient;\r
-                       if(lpstrLeft != NULL)\r
-                               dc.DrawText(lpstrLeft, cchLeft, &rcLeft, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-\r
-                       dc.SelectFont(m_hFont);\r
-                       RECT rcLink = rcClient;\r
-                       if(lpstrLeft != NULL)\r
-                               rcLink.left = rcLeft.right;\r
-                       dc.DrawText(lpstrLink, cchLink, &rcLink, DT_LEFT | DT_WORDBREAK | DT_CALCRECT);\r
-\r
-                       dc.SelectFont(hFontOld);\r
-\r
-                       m_rcLink = rcLink;\r
-               }\r
-               else\r
-               {\r
-                       HFONT hOldFont = NULL;\r
-                       if(m_hFont != NULL)\r
-                               hOldFont = dc.SelectFont(m_hFont);\r
-                       LPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\r
-                       DWORD dwStyle = GetStyle();\r
-                       int nDrawStyle = DT_LEFT;\r
-                       if (dwStyle & SS_CENTER)\r
-                               nDrawStyle = DT_CENTER;\r
-                       else if (dwStyle & SS_RIGHT)\r
-                               nDrawStyle = DT_RIGHT;\r
-                       dc.DrawText(lpstrText, -1, &m_rcLink, nDrawStyle | DT_WORDBREAK | DT_CALCRECT);\r
-                       if(m_hFont != NULL)\r
-                               dc.SelectFont(hOldFont);\r
-                       if (dwStyle & SS_CENTER)\r
-                       {\r
-                               int dx = (rcClient.right - m_rcLink.right) / 2;\r
-                               ::OffsetRect(&m_rcLink, dx, 0);\r
-                       }\r
-                       else if (dwStyle & SS_RIGHT)\r
-                       {\r
-                               int dx = rcClient.right - m_rcLink.right;\r
-                               ::OffsetRect(&m_rcLink, dx, 0);\r
-                       }\r
-               }\r
-\r
-               return true;\r
-       }\r
-\r
-       void CalcLabelParts(LPTSTR& lpstrLeft, int& cchLeft, LPTSTR& lpstrLink, int& cchLink, LPTSTR& lpstrRight, int& cchRight) const\r
-       {\r
-               lpstrLeft = NULL;\r
-               cchLeft = 0;\r
-               lpstrLink = NULL;\r
-               cchLink = 0;\r
-               lpstrRight = NULL;\r
-               cchRight = 0;\r
-\r
-               LPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\r
-               int cchText = lstrlen(lpstrText);\r
-               bool bOutsideLink = true;\r
-               for(int i = 0; i < cchText; i++)\r
-               {\r
-                       if(lpstrText[i] != _T('<'))\r
-                               continue;\r
-\r
-                       if(bOutsideLink)\r
-                       {\r
-                               if(::CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, &lpstrText[i], 3, _T("<A>"), 3) == CSTR_EQUAL)\r
-                               {\r
-                                       if(i > 0)\r
-                                       {\r
-                                               lpstrLeft = lpstrText;\r
-                                               cchLeft = i;\r
-                                       }\r
-                                       lpstrLink = &lpstrText[i + 3];\r
-                                       bOutsideLink = false;\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               if(::CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, &lpstrText[i], 4, _T("</A>"), 4) == CSTR_EQUAL)\r
-                               {\r
-                                       cchLink = i - 3 - cchLeft;\r
-                                       if(lpstrText[i + 4] != 0)\r
-                                       {\r
-                                               lpstrRight = &lpstrText[i + 4];\r
-                                               cchRight = cchText - (i + 4);\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-       }\r
-\r
-       void DoEraseBackground(CDCHandle dc)\r
-       {\r
-               HBRUSH hBrush = (HBRUSH)::SendMessage(GetParent(), WM_CTLCOLORSTATIC, (WPARAM)dc.m_hDC, (LPARAM)m_hWnd);\r
-               if(hBrush != NULL)\r
-               {\r
-                       RECT rect = { 0 };\r
-                       GetClientRect(&rect);\r
-                       dc.FillRect(&rect, hBrush);\r
-               }\r
-       }\r
-\r
-       void DoPaint(CDCHandle dc)\r
-       {\r
-               if(IsUsingTags())\r
-               {\r
-                       // find tags and label parts\r
-                       LPTSTR lpstrLeft = NULL;\r
-                       int cchLeft = 0;\r
-                       LPTSTR lpstrLink = NULL;\r
-                       int cchLink = 0;\r
-                       LPTSTR lpstrRight = NULL;\r
-                       int cchRight = 0;\r
-\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->CalcLabelParts(lpstrLeft, cchLeft, lpstrLink, cchLink, lpstrRight, cchRight);\r
-\r
-                       // get label part rects\r
-                       RECT rcClient = { 0 };\r
-                       GetClientRect(&rcClient);\r
-\r
-                       dc.SetBkMode(TRANSPARENT);\r
-                       HFONT hFontOld = dc.SelectFont(m_hFontNormal);\r
-\r
-                       if(lpstrLeft != NULL)\r
-                               dc.DrawText(lpstrLeft, cchLeft, &rcClient, DT_LEFT | DT_WORDBREAK);\r
-\r
-                       COLORREF clrOld = dc.SetTextColor(IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));\r
-                       if(m_hFont != NULL && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))\r
-                               dc.SelectFont(m_hFont);\r
-                       else\r
-                               dc.SelectFont(m_hFontNormal);\r
-\r
-                       dc.DrawText(lpstrLink, cchLink, &m_rcLink, DT_LEFT | DT_WORDBREAK);\r
-\r
-                       dc.SetTextColor(clrOld);\r
-                       dc.SelectFont(m_hFontNormal);\r
-                       if(lpstrRight != NULL)\r
-                       {\r
-                               RECT rcRight = { m_rcLink.right, m_rcLink.top, rcClient.right, rcClient.bottom };\r
-                               dc.DrawText(lpstrRight, cchRight, &rcRight, DT_LEFT | DT_WORDBREAK);\r
-                       }\r
-\r
-                       if(GetFocus() == m_hWnd)\r
-                               dc.DrawFocusRect(&m_rcLink);\r
-\r
-                       dc.SelectFont(hFontOld);\r
-               }\r
-               else\r
-               {\r
-                       dc.SetBkMode(TRANSPARENT);\r
-                       COLORREF clrOld = dc.SetTextColor(IsWindowEnabled() ? (m_bVisited ? m_clrVisited : m_clrLink) : (::GetSysColor(COLOR_GRAYTEXT)));\r
-\r
-                       HFONT hFontOld = NULL;\r
-                       if(m_hFont != NULL && (!IsUnderlineHover() || (IsUnderlineHover() && m_bHover)))\r
-                               hFontOld = dc.SelectFont(m_hFont);\r
-                       else\r
-                               hFontOld = dc.SelectFont(m_hFontNormal);\r
-\r
-                       LPTSTR lpstrText = (m_lpstrLabel != NULL) ? m_lpstrLabel : m_lpstrHyperLink;\r
-\r
-                       DWORD dwStyle = GetStyle();\r
-                       int nDrawStyle = DT_LEFT;\r
-                       if (dwStyle & SS_CENTER)\r
-                               nDrawStyle = DT_CENTER;\r
-                       else if (dwStyle & SS_RIGHT)\r
-                               nDrawStyle = DT_RIGHT;\r
-\r
-                       dc.DrawText(lpstrText, -1, &m_rcLink, nDrawStyle | DT_WORDBREAK);\r
-\r
-                       if(GetFocus() == m_hWnd)\r
-                               dc.DrawFocusRect(&m_rcLink);\r
-\r
-                       dc.SetTextColor(clrOld);\r
-                       dc.SelectFont(hFontOld);\r
-               }\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL StartTrackMouseLeave()\r
-       {\r
-               TRACKMOUSEEVENT tme = { 0 };\r
-               tme.cbSize = sizeof(tme);\r
-               tme.dwFlags = TME_LEAVE;\r
-               tme.hwndTrack = m_hWnd;\r
-               return _TrackMouseEvent(&tme);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Implementation helpers\r
-       bool IsUnderlined() const\r
-       {\r
-               return ((m_dwExtendedStyle & (HLINK_NOTUNDERLINED | HLINK_UNDERLINEHOVER)) == 0);\r
-       }\r
-\r
-       bool IsNotUnderlined() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_NOTUNDERLINED) != 0);\r
-       }\r
-\r
-       bool IsUnderlineHover() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_UNDERLINEHOVER) != 0);\r
-       }\r
-\r
-       bool IsCommandButton() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_COMMANDBUTTON) != 0);\r
-       }\r
-\r
-       bool IsNotifyButton() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_NOTIFYBUTTON) == HLINK_NOTIFYBUTTON);\r
-       }\r
-\r
-       bool IsUsingTags() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_USETAGS) != 0);\r
-       }\r
-\r
-       bool IsUsingTagsBold() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_USETAGSBOLD) == HLINK_USETAGSBOLD);\r
-       }\r
-\r
-       bool IsUsingToolTip() const\r
-       {\r
-               return ((m_dwExtendedStyle & HLINK_NOTOOLTIP) == 0);\r
-       }\r
-\r
-       static int _xttoi(const TCHAR* nptr)\r
-       {\r
-#ifndef _ATL_MIN_CRT\r
-               return _ttoi(nptr);\r
-#else // _ATL_MIN_CRT\r
-               while(*nptr == _T(' '))   // skip spaces\r
-                       ++nptr;\r
-\r
-               int c = (int)(_TUCHAR)*nptr++;\r
-               int sign = c;   // save sign indication\r
-               if (c == _T('-') || c == _T('+'))\r
-                       c = (int)(_TUCHAR)*nptr++;   // skip sign\r
-\r
-               int total = 0;\r
-               while((TCHAR)c >= _T('0') && (TCHAR)c <= _T('9'))\r
-               {\r
-                       total = 10 * total + ((TCHAR)c - _T('0'));   // accumulate digit\r
-                       c = (int)(_TUCHAR)*nptr++;        // get next char\r
-               }\r
-\r
-               // return result, negated if necessary\r
-               return ((TCHAR)sign != _T('-')) ? total : -total;\r
-#endif // _ATL_MIN_CRT\r
-       }\r
-};\r
-\r
-\r
-class CHyperLink : public CHyperLinkImpl<CHyperLink>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS(_T("WTL_HyperLink"))\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWaitCursor - displays a wait cursor\r
-\r
-class CWaitCursor\r
-{\r
-public:\r
-// Data\r
-       HCURSOR m_hWaitCursor;\r
-       HCURSOR m_hOldCursor;\r
-       bool m_bInUse;\r
-\r
-// Constructor/destructor\r
-       CWaitCursor(bool bSet = true, LPCTSTR lpstrCursor = IDC_WAIT, bool bSys = true) : m_hOldCursor(NULL), m_bInUse(false)\r
-       {\r
-               HINSTANCE hInstance = bSys ? NULL : ModuleHelper::GetResourceInstance();\r
-               m_hWaitCursor = ::LoadCursor(hInstance, lpstrCursor);\r
-               ATLASSERT(m_hWaitCursor != NULL);\r
-\r
-               if(bSet)\r
-                       Set();\r
-       }\r
-\r
-       ~CWaitCursor()\r
-       {\r
-               Restore();\r
-       }\r
-\r
-// Methods\r
-       bool Set()\r
-       {\r
-               if(m_bInUse)\r
-                       return false;\r
-               m_hOldCursor = ::SetCursor(m_hWaitCursor);\r
-               m_bInUse = true;\r
-               return true;\r
-       }\r
-\r
-       bool Restore()\r
-       {\r
-               if(!m_bInUse)\r
-                       return false;\r
-               ::SetCursor(m_hOldCursor);\r
-               m_bInUse = false;\r
-               return true;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCustomWaitCursor - for custom and animated cursors\r
-\r
-class CCustomWaitCursor : public CWaitCursor\r
-{\r
-public:\r
-// Constructor/destructor\r
-       CCustomWaitCursor(ATL::_U_STRINGorID cursor, bool bSet = true, HINSTANCE hInstance = NULL) : \r
-                       CWaitCursor(false, IDC_WAIT, true)\r
-       {\r
-               if(hInstance == NULL)\r
-                       hInstance = ModuleHelper::GetResourceInstance();\r
-               m_hWaitCursor = (HCURSOR)::LoadImage(hInstance, cursor.m_lpstr, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);\r
-\r
-               if(bSet)\r
-                       Set();\r
-       }\r
-\r
-       ~CCustomWaitCursor()\r
-       {\r
-               Restore();\r
-#if !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))\r
-               ::DestroyCursor(m_hWaitCursor);\r
-#endif // !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMultiPaneStatusBarCtrl - Status Bar with multiple panes\r
-\r
-template <class T, class TBase = CStatusBarCtrl>\r
-class ATL_NO_VTABLE CMultiPaneStatusBarCtrlImpl : public ATL::CWindowImpl< T, TBase >\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())\r
-\r
-// Data\r
-       enum { m_cxPaneMargin = 3 };\r
-\r
-       int m_nPanes;\r
-       int* m_pPane;\r
-\r
-// Constructor/destructor\r
-       CMultiPaneStatusBarCtrlImpl() : m_nPanes(0), m_pPane(NULL)\r
-       { }\r
-\r
-       ~CMultiPaneStatusBarCtrlImpl()\r
-       {\r
-               delete [] m_pPane;\r
-       }\r
-\r
-// Methods\r
-       HWND Create(HWND hWndParent, LPCTSTR lpstrText, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\r
-       {\r
-#if (_MSC_VER >= 1300)\r
-               return ATL::CWindowImpl< T, TBase >::Create(hWndParent, rcDefault, lpstrText, dwStyle, 0, nID);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImpl< T, TBase >   _baseClass;\r
-               return _baseClass::Create(hWndParent, rcDefault, lpstrText, dwStyle, 0, nID);\r
-#endif // !(_MSC_VER >= 1300)\r
-       }\r
-\r
-       HWND 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)\r
-       {\r
-               const int cchMax = 128;   // max text length is 127 for status bars (+1 for null)\r
-               TCHAR szText[cchMax];\r
-               szText[0] = 0;\r
-               ::LoadString(ModuleHelper::GetResourceInstance(), nTextID, szText, cchMax);\r
-               return Create(hWndParent, szText, dwStyle, nID);\r
-       }\r
-\r
-       BOOL SetPanes(int* pPanes, int nPanes, bool bSetText = true)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPanes > 0);\r
-\r
-               m_nPanes = nPanes;\r
-               delete [] m_pPane;\r
-               m_pPane = NULL;\r
-\r
-               ATLTRY(m_pPane = new int[nPanes]);\r
-               ATLASSERT(m_pPane != NULL);\r
-               if(m_pPane == NULL)\r
-                       return FALSE;\r
-\r
-               CTempBuffer<int, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               int* pPanesPos = buff.Allocate(nPanes);\r
-               ATLASSERT(pPanesPos != NULL);\r
-               if(pPanesPos == NULL)\r
-                       return FALSE;\r
-\r
-               SecureHelper::memcpy_x(m_pPane, nPanes * sizeof(int), pPanes, nPanes * sizeof(int));\r
-\r
-               // get status bar DC and set font\r
-               CClientDC dc(m_hWnd);\r
-               HFONT hOldFont = dc.SelectFont(GetFont());\r
-\r
-               // get status bar borders\r
-               int arrBorders[3] = { 0 };\r
-               GetBorders(arrBorders);\r
-\r
-               const int cchBuff = 128;\r
-               TCHAR szBuff[cchBuff] = { 0 };\r
-               SIZE size = { 0, 0 };\r
-               int cxLeft = arrBorders[0];\r
-\r
-               // calculate right edge of each part\r
-               for(int i = 0; i < nPanes; i++)\r
-               {\r
-                       if(pPanes[i] == ID_DEFAULT_PANE)\r
-                       {\r
-                               // make very large, will be resized later\r
-                               pPanesPos[i] = INT_MAX / 2;\r
-                       }\r
-                       else\r
-                       {\r
-                               ::LoadString(ModuleHelper::GetResourceInstance(), pPanes[i], szBuff, cchBuff);\r
-                               dc.GetTextExtent(szBuff, lstrlen(szBuff), &size);\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT;\r
-                               pPanesPos[i] = cxLeft + size.cx + arrBorders[2] + 2 * pT->m_cxPaneMargin;\r
-                       }\r
-                       cxLeft = pPanesPos[i];\r
-               }\r
-\r
-               BOOL bRet = SetParts(nPanes, pPanesPos);\r
-\r
-               if(bRet && bSetText)\r
-               {\r
-                       for(int i = 0; i < nPanes; i++)\r
-                       {\r
-                               if(pPanes[i] != ID_DEFAULT_PANE)\r
-                               {\r
-                                       ::LoadString(ModuleHelper::GetResourceInstance(), pPanes[i], szBuff, cchBuff);\r
-                                       SetPaneText(m_pPane[i], szBuff);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               dc.SelectFont(hOldFont);\r
-               return bRet;\r
-       }\r
-\r
-       bool GetPaneTextLength(int nPaneID, int* pcchLength = NULL, int* pnType = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return false;\r
-\r
-               int nLength = GetTextLength(nIndex, pnType);\r
-               if(pcchLength != NULL)\r
-                       *pcchLength = nLength;\r
-\r
-               return true;\r
-       }\r
-\r
-       BOOL GetPaneText(int nPaneID, LPTSTR lpstrText, int* pcchLength = NULL, int* pnType = NULL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               int nLength = GetText(nIndex, lpstrText, pnType);\r
-               if(pcchLength != NULL)\r
-                       *pcchLength = nLength;\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL SetPaneText(int nPaneID, LPCTSTR lpstrText, int nType = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               return SetText(nIndex, lpstrText, nType);\r
-       }\r
-\r
-       BOOL GetPaneRect(int nPaneID, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               return GetRect(nIndex, lpRect);\r
-       }\r
-\r
-       BOOL SetPaneWidth(int nPaneID, int cxWidth)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPaneID != ID_DEFAULT_PANE);   // Can't resize this one\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               // get pane positions\r
-               CTempBuffer<int, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               int* pPanesPos = buff.Allocate(m_nPanes);\r
-               if(pPanesPos == NULL)\r
-                       return FALSE;\r
-               GetParts(m_nPanes, pPanesPos);\r
-               // calculate offset\r
-               int cxPaneWidth = pPanesPos[nIndex] - ((nIndex == 0) ? 0 : pPanesPos[nIndex - 1]);\r
-               int cxOff = cxWidth - cxPaneWidth;\r
-               // find variable width pane\r
-               int nDef = m_nPanes;\r
-               for(int i = 0; i < m_nPanes; i++)\r
-               {\r
-                       if(m_pPane[i] == ID_DEFAULT_PANE)\r
-                       {\r
-                               nDef = i;\r
-                               break;\r
-                       }\r
-               }\r
-               // resize\r
-               if(nIndex < nDef)   // before default pane\r
-               {\r
-                       for(int i = nIndex; i < nDef; i++)\r
-                               pPanesPos[i] += cxOff;\r
-                               \r
-               }\r
-               else                    // after default one\r
-               {\r
-                       for(int i = nDef; i < nIndex; i++)\r
-                               pPanesPos[i] -= cxOff;\r
-               }\r
-               // set pane postions\r
-               return SetParts(m_nPanes, pPanesPos);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       BOOL GetPaneTipText(int nPaneID, LPTSTR lpstrText, int nSize) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               GetTipText(nIndex, lpstrText, nSize);\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL SetPaneTipText(int nPaneID, LPCTSTR lpstrText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               SetTipText(nIndex, lpstrText);\r
-               return TRUE;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-#if ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))\r
-       BOOL GetPaneIcon(int nPaneID, HICON& hIcon) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               hIcon = GetIcon(nIndex);\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL SetPaneIcon(int nPaneID, HICON hIcon)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               int nIndex  = GetPaneIndexFromID(nPaneID);\r
-               if(nIndex == -1)\r
-                       return FALSE;\r
-\r
-               return SetIcon(nIndex, hIcon);\r
-       }\r
-#endif // ((_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)) || (defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0500))\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CMultiPaneStatusBarCtrlImpl< T >)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               if(wParam != SIZE_MINIMIZED && m_nPanes > 0)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdatePanesLayout();\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-// Implementation\r
-       BOOL UpdatePanesLayout()\r
-       {\r
-               // get pane positions\r
-               CTempBuffer<int, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               int* pPanesPos = buff.Allocate(m_nPanes);\r
-               ATLASSERT(pPanesPos != NULL);\r
-               if(pPanesPos == NULL)\r
-                       return FALSE;\r
-               int nRet = GetParts(m_nPanes, pPanesPos);\r
-               ATLASSERT(nRet == m_nPanes);\r
-               if(nRet != m_nPanes)\r
-                       return FALSE;\r
-               // calculate offset\r
-               RECT rcClient = { 0 };\r
-               GetClientRect(&rcClient);\r
-               int cxOff = rcClient.right - pPanesPos[m_nPanes - 1];\r
-#ifndef _WIN32_WCE\r
-               // Move panes left if size grip box is present\r
-               if((GetStyle() & SBARS_SIZEGRIP) != 0)\r
-                       cxOff -= ::GetSystemMetrics(SM_CXVSCROLL) + ::GetSystemMetrics(SM_CXEDGE);\r
-#endif // !_WIN32_WCE\r
-               // find variable width pane\r
-               int i;\r
-               for(i = 0; i < m_nPanes; i++)\r
-               {\r
-                       if(m_pPane[i] == ID_DEFAULT_PANE)\r
-                               break;\r
-               }\r
-               // resize all panes from the variable one to the right\r
-               if((i < m_nPanes) && (pPanesPos[i] + cxOff) > ((i == 0) ? 0 : pPanesPos[i - 1]))\r
-               {\r
-                       for(; i < m_nPanes; i++)\r
-                               pPanesPos[i] += cxOff;\r
-               }\r
-               // set pane postions\r
-               return SetParts(m_nPanes, pPanesPos);\r
-       }\r
-\r
-       int GetPaneIndexFromID(int nPaneID) const\r
-       {\r
-               for(int i = 0; i < m_nPanes; i++)\r
-               {\r
-                       if(m_pPane[i] == nPaneID)\r
-                               return i;\r
-               }\r
-\r
-               return -1;   // not found\r
-       }\r
-};\r
-\r
-class CMultiPaneStatusBarCtrl : public CMultiPaneStatusBarCtrlImpl<CMultiPaneStatusBarCtrl>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(_T("WTL_MultiPaneStatusBar"), GetWndClassName())\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPaneContainer - provides header with title and close button for panes\r
-\r
-// pane container extended styles\r
-#define PANECNT_NOCLOSEBUTTON  0x00000001\r
-#define PANECNT_VERTICAL       0x00000002\r
-#define PANECNT_FLATBORDER     0x00000004\r
-#define PANECNT_NOBORDER       0x00000008\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CPaneContainerImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CCustomDraw< T >\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(NULL, 0, -1)\r
-\r
-// Constants\r
-       enum\r
-       {\r
-               m_cxyBorder = 2,\r
-               m_cxyTextOffset = 4,\r
-               m_cxyBtnOffset = 1,\r
-\r
-               m_cchTitle = 80,\r
-\r
-               m_cxImageTB = 13,\r
-               m_cyImageTB = 11,\r
-               m_cxyBtnAddTB = 7,\r
-\r
-               m_cxToolBar = m_cxImageTB + m_cxyBtnAddTB + m_cxyBorder + m_cxyBtnOffset,\r
-\r
-               m_xBtnImageLeft = 6,\r
-               m_yBtnImageTop = 5,\r
-               m_xBtnImageRight = 12,\r
-               m_yBtnImageBottom = 11,\r
-\r
-               m_nCloseBtnID = ID_PANE_CLOSE\r
-       };\r
-\r
-// Data members\r
-       CToolBarCtrl m_tb;\r
-       ATL::CWindow m_wndClient;\r
-       int m_cxyHeader;\r
-       TCHAR m_szTitle[m_cchTitle];\r
-       DWORD m_dwExtendedStyle;   // Pane container specific extended styles\r
-\r
-\r
-// Constructor\r
-       CPaneContainerImpl() : m_cxyHeader(0), m_dwExtendedStyle(0)\r
-       {\r
-               m_szTitle[0] = 0;\r
-       }\r
-\r
-// Attributes\r
-       DWORD GetPaneContainerExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-       DWORD SetPaneContainerExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               if(m_hWnd != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       bool bUpdate = false;\r
-\r
-                       if(((dwPrevStyle & PANECNT_NOCLOSEBUTTON) != 0) && ((m_dwExtendedStyle & PANECNT_NOCLOSEBUTTON) == 0))   // add close button\r
-                       {\r
-                               pT->CreateCloseButton();\r
-                               bUpdate = true;\r
-                       }\r
-                       else if(((dwPrevStyle & PANECNT_NOCLOSEBUTTON) == 0) && ((m_dwExtendedStyle & PANECNT_NOCLOSEBUTTON) != 0))   // remove close button\r
-                       {\r
-                               pT->DestroyCloseButton();\r
-                               bUpdate = true;\r
-                       }\r
-\r
-                       if((dwPrevStyle & PANECNT_VERTICAL) != (m_dwExtendedStyle & PANECNT_VERTICAL))   // change orientation\r
-                       {\r
-                               pT->CalcSize();\r
-                               bUpdate = true;\r
-                       }\r
-\r
-                       if((dwPrevStyle & (PANECNT_FLATBORDER | PANECNT_NOBORDER)) != \r
-                          (m_dwExtendedStyle & (PANECNT_FLATBORDER | PANECNT_NOBORDER)))   // change border\r
-                       {\r
-                               bUpdate = true;\r
-                       }\r
-\r
-                       if(bUpdate)\r
-                               pT->UpdateLayout();\r
-               }\r
-               return dwPrevStyle;\r
-       }\r
-\r
-       HWND GetClient() const\r
-       {\r
-               return m_wndClient;\r
-       }\r
-\r
-       HWND SetClient(HWND hWndClient)\r
-       {\r
-               HWND hWndOldClient = m_wndClient;\r
-               m_wndClient = hWndClient;\r
-               if(m_hWnd != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateLayout();\r
-               }\r
-               return hWndOldClient;\r
-       }\r
-\r
-       BOOL GetTitle(LPTSTR lpstrTitle, int cchLength) const\r
-       {\r
-               ATLASSERT(lpstrTitle != NULL);\r
-\r
-               errno_t nRet = SecureHelper::strncpy_x(lpstrTitle, cchLength, m_szTitle, _TRUNCATE);\r
-\r
-               return (nRet == 0 || nRet == STRUNCATE);\r
-       }\r
-\r
-       BOOL SetTitle(LPCTSTR lpstrTitle)\r
-       {\r
-               ATLASSERT(lpstrTitle != NULL);\r
-\r
-               errno_t nRet = SecureHelper::strncpy_x(m_szTitle, m_cchTitle, lpstrTitle, _TRUNCATE);\r
-               bool bRet = (nRet == 0 || nRet == STRUNCATE);\r
-               if(bRet && m_hWnd != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateLayout();\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-       int GetTitleLength() const\r
-       {\r
-               return lstrlen(m_szTitle);\r
-       }\r
-\r
-// Methods\r
-       HWND Create(HWND hWndParent, LPCTSTR lpstrTitle = NULL, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,\r
-                       DWORD dwExStyle = 0, UINT nID = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               if(lpstrTitle != NULL)\r
-                       SecureHelper::strncpy_x(m_szTitle, m_cchTitle, lpstrTitle, _TRUNCATE);\r
-#if (_MSC_VER >= 1300)\r
-               return ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, rcDefault, NULL, dwStyle, dwExStyle, nID, lpCreateParam);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImpl< T, TBase, TWinTraits >   _baseClass;\r
-               return _baseClass::Create(hWndParent, rcDefault, NULL, dwStyle, dwExStyle, nID, lpCreateParam);\r
-#endif // !(_MSC_VER >= 1300)\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, UINT uTitleID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,\r
-                       DWORD dwExStyle = 0, UINT nID = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               if(uTitleID != 0U)\r
-                       ::LoadString(ModuleHelper::GetResourceInstance(), uTitleID, m_szTitle, m_cchTitle);\r
-#if (_MSC_VER >= 1300)\r
-               return ATL::CWindowImpl< T, TBase, TWinTraits >::Create(hWndParent, rcDefault, NULL, dwStyle, dwExStyle, nID, lpCreateParam);\r
-#else // !(_MSC_VER >= 1300)\r
-               typedef ATL::CWindowImpl< T, TBase, TWinTraits >   _baseClass;\r
-               return _baseClass::Create(hWndParent, rcDefault, NULL, dwStyle, dwExStyle, nID, lpCreateParam);\r
-#endif // !(_MSC_VER >= 1300)\r
-       }\r
-\r
-       BOOL EnableCloseButton(BOOL bEnable)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               return (m_tb.m_hWnd != NULL) ? m_tb.EnableButton(pT->m_nCloseBtnID, bEnable) : FALSE;\r
-       }\r
-\r
-       void UpdateLayout()\r
-       {\r
-               RECT rcClient = { 0 };\r
-               GetClientRect(&rcClient);\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout(rcClient.right, rcClient.bottom);\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CPaneContainerImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-#endif // !_WIN32_WCE\r
-               MESSAGE_HANDLER(WM_NOTIFY, OnNotify)\r
-               MESSAGE_HANDLER(WM_COMMAND, OnCommand)\r
-               FORWARD_NOTIFICATIONS()\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->CalcSize();\r
-\r
-               if((m_dwExtendedStyle & PANECNT_NOCLOSEBUTTON) == 0)\r
-                       pT->CreateCloseButton();\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(m_wndClient.m_hWnd != NULL)\r
-                       m_wndClient.SetFocus();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background needed\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if(wParam != NULL)\r
-               {\r
-                       pT->DrawPaneTitle((HDC)wParam);\r
-\r
-                       if(m_wndClient.m_hWnd == NULL)   // no client window\r
-                               pT->DrawPane((HDC)wParam);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(m_hWnd);\r
-                       pT->DrawPaneTitle(dc.m_hDC);\r
-\r
-                       if(m_wndClient.m_hWnd == NULL)   // no client window\r
-                               pT->DrawPane(dc.m_hDC);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(m_tb.m_hWnd == NULL)\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               pT;\r
-               LPNMHDR lpnmh = (LPNMHDR)lParam;\r
-               LRESULT lRet = 0;\r
-\r
-               // pass toolbar custom draw notifications to the base class\r
-               if(lpnmh->code == NM_CUSTOMDRAW && lpnmh->hwndFrom == m_tb.m_hWnd)\r
-                       lRet = CCustomDraw< T >::OnCustomDraw(0, lpnmh, bHandled);\r
-#ifndef _WIN32_WCE\r
-               // tooltip notifications come with the tooltip window handle and button ID,\r
-               // pass them to the parent if we don't handle them\r
-               else if(lpnmh->code == TTN_GETDISPINFO && lpnmh->idFrom == pT->m_nCloseBtnID)\r
-                       bHandled = pT->GetToolTipText(lpnmh);\r
-#endif // !_WIN32_WCE\r
-               // only let notifications not from the toolbar go to the parent\r
-               else if(lpnmh->hwndFrom != m_tb.m_hWnd && lpnmh->idFrom != pT->m_nCloseBtnID)\r
-                       bHandled = FALSE;\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               // if command comes from the close button, substitute HWND of the pane container instead\r
-               if(m_tb.m_hWnd != NULL && (HWND)lParam == m_tb.m_hWnd)\r
-                       return ::SendMessage(GetParent(), WM_COMMAND, wParam, (LPARAM)m_hWnd);\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-// Custom draw overrides\r
-       DWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)\r
-       {\r
-               return CDRF_NOTIFYITEMDRAW;   // we need per-item notifications\r
-       }\r
-\r
-       DWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW lpNMCustomDraw)\r
-       {\r
-               CDCHandle dc = lpNMCustomDraw->hdc;\r
-#if (_WIN32_IE >= 0x0400)\r
-               RECT& rc = lpNMCustomDraw->rc;\r
-#else // !(_WIN32_IE >= 0x0400)\r
-               RECT rc;\r
-               m_tb.GetItemRect(0, &rc);\r
-#endif // !(_WIN32_IE >= 0x0400)\r
-\r
-               dc.FillRect(&rc, COLOR_3DFACE);\r
-\r
-               return CDRF_NOTIFYPOSTPAINT;\r
-       }\r
-\r
-       DWORD OnItemPostPaint(int /*idCtrl*/, LPNMCUSTOMDRAW lpNMCustomDraw)\r
-       {\r
-               CDCHandle dc = lpNMCustomDraw->hdc;\r
-#if (_WIN32_IE >= 0x0400)\r
-               RECT& rc = lpNMCustomDraw->rc;\r
-#else // !(_WIN32_IE >= 0x0400)\r
-               RECT rc = { 0 };\r
-               m_tb.GetItemRect(0, &rc);\r
-#endif // !(_WIN32_IE >= 0x0400)\r
-\r
-               RECT rcImage = { m_xBtnImageLeft, m_yBtnImageTop, m_xBtnImageRight + 1, m_yBtnImageBottom + 1 };\r
-               ::OffsetRect(&rcImage, rc.left, rc.top);\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               if((lpNMCustomDraw->uItemState & CDIS_DISABLED) != 0)\r
-               {\r
-                       RECT rcShadow = rcImage;\r
-                       ::OffsetRect(&rcShadow, 1, 1);\r
-                       CPen pen1;\r
-                       pen1.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_3DHILIGHT));\r
-                       pT->DrawButtonImage(dc, rcShadow, pen1);\r
-                       CPen pen2;\r
-                       pen2.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_3DSHADOW));\r
-                       pT->DrawButtonImage(dc, rcImage, pen2);\r
-               }\r
-               else\r
-               {\r
-                       if((lpNMCustomDraw->uItemState & CDIS_SELECTED) != 0)\r
-                               ::OffsetRect(&rcImage, 1, 1);\r
-                       CPen pen;\r
-                       pen.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_BTNTEXT));\r
-                       pT->DrawButtonImage(dc, rcImage, pen);\r
-               }\r
-\r
-               return CDRF_DODEFAULT;   // continue with the default item painting\r
-       }\r
-\r
-// Implementation - overrideable methods\r
-       void UpdateLayout(int cxWidth, int cyHeight)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               RECT rect = { 0 };\r
-\r
-               if(IsVertical())\r
-               {\r
-                       ::SetRect(&rect, 0, 0, m_cxyHeader, cyHeight);\r
-                       if(m_tb.m_hWnd != NULL)\r
-                               m_tb.SetWindowPos(NULL, m_cxyBorder, m_cxyBorder + m_cxyBtnOffset, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\r
-\r
-                       if(m_wndClient.m_hWnd != NULL)\r
-                               m_wndClient.SetWindowPos(NULL, m_cxyHeader, 0, cxWidth - m_cxyHeader, cyHeight, SWP_NOZORDER);\r
-                       else\r
-                               rect.right = cxWidth;\r
-               }\r
-               else\r
-               {\r
-                       ::SetRect(&rect, 0, 0, cxWidth, m_cxyHeader);\r
-                       if(m_tb.m_hWnd != NULL)\r
-                               m_tb.SetWindowPos(NULL, rect.right - m_cxToolBar, m_cxyBorder + m_cxyBtnOffset, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\r
-\r
-                       if(m_wndClient.m_hWnd != NULL)\r
-                               m_wndClient.SetWindowPos(NULL, 0, m_cxyHeader, cxWidth, cyHeight - m_cxyHeader, SWP_NOZORDER);\r
-                       else\r
-                               rect.bottom = cyHeight;\r
-               }\r
-\r
-               InvalidateRect(&rect);\r
-       }\r
-\r
-       void CreateCloseButton()\r
-       {\r
-               ATLASSERT(m_tb.m_hWnd == NULL);\r
-               // create toolbar for the "x" button\r
-               m_tb.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NORESIZE | CCS_NOPARENTALIGN | CCS_NOMOVEY | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT, 0);\r
-               ATLASSERT(m_tb.IsWindow());\r
-\r
-               if(m_tb.m_hWnd != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT;   // avoid level 4 warning\r
-\r
-                       m_tb.SetButtonStructSize();\r
-\r
-                       TBBUTTON tbbtn = { 0 };\r
-                       tbbtn.idCommand = pT->m_nCloseBtnID;\r
-                       tbbtn.fsState = TBSTATE_ENABLED;\r
-                       tbbtn.fsStyle = TBSTYLE_BUTTON;\r
-                       m_tb.AddButtons(1, &tbbtn);\r
-\r
-                       m_tb.SetBitmapSize(m_cxImageTB, m_cyImageTB);\r
-                       m_tb.SetButtonSize(m_cxImageTB + m_cxyBtnAddTB, m_cyImageTB + m_cxyBtnAddTB);\r
-\r
-                       if(IsVertical())\r
-                               m_tb.SetWindowPos(NULL, m_cxyBorder + m_cxyBtnOffset, m_cxyBorder + m_cxyBtnOffset, m_cxImageTB + m_cxyBtnAddTB, m_cyImageTB + m_cxyBtnAddTB, SWP_NOZORDER | SWP_NOACTIVATE);\r
-                       else\r
-                               m_tb.SetWindowPos(NULL, 0, 0, m_cxImageTB + m_cxyBtnAddTB, m_cyImageTB + m_cxyBtnAddTB, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);\r
-               }\r
-       }\r
-\r
-       void DestroyCloseButton()\r
-       {\r
-               if(m_tb.m_hWnd != NULL)\r
-                       m_tb.DestroyWindow();\r
-       }\r
-\r
-       void CalcSize()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               CFontHandle font = pT->GetTitleFont();\r
-               LOGFONT lf = { 0 };\r
-               font.GetLogFont(lf);\r
-               if(IsVertical())\r
-               {\r
-                       m_cxyHeader = m_cxImageTB + m_cxyBtnAddTB + m_cxyBorder;\r
-               }\r
-               else\r
-               {\r
-                       int cyFont = abs(lf.lfHeight) + m_cxyBorder + 2 * m_cxyTextOffset;\r
-                       int cyBtn = m_cyImageTB + m_cxyBtnAddTB + m_cxyBorder + 2 * m_cxyBtnOffset;\r
-                       m_cxyHeader = max(cyFont, cyBtn);\r
-               }\r
-       }\r
-\r
-       HFONT GetTitleFont() const\r
-       {\r
-               return AtlGetDefaultGuiFont();\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetToolTipText(LPNMHDR /*lpnmh*/)\r
-       {\r
-               return FALSE;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void DrawPaneTitle(CDCHandle dc)\r
-       {\r
-               RECT rect = { 0 };\r
-               GetClientRect(&rect);\r
-\r
-               UINT uBorder = BF_LEFT | BF_TOP | BF_ADJUST;\r
-               if(IsVertical())\r
-               {\r
-                       rect.right = rect.left + m_cxyHeader;\r
-                       uBorder |= BF_BOTTOM;\r
-               }\r
-               else\r
-               {\r
-                       rect.bottom = rect.top + m_cxyHeader;\r
-                       uBorder |= BF_RIGHT;\r
-               }\r
-\r
-               if((m_dwExtendedStyle & PANECNT_NOBORDER) == 0)\r
-               {\r
-                       if((m_dwExtendedStyle & PANECNT_FLATBORDER) != 0)\r
-                               uBorder |= BF_FLAT;\r
-                       dc.DrawEdge(&rect, EDGE_ETCHED, uBorder);\r
-               }\r
-               dc.FillRect(&rect, COLOR_3DFACE);\r
-\r
-               if(!IsVertical())   // draw title only for horizontal pane container\r
-               {\r
-                       dc.SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));\r
-                       dc.SetBkMode(TRANSPARENT);\r
-                       T* pT = static_cast<T*>(this);\r
-                       HFONT hFontOld = dc.SelectFont(pT->GetTitleFont());\r
-                       rect.left += m_cxyTextOffset;\r
-                       rect.right -= m_cxyTextOffset;\r
-                       if(m_tb.m_hWnd != NULL)\r
-                               rect.right -= m_cxToolBar;;\r
-#ifndef _WIN32_WCE\r
-                       dc.DrawText(m_szTitle, -1, &rect, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS);\r
-#else // CE specific\r
-                       dc.DrawText(m_szTitle, -1, &rect, DT_LEFT | DT_SINGLELINE | DT_VCENTER);\r
-#endif // _WIN32_WCE\r
-                       dc.SelectFont(hFontOld);\r
-               }\r
-       }\r
-\r
-       // called only if pane is empty\r
-       void DrawPane(CDCHandle dc)\r
-       {\r
-               RECT rect = { 0 };\r
-               GetClientRect(&rect);\r
-               if(IsVertical())\r
-                       rect.left += m_cxyHeader;\r
-               else\r
-                       rect.top += m_cxyHeader;\r
-               if((GetExStyle() & WS_EX_CLIENTEDGE) == 0)\r
-                       dc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);\r
-               dc.FillRect(&rect, COLOR_APPWORKSPACE);\r
-       }\r
-\r
-       // drawing helper - draws "x" button image\r
-       void DrawButtonImage(CDCHandle dc, RECT& rcImage, HPEN hPen)\r
-       {\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-               HPEN hPenOld = dc.SelectPen(hPen);\r
-\r
-               dc.MoveTo(rcImage.left, rcImage.top);\r
-               dc.LineTo(rcImage.right, rcImage.bottom);\r
-               dc.MoveTo(rcImage.left + 1, rcImage.top);\r
-               dc.LineTo(rcImage.right + 1, rcImage.bottom);\r
-\r
-               dc.MoveTo(rcImage.left, rcImage.bottom - 1);\r
-               dc.LineTo(rcImage.right, rcImage.top - 1);\r
-               dc.MoveTo(rcImage.left + 1, rcImage.bottom - 1);\r
-               dc.LineTo(rcImage.right + 1, rcImage.top - 1);\r
-\r
-               dc.SelectPen(hPenOld);\r
-#else // (_WIN32_WCE < 400)\r
-               rcImage;\r
-               hPen;\r
-               // no support for the "x" button image\r
-#endif // (_WIN32_WCE < 400)\r
-       }\r
-\r
-       bool IsVertical() const\r
-       {\r
-               return ((m_dwExtendedStyle & PANECNT_VERTICAL) != 0);\r
-       }\r
-};\r
-\r
-class CPaneContainer : public CPaneContainerImpl<CPaneContainer>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_PaneContainer"), 0, -1)\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSortListViewCtrl - implements sorting for a listview control\r
-\r
-// sort listview extended styles\r
-#define SORTLV_USESHELLBITMAPS 0x00000001\r
-\r
-// Notification sent to parent when sort column is changed by user clicking header.  \r
-#define SLVN_SORTCHANGED       LVN_LAST\r
-\r
-// A LPNMSORTLISTVIEW is sent with the SLVN_SORTCHANGED notification\r
-typedef struct tagNMSORTLISTVIEW\r
-{\r
-    NMHDR hdr;\r
-    int iNewSortColumn;\r
-    int iOldSortColumn;\r
-} NMSORTLISTVIEW, *LPNMSORTLISTVIEW;\r
-\r
-// Column sort types. Can be set on a per-column basis with the SetColumnSortType method.\r
-enum\r
-{\r
-       LVCOLSORT_NONE,\r
-       LVCOLSORT_TEXT,   // default\r
-       LVCOLSORT_TEXTNOCASE,\r
-       LVCOLSORT_LONG,\r
-       LVCOLSORT_DOUBLE,\r
-       LVCOLSORT_DECIMAL,\r
-       LVCOLSORT_DATETIME,\r
-       LVCOLSORT_DATE,\r
-       LVCOLSORT_TIME,\r
-       LVCOLSORT_CUSTOM,\r
-       LVCOLSORT_LAST = LVCOLSORT_CUSTOM\r
-};\r
-\r
-\r
-template <class T>\r
-class CSortListViewImpl\r
-{\r
-public:\r
-       enum\r
-       {\r
-               m_cchCmpTextMax = 32, // overrideable\r
-               m_cxSortImage = 16,\r
-               m_cySortImage = 15,\r
-               m_cxSortArrow = 11,\r
-               m_cySortArrow = 6,\r
-               m_iSortUp = 0,        // index of sort bitmaps\r
-               m_iSortDown = 1,\r
-               m_nShellSortUpID = 133\r
-       };\r
-\r
-       // passed to LVCompare functions as lParam1 and lParam2 \r
-       struct LVCompareParam\r
-       {\r
-               int iItem;\r
-               DWORD_PTR dwItemData;\r
-               union\r
-               {\r
-                       long lValue;\r
-                       double dblValue;\r
-                       DECIMAL decValue;\r
-                       LPCTSTR pszValue;\r
-               };\r
-       };\r
-       \r
-       // passed to LVCompare functions as the lParamSort parameter\r
-       struct LVSortInfo\r
-       {\r
-               T* pT;\r
-               int iSortCol;\r
-               bool bDescending;\r
-       };\r
-\r
-       bool m_bSortDescending;\r
-       bool m_bCommCtrl6;\r
-       int m_iSortColumn;\r
-       CBitmap m_bmSort[2];\r
-       int m_fmtOldSortCol;\r
-       HBITMAP m_hbmOldSortCol;\r
-       DWORD m_dwSortLVExtendedStyle;\r
-       ATL::CSimpleArray<WORD> m_arrColSortType;\r
-       bool m_bUseWaitCursor;\r
-       \r
-       CSortListViewImpl() :\r
-                       m_bSortDescending(false),\r
-                       m_bCommCtrl6(false),\r
-                       m_iSortColumn(-1), \r
-                       m_fmtOldSortCol(0),\r
-                       m_hbmOldSortCol(NULL),\r
-                       m_dwSortLVExtendedStyle(SORTLV_USESHELLBITMAPS),\r
-                       m_bUseWaitCursor(true)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               DWORD dwMajor = 0;\r
-               DWORD dwMinor = 0;\r
-               HRESULT hRet = ATL::AtlGetCommCtrlVersion(&dwMajor, &dwMinor);\r
-               m_bCommCtrl6 = SUCCEEDED(hRet) && dwMajor >= 6;\r
-#endif // !_WIN32_WCE\r
-       }\r
-       \r
-// Attributes\r
-       void SetSortColumn(int iCol)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               CHeaderCtrl header = pT->GetHeader();\r
-               ATLASSERT(header.m_hWnd != NULL);\r
-               ATLASSERT(iCol >= -1 && iCol < m_arrColSortType.GetSize());\r
-\r
-               int iOldSortCol = m_iSortColumn;\r
-               m_iSortColumn = iCol;\r
-               if(m_bCommCtrl6)\r
-               {\r
-#ifndef HDF_SORTUP\r
-                       const int HDF_SORTUP = 0x0400;  \r
-#endif // HDF_SORTUP\r
-#ifndef HDF_SORTDOWN\r
-                       const int HDF_SORTDOWN = 0x0200;        \r
-#endif // HDF_SORTDOWN\r
-                       const int nMask = HDF_SORTUP | HDF_SORTDOWN;\r
-                       HDITEM hditem = { HDI_FORMAT };\r
-                       if(iOldSortCol != iCol && iOldSortCol >= 0 && header.GetItem(iOldSortCol, &hditem))\r
-                       {\r
-                               hditem.fmt &= ~nMask;\r
-                               header.SetItem(iOldSortCol, &hditem);\r
-                       }\r
-                       if(iCol >= 0 && header.GetItem(iCol, &hditem))\r
-                       {\r
-                               hditem.fmt &= ~nMask;\r
-                               hditem.fmt |= m_bSortDescending ? HDF_SORTDOWN : HDF_SORTUP;\r
-                               header.SetItem(iCol, &hditem);\r
-                       }\r
-                       return;\r
-               }\r
-\r
-               if(m_bmSort[m_iSortUp].IsNull())\r
-                       pT->CreateSortBitmaps();\r
-\r
-               // restore previous sort column's bitmap, if any, and format\r
-               HDITEM hditem = { HDI_BITMAP | HDI_FORMAT };\r
-               if(iOldSortCol != iCol && iOldSortCol >= 0)\r
-               {\r
-                       hditem.hbm = m_hbmOldSortCol;\r
-                       hditem.fmt = m_fmtOldSortCol;\r
-                       header.SetItem(iOldSortCol, &hditem);\r
-               }\r
-\r
-               // save new sort column's bitmap and format, and add our sort bitmap\r
-               if(iCol >= 0 && header.GetItem(iCol, &hditem))\r
-               {\r
-                       if(iOldSortCol != iCol)\r
-                       {\r
-                               m_fmtOldSortCol = hditem.fmt;\r
-                               m_hbmOldSortCol = hditem.hbm;\r
-                       }\r
-                       hditem.fmt &= ~HDF_IMAGE;\r
-                       hditem.fmt |= HDF_BITMAP | HDF_BITMAP_ON_RIGHT;\r
-                       int i = m_bSortDescending ? m_iSortDown : m_iSortUp;\r
-                       hditem.hbm = m_bmSort[i];\r
-                       header.SetItem(iCol, &hditem);\r
-               }\r
-       }\r
-\r
-       int GetSortColumn() const\r
-       {\r
-               return m_iSortColumn;\r
-       }\r
-\r
-       void SetColumnSortType(int iCol, WORD wType)\r
-       {\r
-               ATLASSERT(iCol >= 0 && iCol < m_arrColSortType.GetSize());\r
-               ATLASSERT(wType >= LVCOLSORT_NONE && wType <= LVCOLSORT_LAST);\r
-               m_arrColSortType[iCol] = wType;\r
-       }\r
-\r
-       WORD GetColumnSortType(int iCol) const\r
-       {\r
-               ATLASSERT((iCol >= 0) && iCol < m_arrColSortType.GetSize());\r
-               return m_arrColSortType[iCol];\r
-       }\r
-\r
-       int GetColumnCount() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               CHeaderCtrl header = pT->GetHeader();\r
-               return header.m_hWnd != NULL ? header.GetItemCount() : 0;\r
-       }\r
-\r
-       bool IsSortDescending() const\r
-       {\r
-               return m_bSortDescending;\r
-       }\r
-\r
-       DWORD GetSortListViewExtendedStyle() const\r
-       {\r
-               return m_dwSortLVExtendedStyle;\r
-       }\r
-\r
-       DWORD SetSortListViewExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwSortLVExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwSortLVExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwSortLVExtendedStyle = (m_dwSortLVExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               return dwPrevStyle;\r
-       }\r
-\r
-// Operations\r
-       bool DoSortItems(int iCol, bool bDescending = false)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               ATLASSERT(iCol >= 0 && iCol < m_arrColSortType.GetSize());\r
-\r
-               WORD wType = m_arrColSortType[iCol];\r
-               if(wType == LVCOLSORT_NONE)\r
-                       return false;\r
-\r
-               int nCount = pT->GetItemCount();\r
-               if(nCount < 2)\r
-               {\r
-                       m_bSortDescending = bDescending;\r
-                       SetSortColumn(iCol);\r
-                       return true;\r
-               }\r
-\r
-               CWaitCursor waitCursor(false);\r
-               if(m_bUseWaitCursor)\r
-                       waitCursor.Set();\r
-\r
-               LVCompareParam* pParam = NULL;\r
-               ATLTRY(pParam = new LVCompareParam[nCount]);\r
-               PFNLVCOMPARE pFunc = NULL;\r
-               TCHAR pszTemp[pT->m_cchCmpTextMax];\r
-               bool bStrValue = false;\r
-\r
-               switch(wType)\r
-               {\r
-               case LVCOLSORT_TEXT:\r
-                       pFunc = (PFNLVCOMPARE)pT->LVCompareText;\r
-               case LVCOLSORT_TEXTNOCASE:\r
-                       if(pFunc == NULL)\r
-                               pFunc = (PFNLVCOMPARE)pT->LVCompareTextNoCase;\r
-               case LVCOLSORT_CUSTOM:\r
-                       {\r
-                               if(pFunc == NULL)\r
-                                       pFunc = (PFNLVCOMPARE)pT->LVCompareCustom;\r
-\r
-                               for(int i = 0; i < nCount; i++)\r
-                               {\r
-                                       pParam[i].iItem = i;\r
-                                       pParam[i].dwItemData = pT->GetItemData(i);\r
-                                       pParam[i].pszValue = new TCHAR[pT->m_cchCmpTextMax];\r
-                                       pT->GetItemText(i, iCol, (LPTSTR)pParam[i].pszValue, pT->m_cchCmpTextMax);\r
-                                       pT->SetItemData(i, (DWORD_PTR)&pParam[i]);\r
-                               }\r
-                               bStrValue = true;\r
-                       }\r
-                       break;\r
-               case LVCOLSORT_LONG:\r
-                       {\r
-                               pFunc = (PFNLVCOMPARE)pT->LVCompareLong;\r
-                               for(int i = 0; i < nCount; i++)\r
-                               {\r
-                                       pParam[i].iItem = i;\r
-                                       pParam[i].dwItemData = pT->GetItemData(i);\r
-                                       pT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\r
-                                       pParam[i].lValue = pT->StrToLong(pszTemp);\r
-                                       pT->SetItemData(i, (DWORD_PTR)&pParam[i]);\r
-                               }\r
-                       }\r
-                       break;\r
-               case LVCOLSORT_DOUBLE:\r
-                       {\r
-                               pFunc = (PFNLVCOMPARE)pT->LVCompareDouble;\r
-                               for(int i = 0; i < nCount; i++)\r
-                               {\r
-                                       pParam[i].iItem = i;\r
-                                       pParam[i].dwItemData = pT->GetItemData(i);\r
-                                       pT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\r
-                                       pParam[i].dblValue = pT->StrToDouble(pszTemp);\r
-                                       pT->SetItemData(i, (DWORD_PTR)&pParam[i]);\r
-                               }\r
-                       }\r
-                       break;\r
-               case LVCOLSORT_DECIMAL:\r
-                       {\r
-                               pFunc = (PFNLVCOMPARE)pT->LVCompareDecimal;\r
-                               for(int i = 0; i < nCount; i++)\r
-                               {\r
-                                       pParam[i].iItem = i;\r
-                                       pParam[i].dwItemData = pT->GetItemData(i);\r
-                                       pT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\r
-                                       pT->StrToDecimal(pszTemp, &pParam[i].decValue);\r
-                                       pT->SetItemData(i, (DWORD_PTR)&pParam[i]);\r
-                               }\r
-                       }\r
-                       break;\r
-               case LVCOLSORT_DATETIME:\r
-               case LVCOLSORT_DATE:\r
-               case LVCOLSORT_TIME:\r
-                       {\r
-                               pFunc = (PFNLVCOMPARE)pT->LVCompareDouble;\r
-                               DWORD dwFlags = LOCALE_NOUSEROVERRIDE;\r
-                               if(wType == LVCOLSORT_DATE)\r
-                                       dwFlags |= VAR_DATEVALUEONLY;\r
-                               else if(wType == LVCOLSORT_TIME)\r
-                                       dwFlags |= VAR_TIMEVALUEONLY;\r
-                               for(int i = 0; i < nCount; i++)\r
-                               {\r
-                                       pParam[i].iItem = i;\r
-                                       pParam[i].dwItemData = pT->GetItemData(i);\r
-                                       pT->GetItemText(i, iCol, pszTemp, pT->m_cchCmpTextMax);\r
-                                       pParam[i].dblValue = pT->DateStrToDouble(pszTemp, dwFlags);\r
-                                       pT->SetItemData(i, (DWORD_PTR)&pParam[i]);\r
-                               }\r
-                       }\r
-                       break;\r
-               default:\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Unknown value for sort type in CSortListViewImpl::DoSortItems()\n"));\r
-                       break;\r
-               } // switch(wType)\r
-\r
-               ATLASSERT(pFunc != NULL);\r
-               LVSortInfo lvsi = { pT, iCol, bDescending };\r
-               bool bRet = ((BOOL)pT->DefWindowProc(LVM_SORTITEMS, (WPARAM)&lvsi, (LPARAM)pFunc) != FALSE);\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       DWORD_PTR dwItemData = pT->GetItemData(i);\r
-                       LVCompareParam* p = (LVCompareParam*)dwItemData;\r
-                       ATLASSERT(p != NULL);\r
-                       if(bStrValue)\r
-                               delete [] (TCHAR*)p->pszValue;\r
-                       pT->SetItemData(i, p->dwItemData);\r
-               }\r
-               delete [] pParam;\r
-\r
-               if(bRet)\r
-               {\r
-                       m_bSortDescending = bDescending;\r
-                       SetSortColumn(iCol);\r
-               }\r
-\r
-               if(m_bUseWaitCursor)\r
-                       waitCursor.Restore();\r
-\r
-               return bRet;\r
-       }\r
-\r
-       void CreateSortBitmaps()\r
-       {\r
-               if((m_dwSortLVExtendedStyle & SORTLV_USESHELLBITMAPS) != 0)\r
-               {\r
-                       bool bFree = false;\r
-                       LPCTSTR pszModule = _T("shell32.dll"); \r
-                       HINSTANCE hShell = ::GetModuleHandle(pszModule);\r
-\r
-                       if (hShell == NULL)             \r
-                       {\r
-                               hShell = ::LoadLibrary(pszModule);\r
-                               bFree = true;\r
-                       }\r
\r
-                       if (hShell != NULL)\r
-                       {\r
-                               bool bSuccess = true;\r
-                               for(int i = m_iSortUp; i <= m_iSortDown; i++)\r
-                               {\r
-                                       if(!m_bmSort[i].IsNull())\r
-                                               m_bmSort[i].DeleteObject();\r
-                                       m_bmSort[i] = (HBITMAP)::LoadImage(hShell, MAKEINTRESOURCE(m_nShellSortUpID + i), \r
-#ifndef _WIN32_WCE\r
-                                               IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);\r
-#else // CE specific\r
-                                               IMAGE_BITMAP, 0, 0, 0);\r
-#endif // _WIN32_WCE\r
-                                       if(m_bmSort[i].IsNull())\r
-                                       {\r
-                                               bSuccess = false;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                               if(bFree)\r
-                                       ::FreeLibrary(hShell);\r
-                               if(bSuccess)\r
-                                       return;\r
-                       }\r
-               }\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               for(int i = m_iSortUp; i <= m_iSortDown; i++)\r
-               {\r
-                       if(!m_bmSort[i].IsNull())\r
-                               m_bmSort[i].DeleteObject();\r
-\r
-                       CDC dcMem;\r
-                       CClientDC dc(::GetDesktopWindow());\r
-                       dcMem.CreateCompatibleDC(dc.m_hDC);\r
-                       m_bmSort[i].CreateCompatibleBitmap(dc.m_hDC, m_cxSortImage, m_cySortImage);\r
-                       HBITMAP hbmOld = dcMem.SelectBitmap(m_bmSort[i]);\r
-                       RECT rc = {0,0,m_cxSortImage, m_cySortImage};\r
-                       pT->DrawSortBitmap(dcMem.m_hDC, i, &rc);\r
-                       dcMem.SelectBitmap(hbmOld);\r
-                       dcMem.DeleteDC();\r
-               }\r
-       }\r
-\r
-       void NotifyParentSortChanged(int iNewSortCol, int iOldSortCol)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               int nID = pT->GetDlgCtrlID();\r
-               NMSORTLISTVIEW nm = { { pT->m_hWnd, nID, SLVN_SORTCHANGED }, iNewSortCol, iOldSortCol };\r
-               ::SendMessage(pT->GetParent(), WM_NOTIFY, (WPARAM)nID, (LPARAM)&nm);\r
-       }\r
-\r
-// Overrideables\r
-       int CompareItemsCustom(LVCompareParam* /*pItem1*/, LVCompareParam* /*pItem2*/, int /*iSortCol*/)\r
-       {\r
-               // pItem1 and pItem2 contain valid iItem, dwItemData, and pszValue members.\r
-               // If item1 > item2 return 1, if item1 < item2 return -1, else return 0.\r
-               return 0;\r
-       }\r
-\r
-       void DrawSortBitmap(CDCHandle dc, int iBitmap, LPRECT prc)\r
-       {\r
-               dc.FillRect(prc, ::GetSysColorBrush(COLOR_BTNFACE));    \r
-               HBRUSH hbrOld = dc.SelectBrush(::GetSysColorBrush(COLOR_BTNSHADOW));\r
-               CPen pen;\r
-               pen.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_BTNSHADOW));\r
-               HPEN hpenOld = dc.SelectPen(pen);\r
-               POINT ptOrg = { (m_cxSortImage - m_cxSortArrow) / 2, (m_cySortImage - m_cySortArrow) / 2 };\r
-               if(iBitmap == m_iSortUp)\r
-               {\r
-                       POINT pts[3] = \r
-                       {\r
-                               { ptOrg.x + m_cxSortArrow / 2, ptOrg.y },\r
-                               { ptOrg.x, ptOrg.y + m_cySortArrow - 1 }, \r
-                               { ptOrg.x + m_cxSortArrow - 1, ptOrg.y + m_cySortArrow - 1 }\r
-                       };\r
-                       dc.Polygon(pts, 3);\r
-               }\r
-               else\r
-               {\r
-                       POINT pts[3] = \r
-                       {\r
-                               { ptOrg.x, ptOrg.y },\r
-                               { ptOrg.x + m_cxSortArrow / 2, ptOrg.y + m_cySortArrow - 1 },\r
-                               { ptOrg.x + m_cxSortArrow - 1, ptOrg.y }\r
-                       };\r
-                       dc.Polygon(pts, 3);\r
-               }\r
-               dc.SelectBrush(hbrOld);\r
-               dc.SelectPen(hpenOld);\r
-       }\r
-\r
-       double DateStrToDouble(LPCTSTR lpstr, DWORD dwFlags)\r
-       {\r
-               ATLASSERT(lpstr != NULL);\r
-               if(lpstr == NULL || lpstr[0] == _T('\0'))\r
-                       return 0;\r
-\r
-               USES_CONVERSION;\r
-               HRESULT hRet = E_FAIL;\r
-               DATE dRet = 0;\r
-               if (FAILED(hRet = ::VarDateFromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, dwFlags, &dRet)))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("VarDateFromStr failed with result of 0x%8.8X\n"), hRet);\r
-                       dRet = 0;\r
-               }\r
-               return dRet;\r
-       }\r
-\r
-       long StrToLong(LPCTSTR lpstr)\r
-       {\r
-               ATLASSERT(lpstr != NULL);\r
-               if(lpstr == NULL || lpstr[0] == _T('\0'))\r
-                       return 0;\r
-               \r
-               USES_CONVERSION;\r
-               HRESULT hRet = E_FAIL;\r
-               long lRet = 0;\r
-               if (FAILED(hRet = ::VarI4FromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, LOCALE_NOUSEROVERRIDE, &lRet)))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("VarI4FromStr failed with result of 0x%8.8X\n"), hRet);\r
-                       lRet = 0;\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-       double StrToDouble(LPCTSTR lpstr)\r
-       {\r
-               ATLASSERT(lpstr != NULL);\r
-               if(lpstr == NULL || lpstr[0] == _T('\0'))\r
-                       return 0;\r
-\r
-               USES_CONVERSION;\r
-               HRESULT hRet = E_FAIL;\r
-               double dblRet = 0;\r
-               if (FAILED(hRet = ::VarR8FromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, LOCALE_NOUSEROVERRIDE, &dblRet)))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("VarR8FromStr failed with result of 0x%8.8X\n"), hRet);\r
-                       dblRet = 0;\r
-               }\r
-               return dblRet;\r
-       }\r
-\r
-       bool StrToDecimal(LPCTSTR lpstr, DECIMAL* pDecimal)\r
-       {\r
-               ATLASSERT(lpstr != NULL);\r
-               ATLASSERT(pDecimal != NULL);\r
-               if(lpstr == NULL || pDecimal == NULL)\r
-                       return false;\r
-\r
-               USES_CONVERSION;\r
-               HRESULT hRet = E_FAIL;\r
-               if (FAILED(hRet = ::VarDecFromStr((LPOLESTR)T2COLE(lpstr), LANG_USER_DEFAULT, LOCALE_NOUSEROVERRIDE, pDecimal)))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("VarDecFromStr failed with result of 0x%8.8X\n"), hRet);\r
-                       pDecimal->Lo64 = 0;\r
-                       pDecimal->Hi32 = 0;\r
-                       pDecimal->signscale = 0;\r
-                       return false;\r
-               }\r
-               return true;\r
-       }\r
-\r
-// Overrideable PFNLVCOMPARE functions\r
-       static int CALLBACK LVCompareText(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = lstrcmp(pParam1->pszValue, pParam2->pszValue);\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-\r
-       static int CALLBACK LVCompareTextNoCase(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = lstrcmpi(pParam1->pszValue, pParam2->pszValue);\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-\r
-       static int CALLBACK LVCompareLong(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = 0;\r
-               if(pParam1->lValue > pParam2->lValue)\r
-                       nRet = 1;\r
-               else if(pParam1->lValue < pParam2->lValue)\r
-                       nRet = -1;\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-\r
-       static int CALLBACK LVCompareDouble(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = 0;\r
-               if(pParam1->dblValue > pParam2->dblValue)\r
-                       nRet = 1;\r
-               else if(pParam1->dblValue < pParam2->dblValue)\r
-                       nRet = -1;\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-\r
-       static int CALLBACK LVCompareCustom(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = pInfo->pT->CompareItemsCustom(pParam1, pParam2, pInfo->iSortCol);\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       static int CALLBACK LVCompareDecimal(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = (int)::VarDecCmp(&pParam1->decValue, &pParam2->decValue);\r
-               nRet--;\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-#else\r
-       // Compare mantissas, ignore sign and scale\r
-       static int CompareMantissas(const DECIMAL& decLeft, const DECIMAL& decRight)\r
-       {\r
-               if (decLeft.Hi32 < decRight.Hi32)\r
-               {\r
-                       return -1;\r
-               }\r
-               if (decLeft.Hi32 > decRight.Hi32)\r
-               {\r
-                       return 1;\r
-               }\r
-               // Here, decLeft.Hi32 == decRight.Hi32\r
-               if (decLeft.Lo64 < decRight.Lo64)\r
-               {\r
-                       return -1;\r
-               }\r
-               if (decLeft.Lo64 > decRight.Lo64)\r
-               {\r
-                       return 1;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       // return values: VARCMP_LT, VARCMP_EQ, VARCMP_GT, VARCMP_NULL\r
-       static HRESULT VarDecCmp(const DECIMAL* pdecLeft, const DECIMAL* pdecRight)\r
-       {\r
-               static const ULONG powersOfTen[] =\r
-               {\r
-                       10ul,\r
-                       100ul,\r
-                       1000ul,\r
-                       10000ul,\r
-                       100000ul,\r
-                       1000000ul,\r
-                       10000000ul,\r
-                       100000000ul,\r
-                       1000000000ul\r
-               };\r
-               static const int largestPower = sizeof(powersOfTen) / sizeof(powersOfTen[0]);\r
-               if (!pdecLeft || !pdecRight)\r
-               {\r
-                       return VARCMP_NULL;\r
-               }\r
-               \r
-               // Degenerate case - at least one comparand is of the form\r
-               // [+-]0*10^N (denormalized zero)\r
-               bool bLeftZero = (!pdecLeft->Lo64 && !pdecLeft->Hi32);\r
-               bool bRightZero = (!pdecRight->Lo64 && !pdecRight->Hi32);\r
-               if (bLeftZero && bRightZero)\r
-               {\r
-                       return VARCMP_EQ;\r
-               }\r
-               bool bLeftNeg = ((pdecLeft->sign & DECIMAL_NEG) != 0);\r
-               bool bRightNeg = ((pdecRight->sign & DECIMAL_NEG) != 0);\r
-               if (bLeftZero)\r
-               {\r
-                       return (bRightNeg ? VARCMP_GT : VARCMP_LT);\r
-               }\r
-               // This also covers the case where the comparands have different signs\r
-               if (bRightZero || bLeftNeg != bRightNeg)\r
-               {\r
-                       return (bLeftNeg ? VARCMP_LT : VARCMP_GT);\r
-               }\r
-\r
-               // Here both comparands have the same sign and need to be compared\r
-               // on mantissa and scale. The result is obvious when\r
-               // 1. Scales are equal (then compare mantissas)\r
-               // 2. A number with smaller scale is also the one with larger mantissa\r
-               //    (then this number is obviously larger)\r
-               // In the remaining case, we would multiply the number with smaller\r
-               // scale by 10 and simultaneously increment its scale (which amounts to\r
-               // adding trailing zeros after decimal point), until the numbers fall under\r
-               // one of the two cases above\r
-               DECIMAL temp;\r
-               bool bInvert = bLeftNeg; // the final result needs to be inverted\r
-               if (pdecLeft->scale < pdecRight->scale)\r
-               {\r
-                       temp = *pdecLeft;\r
-               }\r
-               else\r
-               {\r
-                       temp = *pdecRight;\r
-                       pdecRight = pdecLeft;\r
-                       bInvert = !bInvert;\r
-               }\r
-\r
-               // Now temp is the number with smaller (or equal) scale, and\r
-               // we can modify it freely without touching original parameters\r
-               int comp;\r
-               while ((comp = CompareMantissas(temp, *pdecRight)) < 0 &&\r
-                       temp.scale < pdecRight->scale)\r
-               {\r
-                       // Multiply by an appropriate power of 10\r
-                       int scaleDiff = pdecRight->scale - temp.scale;\r
-                       if (scaleDiff > largestPower)\r
-                       {\r
-                               // Keep the multiplier representable in 32bit\r
-                               scaleDiff = largestPower;\r
-                       }\r
-                       DWORDLONG power = powersOfTen[scaleDiff - 1];\r
-                       // Multiply temp's mantissa by power\r
-                       DWORDLONG product = temp.Lo32 * power;\r
-                       ULONG carry = static_cast<ULONG>(product >> 32);\r
-                       temp.Lo32  = static_cast<ULONG>(product);\r
-                       product = temp.Mid32 * power + carry;\r
-                       carry = static_cast<ULONG>(product >> 32);\r
-                       temp.Mid32 = static_cast<ULONG>(product);\r
-                       product = temp.Hi32 * power + carry;\r
-                       if (static_cast<ULONG>(product >> 32))\r
-                       {\r
-                               // Multiplication overflowed - pdecLeft is clearly larger\r
-                               break;\r
-                       }\r
-                       temp.Hi32 = static_cast<ULONG>(product);\r
-                       temp.scale = (BYTE)(temp.scale + scaleDiff);\r
-               }\r
-               if (temp.scale < pdecRight->scale)\r
-               {\r
-                       comp = 1;\r
-               }\r
-               if (bInvert)\r
-               {\r
-                       comp = -comp;\r
-               }\r
-               return (comp > 0 ? VARCMP_GT : comp < 0 ? VARCMP_LT : VARCMP_EQ);\r
-       }\r
-\r
-       static int CALLBACK LVCompareDecimal(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)\r
-       {\r
-               ATLASSERT(lParam1 != NULL && lParam2 != NULL && lParamSort != NULL);\r
-\r
-               LVCompareParam* pParam1 = (LVCompareParam*)lParam1;\r
-               LVCompareParam* pParam2 = (LVCompareParam*)lParam2;\r
-               LVSortInfo* pInfo = (LVSortInfo*)lParamSort;\r
-               \r
-               int nRet = (int)VarDecCmp(&pParam1->decValue, &pParam2->decValue);\r
-               nRet--;\r
-               return pInfo->bDescending ? -nRet : nRet;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BEGIN_MSG_MAP(CSortListViewImpl)\r
-               MESSAGE_HANDLER(LVM_INSERTCOLUMN, OnInsertColumn)\r
-               MESSAGE_HANDLER(LVM_DELETECOLUMN, OnDeleteColumn)\r
-               NOTIFY_CODE_HANDLER(HDN_ITEMCLICKA, OnHeaderItemClick)\r
-               NOTIFY_CODE_HANDLER(HDN_ITEMCLICKW, OnHeaderItemClick)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInsertColumn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)     \r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               LRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);\r
-               if(lRet == -1)\r
-                       return -1;\r
-\r
-               WORD wType = 0;\r
-               m_arrColSortType.Add(wType);\r
-               int nCount = m_arrColSortType.GetSize();\r
-               ATLASSERT(nCount == GetColumnCount());\r
-\r
-               for(int i = nCount - 1; i > lRet; i--)\r
-                       m_arrColSortType[i] = m_arrColSortType[i - 1];\r
-               m_arrColSortType[(int)lRet] = LVCOLSORT_TEXT;\r
-\r
-               if(lRet <= m_iSortColumn)\r
-                       m_iSortColumn++;\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnDeleteColumn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)     \r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               LRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);\r
-               if(lRet == 0)\r
-                       return 0;\r
-\r
-               int iCol = (int)wParam; \r
-               if(m_iSortColumn == iCol)\r
-                       m_iSortColumn = -1;\r
-               else if(m_iSortColumn > iCol)\r
-                       m_iSortColumn--;\r
-               m_arrColSortType.RemoveAt(iCol);\r
-\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnHeaderItemClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               LPNMHEADER p = (LPNMHEADER)pnmh;\r
-               if(p->iButton == 0)\r
-               {\r
-                       int iOld = m_iSortColumn;\r
-                       bool bDescending = (m_iSortColumn == p->iItem) ? !m_bSortDescending : false;\r
-                       if(DoSortItems(p->iItem, bDescending))\r
-                               NotifyParentSortChanged(p->iItem, iOld);                                \r
-               }\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               if(wParam == SPI_SETNONCLIENTMETRICS)\r
-                       GetSystemSettings();\r
-#else  // CE specific\r
-               wParam; // avoid level 4 warning\r
-               GetSystemSettings();\r
-#endif // _WIN32_WCE\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       void GetSystemSettings()\r
-       {\r
-               if(!m_bCommCtrl6 && !m_bmSort[m_iSortUp].IsNull())\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->CreateSortBitmaps();\r
-                       if(m_iSortColumn != -1)\r
-                               SetSortColumn(m_iSortColumn);\r
-               }\r
-       }\r
-\r
-};\r
-\r
-\r
-typedef ATL::CWinTraits<WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | LVS_REPORT | LVS_SHOWSELALWAYS , WS_EX_CLIENTEDGE>   CSortListViewCtrlTraits;\r
-\r
-template <class T, class TBase = CListViewCtrl, class TWinTraits = CSortListViewCtrlTraits>\r
-class ATL_NO_VTABLE CSortListViewCtrlImpl: public ATL::CWindowImpl<T, TBase, TWinTraits>, public CSortListViewImpl<T>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName())\r
-\r
-       bool SortItems(int iCol, bool bDescending = false)\r
-       {\r
-               return DoSortItems(iCol, bDescending);\r
-       }\r
-               \r
-       BEGIN_MSG_MAP(CSortListViewCtrlImpl)\r
-               MESSAGE_HANDLER(LVM_INSERTCOLUMN, CSortListViewImpl<T>::OnInsertColumn)\r
-               MESSAGE_HANDLER(LVM_DELETECOLUMN, CSortListViewImpl<T>::OnDeleteColumn)\r
-               NOTIFY_CODE_HANDLER(HDN_ITEMCLICKA, CSortListViewImpl<T>::OnHeaderItemClick)\r
-               NOTIFY_CODE_HANDLER(HDN_ITEMCLICKW, CSortListViewImpl<T>::OnHeaderItemClick)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CSortListViewImpl<T>::OnSettingChange)\r
-       END_MSG_MAP()\r
-};\r
-\r
-class CSortListViewCtrl : public CSortListViewCtrlImpl<CSortListViewCtrl>\r
-{\r
-public:\r
-       DECLARE_WND_SUPERCLASS(_T("WTL_SortListViewCtrl"), GetWndClassName())\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTabView - implements tab view window\r
-\r
-// TabView Notifications\r
-#define TBVN_PAGEACTIVATED   (0U-741)\r
-#define TBVN_CONTEXTMENU     (0U-742)\r
-\r
-// Notification data for TBVN_CONTEXTMENU\r
-struct TBVCONTEXTMENUINFO\r
-{\r
-       NMHDR hdr;\r
-       POINT pt;\r
-};\r
-\r
-typedef TBVCONTEXTMENUINFO* LPTBVCONTEXTMENUINFO;\r
-\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CTabViewImpl : public ATL::CWindowImpl<T, TBase, TWinTraits>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(NULL, 0, COLOR_APPWORKSPACE)\r
-\r
-// Declarations and enums\r
-       struct TABVIEWPAGE\r
-       {\r
-               HWND hWnd;\r
-               LPTSTR lpstrTitle;\r
-               LPVOID pData;\r
-       };\r
-\r
-       struct TCITEMEXTRA\r
-       {\r
-               TCITEMHEADER tciheader;\r
-               TABVIEWPAGE tvpage;\r
-\r
-               operator LPTCITEM() { return (LPTCITEM)this; }\r
-       };\r
-\r
-       enum\r
-       {\r
-               m_nTabID = 1313,\r
-               m_cxMoveMark = 6,\r
-               m_cyMoveMark = 3,\r
-               m_nMenuItemsMax = (ID_WINDOW_TABLAST - ID_WINDOW_TABFIRST + 1)\r
-       };\r
-\r
-// Data members\r
-       ATL::CContainedWindowT<CTabCtrl> m_tab;\r
-       int m_cyTabHeight;\r
-\r
-       int m_nActivePage;\r
-\r
-       int m_nInsertItem;\r
-       POINT m_ptStartDrag;\r
-\r
-       CMenuHandle m_menu;\r
-\r
-       int m_cchTabTextLength;\r
-\r
-       int m_nMenuItemsCount;\r
-\r
-       ATL::CWindow m_wndTitleBar;\r
-       LPTSTR m_lpstrTitleBarBase;\r
-       int m_cchTitleBarLength;\r
-\r
-       CImageList m_ilDrag;\r
-\r
-       bool m_bDestroyPageOnRemove:1;\r
-       bool m_bDestroyImageList:1;\r
-       bool m_bActivePageMenuItem:1;\r
-       bool m_bActiveAsDefaultMenuItem:1;\r
-       bool m_bEmptyMenuItem:1;\r
-       bool m_bWindowsMenuItem:1;\r
-       // internal\r
-       bool m_bTabCapture:1;\r
-       bool m_bTabDrag:1;\r
-\r
-// Constructor/destructor\r
-       CTabViewImpl() :\r
-                       m_nActivePage(-1), \r
-                       m_cyTabHeight(0), \r
-                       m_tab(this, 1), \r
-                       m_nInsertItem(-1), \r
-                       m_cchTabTextLength(30), \r
-                       m_nMenuItemsCount(10), \r
-                       m_lpstrTitleBarBase(NULL), \r
-                       m_cchTitleBarLength(100), \r
-                       m_bDestroyPageOnRemove(true), \r
-                       m_bDestroyImageList(true), \r
-                       m_bActivePageMenuItem(true), \r
-                       m_bActiveAsDefaultMenuItem(false), \r
-                       m_bEmptyMenuItem(false), \r
-                       m_bWindowsMenuItem(false), \r
-                       m_bTabCapture(false), \r
-                       m_bTabDrag(false)\r
-       {\r
-               m_ptStartDrag.x = 0;\r
-               m_ptStartDrag.y = 0;\r
-       }\r
-\r
-       ~CTabViewImpl()\r
-       {\r
-               delete [] m_lpstrTitleBarBase;\r
-       }\r
-\r
-// Message filter function - to be called from PreTranslateMessage of the main window\r
-       BOOL PreTranslateMessage(MSG* pMsg)\r
-       {\r
-               if(IsWindow() == FALSE)\r
-                       return FALSE;\r
-\r
-               BOOL bRet = FALSE;\r
-\r
-               // Check for TabView built-in accelerators (Ctrl+Tab/Ctrl+Shift+Tab - next/previous page)\r
-               int nCount = GetPageCount();\r
-               if(nCount > 0)\r
-               {\r
-                       bool bControl = (::GetKeyState(VK_CONTROL) < 0);\r
-                       if((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB) && bControl)\r
-                       {\r
-                               if(nCount > 1)\r
-                               {\r
-                                       int nPage = m_nActivePage;\r
-                                       bool bShift = (::GetKeyState(VK_SHIFT) < 0);\r
-                                       if(bShift)\r
-                                               nPage = (nPage > 0) ? (nPage - 1) : (nCount - 1);\r
-                                       else\r
-                                               nPage = ((nPage >= 0) && (nPage < (nCount - 1))) ? (nPage + 1) : 0;\r
-\r
-                                       SetActivePage(nPage);\r
-                                       T* pT = static_cast<T*>(this);\r
-                                       pT->OnPageActivated(m_nActivePage);\r
-                               }\r
-\r
-                               bRet = TRUE;\r
-                       }\r
-               }\r
-\r
-               // If we are doing drag-drop, check for Escape key that cancels it\r
-               if(bRet == FALSE)\r
-               {\r
-                       if(m_bTabCapture && pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE)\r
-                       {\r
-                               ::ReleaseCapture();\r
-                               bRet = TRUE;\r
-                       }\r
-               }\r
-\r
-               // Pass the message to the active page\r
-               if(bRet == FALSE)\r
-               {\r
-                       if(m_nActivePage != -1)\r
-                               bRet = (BOOL)::SendMessage(GetPageHWND(m_nActivePage), WM_FORWARDMSG, 0, (LPARAM)pMsg);\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       int GetPageCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return m_tab.GetItemCount();\r
-       }\r
-\r
-       int GetActivePage() const\r
-       {\r
-               return m_nActivePage;\r
-       }\r
-\r
-       void SetActivePage(int nPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               SetRedraw(FALSE);\r
-\r
-               if(m_nActivePage != -1)\r
-                       ::ShowWindow(GetPageHWND(m_nActivePage), FALSE);\r
-               m_nActivePage = nPage;\r
-               m_tab.SetCurSel(m_nActivePage);\r
-               ::ShowWindow(GetPageHWND(m_nActivePage), TRUE);\r
-\r
-               pT->UpdateLayout();\r
-\r
-               SetRedraw(TRUE);\r
-               RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\r
-\r
-               if(::GetFocus() != m_tab.m_hWnd)\r
-                       ::SetFocus(GetPageHWND(m_nActivePage));\r
-\r
-               pT->UpdateTitleBar();\r
-               pT->UpdateMenu();\r
-       }\r
-\r
-       HIMAGELIST GetImageList() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return m_tab.GetImageList();\r
-       }\r
-\r
-       HIMAGELIST SetImageList(HIMAGELIST hImageList)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return m_tab.SetImageList(hImageList);\r
-       }\r
-\r
-       void SetWindowMenu(HMENU hMenu)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               m_menu = hMenu;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateMenu();\r
-       }\r
-\r
-       void SetTitleBarWindow(HWND hWnd)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               delete [] m_lpstrTitleBarBase;\r
-               m_lpstrTitleBarBase = NULL;\r
-\r
-               m_wndTitleBar = hWnd;\r
-               if(hWnd == NULL)\r
-                       return;\r
-\r
-               int cchLen = m_wndTitleBar.GetWindowTextLength() + 1;\r
-               ATLTRY(m_lpstrTitleBarBase = new TCHAR[cchLen]);\r
-               if(m_lpstrTitleBarBase != NULL)\r
-               {\r
-                       m_wndTitleBar.GetWindowText(m_lpstrTitleBarBase, cchLen);\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateTitleBar();\r
-               }\r
-       }\r
-\r
-// Page attributes\r
-       HWND GetPageHWND(int nPage) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_PARAM;\r
-               m_tab.GetItem(nPage, tcix);\r
-\r
-               return tcix.tvpage.hWnd;\r
-       }\r
-\r
-       LPCTSTR GetPageTitle(int nPage) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_PARAM;\r
-               if(m_tab.GetItem(nPage, tcix) == FALSE)\r
-                       return NULL;\r
-\r
-               return tcix.tvpage.lpstrTitle;\r
-       }\r
-\r
-       bool SetPageTitle(int nPage, LPCTSTR lpstrTitle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               int cchBuff = lstrlen(lpstrTitle) + 1;\r
-               LPTSTR lpstrBuff = NULL;\r
-               ATLTRY(lpstrBuff = new TCHAR[cchBuff]);\r
-               if(lpstrBuff == NULL)\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(lpstrBuff, cchBuff, lpstrTitle);\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_PARAM;\r
-               if(m_tab.GetItem(nPage, tcix) == FALSE)\r
-                       return false;\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrTabText = buff.Allocate(m_cchTabTextLength + 1);\r
-               if(lpstrTabText == NULL)\r
-                       return false;\r
-\r
-               delete [] tcix.tvpage.lpstrTitle;\r
-\r
-               pT->ShortenTitle(lpstrTitle, lpstrTabText, m_cchTabTextLength + 1);\r
-\r
-               tcix.tciheader.mask = TCIF_TEXT | TCIF_PARAM;\r
-               tcix.tciheader.pszText = lpstrTabText;\r
-               tcix.tvpage.lpstrTitle = lpstrBuff;\r
-               if(m_tab.SetItem(nPage, tcix) == FALSE)\r
-                       return false;\r
-\r
-               pT->UpdateTitleBar();\r
-               pT->UpdateMenu();\r
-\r
-               return true;\r
-       }\r
-\r
-       LPVOID GetPageData(int nPage) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_PARAM;\r
-               m_tab.GetItem(nPage, tcix);\r
-\r
-               return tcix.tvpage.pData;\r
-       }\r
-\r
-       LPVOID SetPageData(int nPage, LPVOID pData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_PARAM;\r
-               m_tab.GetItem(nPage, tcix);\r
-               LPVOID pDataOld = tcix.tvpage.pData;\r
-\r
-               tcix.tvpage.pData = pData;\r
-               m_tab.SetItem(nPage, tcix);\r
-\r
-               return pDataOld;\r
-       }\r
-\r
-       int GetPageImage(int nPage) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_IMAGE;\r
-               m_tab.GetItem(nPage, tcix);\r
-\r
-               return tcix.tciheader.iImage;\r
-       }\r
-\r
-       int SetPageImage(int nPage, int nImage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_IMAGE;\r
-               m_tab.GetItem(nPage, tcix);\r
-               int nImageOld = tcix.tciheader.iImage;\r
-\r
-               tcix.tciheader.iImage = nImage;\r
-               m_tab.SetItem(nPage, tcix);\r
-\r
-               return nImageOld;\r
-       }\r
-\r
-// Operations\r
-       bool AddPage(HWND hWndView, LPCTSTR lpstrTitle, int nImage = -1, LPVOID pData = NULL)\r
-       {\r
-               return InsertPage(GetPageCount(), hWndView, lpstrTitle, nImage, pData);\r
-       }\r
-\r
-       bool InsertPage(int nPage, HWND hWndView, LPCTSTR lpstrTitle, int nImage = -1, LPVOID pData = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(nPage == GetPageCount() || IsValidPageIndex(nPage));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               int cchBuff = lstrlen(lpstrTitle) + 1;\r
-               LPTSTR lpstrBuff = NULL;\r
-               ATLTRY(lpstrBuff = new TCHAR[cchBuff]);\r
-               if(lpstrBuff == NULL)\r
-                       return false;\r
-\r
-               SecureHelper::strcpy_x(lpstrBuff, cchBuff, lpstrTitle);\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrTabText = buff.Allocate(m_cchTabTextLength + 1);\r
-               if(lpstrTabText == NULL)\r
-                       return false;\r
-\r
-               pT->ShortenTitle(lpstrTitle, lpstrTabText, m_cchTabTextLength + 1);\r
-\r
-               SetRedraw(FALSE);\r
-\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;\r
-               tcix.tciheader.pszText = lpstrTabText;\r
-               tcix.tciheader.iImage = nImage;\r
-               tcix.tvpage.hWnd = hWndView;\r
-               tcix.tvpage.lpstrTitle = lpstrBuff;\r
-               tcix.tvpage.pData = pData;\r
-               int nItem = m_tab.InsertItem(nPage, tcix);\r
-               if(nItem == -1)\r
-               {\r
-                       delete [] lpstrBuff;\r
-                       SetRedraw(TRUE);\r
-                       return false;\r
-               }\r
-\r
-               SetActivePage(nItem);\r
-               pT->OnPageActivated(m_nActivePage);\r
-\r
-               if(GetPageCount() == 1)\r
-                       pT->ShowTabControl(true);\r
-\r
-               pT->UpdateLayout();\r
-\r
-               SetRedraw(TRUE);\r
-               RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\r
-\r
-               return true;\r
-       }\r
-\r
-       void RemovePage(int nPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(IsValidPageIndex(nPage));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               SetRedraw(FALSE);\r
-\r
-               if(GetPageCount() == 1)\r
-                       pT->ShowTabControl(false);\r
-\r
-               if(m_bDestroyPageOnRemove)\r
-                       ::DestroyWindow(GetPageHWND(nPage));\r
-               else\r
-                       ::ShowWindow(GetPageHWND(nPage), FALSE);\r
-               LPTSTR lpstrTitle = (LPTSTR)GetPageTitle(nPage);\r
-               delete [] lpstrTitle;\r
-\r
-               ATLVERIFY(m_tab.DeleteItem(nPage) != FALSE);\r
-\r
-               if(m_nActivePage == nPage)\r
-               {\r
-                       m_nActivePage = -1;\r
-\r
-                       if(nPage > 0)\r
-                       {\r
-                               SetActivePage(nPage - 1);\r
-                       }\r
-                       else if(GetPageCount() > 0)\r
-                       {\r
-                               SetActivePage(nPage);\r
-                       }\r
-                       else\r
-                       {\r
-                               SetRedraw(TRUE);\r
-                               Invalidate();\r
-                               UpdateWindow();\r
-                               pT->UpdateTitleBar();\r
-                               pT->UpdateMenu();\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       nPage = (nPage < m_nActivePage) ? (m_nActivePage - 1) : m_nActivePage;\r
-                       m_nActivePage = -1;\r
-                       SetActivePage(nPage);\r
-               }\r
-\r
-               pT->OnPageActivated(m_nActivePage);\r
-       }\r
-\r
-       void RemoveAllPages()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               if(GetPageCount() == 0)\r
-                       return;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               SetRedraw(FALSE);\r
-\r
-               pT->ShowTabControl(false);\r
-\r
-               for(int i = 0; i < GetPageCount(); i++)\r
-               {\r
-                       if(m_bDestroyPageOnRemove)\r
-                               ::DestroyWindow(GetPageHWND(i));\r
-                       else\r
-                               ::ShowWindow(GetPageHWND(i), FALSE);\r
-                       LPTSTR lpstrTitle = (LPTSTR)GetPageTitle(i);\r
-                       delete [] lpstrTitle;\r
-               }\r
-               m_tab.DeleteAllItems();\r
-\r
-               m_nActivePage = -1;\r
-               pT->OnPageActivated(m_nActivePage);\r
-\r
-               SetRedraw(TRUE);\r
-               Invalidate();\r
-               UpdateWindow();\r
-\r
-               pT->UpdateTitleBar();\r
-               pT->UpdateMenu();\r
-       }\r
-\r
-       int PageIndexFromHwnd(HWND hWnd) const\r
-       {\r
-               int nIndex = -1;\r
-\r
-               for(int i = 0; i < GetPageCount(); i++)\r
-               {\r
-                       if(GetPageHWND(i) == hWnd)\r
-                       {\r
-                               nIndex = i;\r
-                               break;\r
-                       }\r
-               }\r
-\r
-               return nIndex;\r
-       }\r
-\r
-       void BuildWindowMenu(HMENU hMenu, int nMenuItemsCount = 10, bool bEmptyMenuItem = true, bool bWindowsMenuItem = true, bool bActivePageMenuItem = true, bool bActiveAsDefaultMenuItem = false)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               CMenuHandle menu = hMenu;\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               int nFirstPos = 0;\r
-\r
-               // Find first menu item in our range\r
-#ifndef _WIN32_WCE\r
-               for(nFirstPos = 0; nFirstPos < menu.GetMenuItemCount(); nFirstPos++)\r
-               {\r
-                       UINT nID = menu.GetMenuItemID(nFirstPos);\r
-                       if((nID >= ID_WINDOW_TABFIRST && nID <= ID_WINDOW_TABLAST) || nID == ID_WINDOW_SHOWTABLIST)\r
-                               break;\r
-               }\r
-#else // CE specific\r
-               for(nFirstPos = 0; ; nFirstPos++)\r
-               {\r
-                       CMenuItemInfo mii;\r
-                       mii.fMask = MIIM_ID;\r
-                       BOOL bRet = menu.GetMenuItemInfo(nFirstPos, TRUE, &mii);\r
-                       if(bRet == FALSE)\r
-                               break;\r
-                       if((mii.wID >= ID_WINDOW_TABFIRST && mii.wID <= ID_WINDOW_TABLAST) || mii.wID == ID_WINDOW_SHOWTABLIST)\r
-                               break;\r
-               }\r
-#endif // _WIN32_WCE\r
-\r
-               // Remove all menu items for tab pages\r
-               BOOL bRet = TRUE;\r
-               while(bRet != FALSE)\r
-                       bRet = menu.DeleteMenu(nFirstPos, MF_BYPOSITION);\r
-\r
-               // Add separator if it's not already there\r
-               int nPageCount = GetPageCount();\r
-               if((bWindowsMenuItem || (nPageCount > 0)) && (nFirstPos > 0))\r
-               {\r
-                       CMenuItemInfo mii;\r
-                       mii.fMask = MIIM_TYPE;\r
-                       menu.GetMenuItemInfo(nFirstPos - 1, TRUE, &mii);\r
-                       if((nFirstPos <= 0) || ((mii.fType & MFT_SEPARATOR) == 0))\r
-                       {\r
-                               menu.AppendMenu(MF_SEPARATOR);\r
-                               nFirstPos++;\r
-                       }\r
-               }\r
-\r
-               // Add menu items for all pages\r
-               if(nPageCount > 0)\r
-               {\r
-                       // Append menu items for all pages\r
-                       const int cchPrefix = 3;   // 2 digits + space\r
-                       nMenuItemsCount = min(min(nPageCount, nMenuItemsCount), (int)m_nMenuItemsMax);\r
-                       ATLASSERT(nMenuItemsCount < 100);   // 2 digits only\r
-                       if(nMenuItemsCount >= 100)\r
-                               nMenuItemsCount = 99;\r
-\r
-                       for(int i = 0; i < nMenuItemsCount; i++)\r
-                       {\r
-                               LPCTSTR lpstrTitle = GetPageTitle(i);\r
-                               int nLen = lstrlen(lpstrTitle);\r
-                               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-                               LPTSTR lpstrText = buff.Allocate(cchPrefix + nLen + 1);\r
-                               ATLASSERT(lpstrText != NULL);\r
-                               if(lpstrText != NULL)\r
-                               {\r
-                                       LPCTSTR lpstrFormat = (i < 9) ? _T("&%i %s") : _T("%i %s");\r
-                                       SecureHelper::wsprintf_x(lpstrText, cchPrefix + nLen + 1, lpstrFormat, i + 1, lpstrTitle);\r
-                                       menu.AppendMenu(MF_STRING, ID_WINDOW_TABFIRST + i, lpstrText);\r
-                               }\r
-                       }\r
-\r
-                       // Mark active page\r
-                       if(bActivePageMenuItem && (m_nActivePage != -1))\r
-                       {\r
-#ifndef _WIN32_WCE\r
-                               if(bActiveAsDefaultMenuItem)\r
-                               {\r
-                                       menu.SetMenuDefaultItem((UINT)-1,  TRUE);\r
-                                       menu.SetMenuDefaultItem(nFirstPos + m_nActivePage,  TRUE);\r
-                               }\r
-                               else\r
-#else // CE specific\r
-                               bActiveAsDefaultMenuItem;   // avoid level 4 warning\r
-#endif // _WIN32_WCE\r
-                               {\r
-                                       menu.CheckMenuRadioItem(nFirstPos, nFirstPos + nMenuItemsCount, nFirstPos + m_nActivePage, MF_BYPOSITION);\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if(bEmptyMenuItem)\r
-                       {\r
-                               menu.AppendMenu(MF_BYPOSITION | MF_STRING, ID_WINDOW_TABFIRST, pT->GetEmptyListText());\r
-                               menu.EnableMenuItem(ID_WINDOW_TABFIRST, MF_GRAYED);\r
-                       }\r
-\r
-                       // Remove separator if nothing else is there\r
-                       if(!bEmptyMenuItem && !bWindowsMenuItem && (nFirstPos > 0))\r
-                       {\r
-                               CMenuItemInfo mii;\r
-                               mii.fMask = MIIM_TYPE;\r
-                               menu.GetMenuItemInfo(nFirstPos - 1, TRUE, &mii);\r
-                               if((mii.fType & MFT_SEPARATOR) != 0)\r
-                                       menu.DeleteMenu(nFirstPos - 1, MF_BYPOSITION);\r
-                       }\r
-               }\r
-\r
-               // Add "Windows..." menu item\r
-               if(bWindowsMenuItem)\r
-                       menu.AppendMenu(MF_BYPOSITION | MF_STRING, ID_WINDOW_SHOWTABLIST, pT->GetWindowsMenuItemText());\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CTabViewImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\r
-               NOTIFY_HANDLER(m_nTabID, TCN_SELCHANGE, OnTabChanged)\r
-               NOTIFY_ID_HANDLER(m_nTabID, OnTabNotification)\r
-#ifndef _WIN32_WCE\r
-               NOTIFY_CODE_HANDLER(TTN_GETDISPINFO, OnTabGetDispInfo)\r
-#endif // !_WIN32_WCE\r
-               FORWARD_NOTIFICATIONS()\r
-       ALT_MSG_MAP(1)   // tab control\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, OnTabLButtonDown)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, OnTabLButtonUp)\r
-               MESSAGE_HANDLER(WM_CAPTURECHANGED, OnTabCaptureChanged)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, OnTabMouseMove)\r
-               MESSAGE_HANDLER(WM_RBUTTONUP, OnTabRButtonUp)\r
-               MESSAGE_HANDLER(WM_SYSKEYDOWN, OnTabSysKeyDown)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->CreateTabControl();\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               RemoveAllPages();\r
-\r
-               if(m_bDestroyImageList)\r
-               {\r
-                       CImageList il = m_tab.SetImageList(NULL);\r
-                       if(il.m_hImageList != NULL)\r
-                               il.Destroy();\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(m_nActivePage != -1)\r
-                       ::SetFocus(GetPageHWND(m_nActivePage));\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabChanged(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\r
-       {\r
-               SetActivePage(m_tab.GetCurSel());\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnPageActivated(m_nActivePage);\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabNotification(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\r
-       {\r
-               // nothing to do - this just blocks all tab control\r
-               // notifications from being propagated further\r
-               return 0;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnTabGetDispInfo(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               LPNMTTDISPINFO pTTDI = (LPNMTTDISPINFO)pnmh;\r
-               if(pTTDI->hdr.hwndFrom == m_tab.GetTooltips())\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateTooltipText(pTTDI);\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-\r
-               return 0;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Tab control message handlers\r
-       LRESULT OnTabLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(m_tab.GetItemCount() > 1)\r
-               {\r
-                       m_bTabCapture = true;\r
-                       m_tab.SetCapture();\r
-\r
-                       m_ptStartDrag.x = GET_X_LPARAM(lParam);\r
-                       m_ptStartDrag.y = GET_Y_LPARAM(lParam);\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(m_bTabCapture)\r
-               {\r
-                       if(m_bTabDrag)\r
-                       {\r
-                               TCHITTESTINFO hti = { 0 };\r
-                               hti.pt.x = GET_X_LPARAM(lParam);\r
-                               hti.pt.y = GET_Y_LPARAM(lParam);\r
-                               int nItem = m_tab.HitTest(&hti);\r
-                               if(nItem != -1)\r
-                                       MovePage(m_nActivePage, nItem);\r
-                       }\r
-\r
-                       ::ReleaseCapture();\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_bTabCapture)\r
-               {\r
-                       m_bTabCapture = false;\r
-\r
-                       if(m_bTabDrag)\r
-                       {\r
-                               m_bTabDrag = false;\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->DrawMoveMark(-1);\r
-\r
-#ifndef _WIN32_WCE\r
-                               m_ilDrag.DragLeave(GetDesktopWindow());\r
-#endif // !_WIN32_WCE\r
-                               m_ilDrag.EndDrag();\r
-\r
-                               m_ilDrag.Destroy();\r
-                               m_ilDrag.m_hImageList = NULL;\r
-                       }\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-\r
-               if(m_bTabCapture)\r
-               {\r
-                       POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-\r
-                       if(!m_bTabDrag)\r
-                       {\r
-#ifndef _WIN32_WCE\r
-                               if(abs(m_ptStartDrag.x - GET_X_LPARAM(lParam)) >= ::GetSystemMetrics(SM_CXDRAG) ||\r
-                                  abs(m_ptStartDrag.y - GET_Y_LPARAM(lParam)) >= ::GetSystemMetrics(SM_CYDRAG))\r
-#else // CE specific\r
-                               if(abs(m_ptStartDrag.x - GET_X_LPARAM(lParam)) >= 4 ||\r
-                                  abs(m_ptStartDrag.y - GET_Y_LPARAM(lParam)) >= 4)\r
-#endif // _WIN32_WCE\r
-                               {\r
-                                       T* pT = static_cast<T*>(this);\r
-                                       pT->GenerateDragImage(m_nActivePage);\r
-\r
-                                       int cxCursor = ::GetSystemMetrics(SM_CXCURSOR);\r
-                                       int cyCursor = ::GetSystemMetrics(SM_CYCURSOR);\r
-                                       m_ilDrag.BeginDrag(0, -(cxCursor / 2), -(cyCursor / 2));\r
-#ifndef _WIN32_WCE\r
-                                       POINT ptEnter = m_ptStartDrag;\r
-                                       m_tab.ClientToScreen(&ptEnter);\r
-                                       m_ilDrag.DragEnter(GetDesktopWindow(), ptEnter);\r
-#endif // !_WIN32_WCE\r
-\r
-                                       m_bTabDrag = true;\r
-                               }\r
-                       }\r
-\r
-                       if(m_bTabDrag)\r
-                       {\r
-                               TCHITTESTINFO hti = { 0 };\r
-                               hti.pt = pt;\r
-                               int nItem = m_tab.HitTest(&hti);\r
-\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->SetMoveCursor(nItem != -1);\r
-\r
-                               if(m_nInsertItem != nItem)\r
-                                       pT->DrawMoveMark(nItem);\r
-\r
-                               m_ilDrag.DragShowNolock((nItem != -1) ? TRUE : FALSE);\r
-                               m_tab.ClientToScreen(&pt);\r
-                               m_ilDrag.DragMove(pt);\r
-\r
-                               bHandled = TRUE;\r
-                       }\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabRButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               TCHITTESTINFO hti = { 0 };\r
-               hti.pt.x = GET_X_LPARAM(lParam);\r
-               hti.pt.y = GET_Y_LPARAM(lParam);\r
-               int nItem = m_tab.HitTest(&hti);\r
-               if(nItem != -1)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->OnContextMenu(nItem, hti.pt);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnTabSysKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               bool bShift = (::GetKeyState(VK_SHIFT) < 0);\r
-               if(wParam == VK_F10 && bShift)\r
-               {\r
-                       if(m_nActivePage != -1)\r
-                       {\r
-                               RECT rect = { 0 };\r
-                               m_tab.GetItemRect(m_nActivePage, &rect);\r
-                               POINT pt = { rect.left, rect.bottom };\r
-                               T* pT = static_cast<T*>(this);\r
-                               pT->OnContextMenu(m_nActivePage, pt);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-// Implementation helpers\r
-       bool IsValidPageIndex(int nPage) const\r
-       {\r
-               return (nPage >= 0 && nPage < GetPageCount());\r
-       }\r
-\r
-       bool MovePage(int nMovePage, int nInsertBeforePage)\r
-       {\r
-               ATLASSERT(IsValidPageIndex(nMovePage));\r
-               ATLASSERT(IsValidPageIndex(nInsertBeforePage));\r
-\r
-               if(!IsValidPageIndex(nMovePage) || !IsValidPageIndex(nInsertBeforePage))\r
-                       return false;\r
-\r
-               if(nMovePage == nInsertBeforePage)\r
-                       return true;   // nothing to do\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpstrTabText = buff.Allocate(m_cchTabTextLength + 1);\r
-               if(lpstrTabText == NULL)\r
-                       return false;\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;\r
-               tcix.tciheader.pszText = lpstrTabText;\r
-               tcix.tciheader.cchTextMax = m_cchTabTextLength + 1;\r
-               BOOL bRet = m_tab.GetItem(nMovePage, tcix);\r
-               ATLASSERT(bRet != FALSE);\r
-               if(bRet == FALSE)\r
-                       return false;\r
-\r
-               int nInsertItem = (nInsertBeforePage > nMovePage) ? nInsertBeforePage + 1 : nInsertBeforePage;\r
-               int nNewItem = m_tab.InsertItem(nInsertItem, tcix);\r
-               ATLASSERT(nNewItem == nInsertItem);\r
-               if(nNewItem != nInsertItem)\r
-               {\r
-                       ATLVERIFY(m_tab.DeleteItem(nNewItem));\r
-                       return false;\r
-               }\r
-\r
-               if(nMovePage > nInsertBeforePage)\r
-                       ATLVERIFY(m_tab.DeleteItem(nMovePage + 1) != FALSE);\r
-               else if(nMovePage < nInsertBeforePage)\r
-                       ATLVERIFY(m_tab.DeleteItem(nMovePage) != FALSE);\r
-\r
-               SetActivePage(nInsertBeforePage);\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnPageActivated(m_nActivePage);\r
-\r
-               return true;\r
-       }\r
-\r
-// Implementation overrideables\r
-       bool CreateTabControl()\r
-       {\r
-#ifndef _WIN32_WCE\r
-               m_tab.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TCS_TOOLTIPS, 0, m_nTabID);\r
-#else // CE specific\r
-               m_tab.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, m_nTabID);\r
-#endif // _WIN32_WCE\r
-               ATLASSERT(m_tab.m_hWnd != NULL);\r
-               if(m_tab.m_hWnd == NULL)\r
-                       return false;\r
-\r
-               m_tab.SetFont(AtlGetDefaultGuiFont());\r
-\r
-               m_tab.SetItemExtra(sizeof(TABVIEWPAGE));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               m_cyTabHeight = pT->CalcTabHeight();\r
-\r
-               return true;\r
-       }\r
-\r
-       int CalcTabHeight()\r
-       {\r
-               int nCount = m_tab.GetItemCount();\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_TEXT;\r
-               tcix.tciheader.pszText = _T("NS");\r
-               int nIndex = m_tab.InsertItem(nCount, tcix);\r
-\r
-               RECT rect = { 0, 0, 1000, 1000 };\r
-               m_tab.AdjustRect(FALSE, &rect);\r
-\r
-               RECT rcWnd = { 0, 0, 1000, rect.top };\r
-               ::AdjustWindowRectEx(&rcWnd, m_tab.GetStyle(), FALSE, m_tab.GetExStyle());\r
-\r
-               int nHeight = rcWnd.bottom - rcWnd.top;\r
-\r
-               m_tab.DeleteItem(nIndex);\r
-\r
-               return nHeight;\r
-       }\r
-\r
-       void ShowTabControl(bool bShow)\r
-       {\r
-               m_tab.ShowWindow(bShow ? SW_SHOWNOACTIVATE : SW_HIDE);\r
-       }\r
-\r
-       void UpdateLayout()\r
-       {\r
-               RECT rect;\r
-               GetClientRect(&rect);\r
-\r
-               if(m_tab.IsWindow() && ((m_tab.GetStyle() & WS_VISIBLE) != 0))\r
-                       m_tab.SetWindowPos(NULL, 0, 0, rect.right - rect.left, m_cyTabHeight, SWP_NOZORDER);\r
-\r
-               if(m_nActivePage != -1)\r
-                       ::SetWindowPos(GetPageHWND(m_nActivePage), NULL, 0, m_cyTabHeight, rect.right - rect.left, rect.bottom - rect.top - m_cyTabHeight, SWP_NOZORDER);\r
-       }\r
-\r
-       void UpdateMenu()\r
-       {\r
-               if(m_menu.m_hMenu != NULL)\r
-                       BuildWindowMenu(m_menu, m_nMenuItemsCount, m_bEmptyMenuItem, m_bWindowsMenuItem, m_bActivePageMenuItem, m_bActiveAsDefaultMenuItem);\r
-       }\r
-\r
-       void UpdateTitleBar()\r
-       {\r
-               if(!m_wndTitleBar.IsWindow() || m_lpstrTitleBarBase == NULL)\r
-                       return;   // nothing to do\r
-\r
-               if(m_nActivePage != -1)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       LPCTSTR lpstrTitle = pT->GetPageTitle(m_nActivePage);\r
-                       LPCTSTR lpstrDivider = pT->GetTitleDividerText();\r
-                       int cchBuffer = m_cchTitleBarLength + lstrlen(lpstrDivider) + lstrlen(m_lpstrTitleBarBase) + 1;\r
-                       CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-                       LPTSTR lpstrPageTitle = buff.Allocate(cchBuffer);\r
-                       ATLASSERT(lpstrPageTitle != NULL);\r
-                       if(lpstrPageTitle != NULL)\r
-                       {\r
-                               pT->ShortenTitle(lpstrTitle, lpstrPageTitle, m_cchTitleBarLength + 1);\r
-                               SecureHelper::strcat_x(lpstrPageTitle, cchBuffer, lpstrDivider);\r
-                               SecureHelper::strcat_x(lpstrPageTitle, cchBuffer, m_lpstrTitleBarBase);\r
-                       }\r
-                       else\r
-                       {\r
-                               lpstrPageTitle = m_lpstrTitleBarBase;\r
-                       }\r
-\r
-                       m_wndTitleBar.SetWindowText(lpstrPageTitle);\r
-               }\r
-               else\r
-               {\r
-                       m_wndTitleBar.SetWindowText(m_lpstrTitleBarBase);\r
-               }\r
-       }\r
-\r
-       void DrawMoveMark(int nItem)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               if(m_nInsertItem != -1)\r
-               {\r
-                       RECT rect = { 0 };\r
-                       pT->GetMoveMarkRect(rect);\r
-                       m_tab.InvalidateRect(&rect);\r
-               }\r
-\r
-               m_nInsertItem = nItem;\r
-\r
-               if(m_nInsertItem != -1)\r
-               {\r
-                       CClientDC dc(m_tab.m_hWnd);\r
-\r
-                       RECT rect = { 0 };\r
-                       pT->GetMoveMarkRect(rect);\r
-\r
-                       CPen pen;\r
-                       pen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_WINDOWTEXT));\r
-                       CBrush brush;\r
-                       brush.CreateSolidBrush(::GetSysColor(COLOR_WINDOWTEXT));\r
-\r
-                       HPEN hPenOld = dc.SelectPen(pen);\r
-                       HBRUSH hBrushOld = dc.SelectBrush(brush);\r
-\r
-                       int x = rect.left;\r
-                       int y = rect.top;\r
-                       POINT ptsTop[3] = { { x, y }, { x + m_cxMoveMark, y }, { x + (m_cxMoveMark / 2), y + m_cyMoveMark } };\r
-                       dc.Polygon(ptsTop, 3);\r
-\r
-                       y = rect.bottom - 1;\r
-                       POINT ptsBottom[3] = { { x, y }, { x + m_cxMoveMark, y }, { x + (m_cxMoveMark / 2), y - m_cyMoveMark } };\r
-                       dc.Polygon(ptsBottom, 3);\r
-\r
-                       dc.SelectPen(hPenOld);\r
-                       dc.SelectBrush(hBrushOld);\r
-               }\r
-       }\r
-\r
-       void GetMoveMarkRect(RECT& rect) const\r
-       {\r
-               m_tab.GetClientRect(&rect);\r
-\r
-               RECT rcItem = { 0 };\r
-               m_tab.GetItemRect(m_nInsertItem, &rcItem);\r
-\r
-               if(m_nInsertItem <= m_nActivePage)\r
-               {\r
-                       rect.left = rcItem.left - m_cxMoveMark / 2 - 1;\r
-                       rect.right = rcItem.left + m_cxMoveMark / 2;\r
-               }\r
-               else\r
-               {\r
-                       rect.left = rcItem.right - m_cxMoveMark / 2 - 1;\r
-                       rect.right = rcItem.right + m_cxMoveMark / 2;\r
-               }\r
-       }\r
-\r
-       void SetMoveCursor(bool bCanMove)\r
-       {\r
-               ::SetCursor(::LoadCursor(NULL, bCanMove ? IDC_ARROW : IDC_NO));\r
-       }\r
-\r
-       void GenerateDragImage(int nItem)\r
-       {\r
-               ATLASSERT(IsValidPageIndex(nItem));\r
-\r
-#ifndef _WIN32_WCE\r
-               RECT rcItem = { 0 };\r
-               m_tab.GetItemRect(nItem, &rcItem);\r
-               ::InflateRect(&rcItem, 2, 2);   // make bigger to cover selected item\r
-#else // CE specific\r
-               nItem;   // avoid level 4 warning\r
-               RECT rcItem = { 0, 0, 40, 20 };\r
-#endif // _WIN32_WCE\r
-\r
-               ATLASSERT(m_ilDrag.m_hImageList == NULL);\r
-               m_ilDrag.Create(rcItem.right - rcItem.left, rcItem.bottom - rcItem.top, ILC_COLORDDB | ILC_MASK, 1, 1);\r
-\r
-               CClientDC dc(m_hWnd);\r
-               CDC dcMem;\r
-               dcMem.CreateCompatibleDC(dc);\r
-               ATLASSERT(dcMem.m_hDC != NULL);\r
-               dcMem.SetViewportOrg(-rcItem.left, -rcItem.top);\r
-\r
-               CBitmap bmp;\r
-               bmp.CreateCompatibleBitmap(dc, rcItem.right - rcItem.left, rcItem.bottom - rcItem.top);\r
-               ATLASSERT(bmp.m_hBitmap != NULL);\r
-\r
-               HBITMAP hBmpOld = dcMem.SelectBitmap(bmp);\r
-#ifndef _WIN32_WCE\r
-               m_tab.SendMessage(WM_PRINTCLIENT, (WPARAM)dcMem.m_hDC);\r
-#else // CE specific\r
-               dcMem.Rectangle(&rcItem);\r
-#endif // _WIN32_WCE\r
-               dcMem.SelectBitmap(hBmpOld);\r
-\r
-               ATLVERIFY(m_ilDrag.Add(bmp.m_hBitmap, RGB(255, 0, 255)) != -1);\r
-       }\r
-\r
-       void ShortenTitle(LPCTSTR lpstrTitle, LPTSTR lpstrShortTitle, int cchShortTitle)\r
-       {\r
-               if(lstrlen(lpstrTitle) >= cchShortTitle)\r
-               {\r
-                       LPCTSTR lpstrEllipsis = _T("...");\r
-                       int cchEllipsis = lstrlen(lpstrEllipsis);\r
-                       SecureHelper::strncpy_x(lpstrShortTitle, cchShortTitle, lpstrTitle, cchShortTitle - cchEllipsis - 1);\r
-                       SecureHelper::strcat_x(lpstrShortTitle, cchShortTitle, lpstrEllipsis);\r
-               }\r
-               else\r
-               {\r
-                       SecureHelper::strcpy_x(lpstrShortTitle, cchShortTitle, lpstrTitle);\r
-               }\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       void UpdateTooltipText(LPNMTTDISPINFO pTTDI)\r
-       {\r
-               ATLASSERT(pTTDI != NULL);\r
-               pTTDI->lpszText = (LPTSTR)GetPageTitle((int)pTTDI->hdr.idFrom);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Text for menu items and title bar - override to provide different strings\r
-       static LPCTSTR GetEmptyListText()\r
-       {\r
-               return _T("(Empty)");\r
-       }\r
-\r
-       static LPCTSTR GetWindowsMenuItemText()\r
-       {\r
-               return _T("&Windows...");\r
-       }\r
-\r
-       static LPCTSTR GetTitleDividerText()\r
-       {\r
-               return _T(" - ");\r
-       }\r
-\r
-// Notifications - override to provide different behavior\r
-       void OnPageActivated(int nPage)\r
-       {\r
-               NMHDR nmhdr = { 0 };\r
-               nmhdr.hwndFrom = m_hWnd;\r
-               nmhdr.idFrom = nPage;\r
-               nmhdr.code = TBVN_PAGEACTIVATED;\r
-               ::SendMessage(GetParent(), WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&nmhdr);\r
-       }\r
-\r
-       void OnContextMenu(int nPage, POINT pt)\r
-       {\r
-               m_tab.ClientToScreen(&pt);\r
-\r
-               TBVCONTEXTMENUINFO cmi = { 0 };\r
-               cmi.hdr.hwndFrom = m_hWnd;\r
-               cmi.hdr.idFrom = nPage;\r
-               cmi.hdr.code = TBVN_CONTEXTMENU;\r
-               cmi.pt = pt;\r
-               ::SendMessage(GetParent(), WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&cmi);\r
-       }\r
-};\r
-\r
-\r
-class CTabView : public CTabViewImpl<CTabView>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_TabView"), 0, COLOR_APPWORKSPACE)\r
-};\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLCTRLX_H__\r
diff --git a/WTL80/include/atlddx.h b/WTL80/include/atlddx.h
deleted file mode 100644 (file)
index ad4249a..0000000
+++ /dev/null
@@ -1,624 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLDDX_H__\r
-#define __ATLDDX_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlddx.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#if defined(_ATL_USE_DDX_FLOAT) && defined(_ATL_MIN_CRT)\r
-       #error Cannot use floating point DDX with _ATL_MIN_CRT defined\r
-#endif // defined(_ATL_USE_DDX_FLOAT) && defined(_ATL_MIN_CRT)\r
-\r
-#ifdef _ATL_USE_DDX_FLOAT\r
-  #include <float.h>\r
-#endif // _ATL_USE_DDX_FLOAT\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CWinDataExchange<T>\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-// Constants\r
-#define DDX_LOAD       FALSE\r
-#define DDX_SAVE       TRUE\r
-\r
-// DDX map macros\r
-#define BEGIN_DDX_MAP(thisClass) \\r
-       BOOL DoDataExchange(BOOL bSaveAndValidate = FALSE, UINT nCtlID = (UINT)-1) \\r
-       { \\r
-               bSaveAndValidate; \\r
-               nCtlID;\r
-\r
-#define DDX_TEXT(nID, var) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_TEXT_LEN(nID, var, len) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate, TRUE, len)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_INT(nID, var) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Int(nID, var, TRUE, bSaveAndValidate)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_INT_RANGE(nID, var, min, max) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Int(nID, var, TRUE, bSaveAndValidate, TRUE, min, max)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_UINT(nID, var) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Int(nID, var, FALSE, bSaveAndValidate)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_UINT_RANGE(nID, var, min, max) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Int(nID, var, FALSE, bSaveAndValidate, TRUE, min, max)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#ifdef _ATL_USE_DDX_FLOAT\r
-#define DDX_FLOAT(nID, var) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Float(nID, var, bSaveAndValidate)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_FLOAT_RANGE(nID, var, min, max) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Float(nID, var, bSaveAndValidate, TRUE, min, max)) \\r
-                               return FALSE; \\r
-               }\r
-#define DDX_FLOAT_P(nID, var, precision) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Float(nID, var, bSaveAndValidate, FALSE, 0, 0, precision)) \\r
-                               return FALSE; \\r
-               }\r
-\r
-#define DDX_FLOAT_P_RANGE(nID, var, min, max, precision) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-               { \\r
-                       if(!DDX_Float(nID, var, bSaveAndValidate, TRUE, min, max, precision)) \\r
-                               return FALSE; \\r
-               }\r
-#endif // _ATL_USE_DDX_FLOAT\r
-\r
-#define DDX_CONTROL(nID, obj) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-                       DDX_Control(nID, obj, bSaveAndValidate);\r
-\r
-#define DDX_CONTROL_HANDLE(nID, obj) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-                       DDX_Control_Handle(nID, obj, bSaveAndValidate);\r
-\r
-#define DDX_CHECK(nID, var) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-                       DDX_Check(nID, var, bSaveAndValidate);\r
-\r
-#define DDX_RADIO(nID, var) \\r
-               if(nCtlID == (UINT)-1 || nCtlID == nID) \\r
-                       DDX_Radio(nID, var, bSaveAndValidate);\r
-\r
-#define END_DDX_MAP() \\r
-               return TRUE; \\r
-       }\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWinDataExchange - provides support for DDX\r
-\r
-template <class T>\r
-class CWinDataExchange\r
-{\r
-public:\r
-// Data exchange method - override in your derived class\r
-       BOOL DoDataExchange(BOOL /*bSaveAndValidate*/ = FALSE, UINT /*nCtlID*/ = (UINT)-1)\r
-       {\r
-               // this one should never be called, override it in\r
-               // your derived class by implementing DDX map\r
-               ATLASSERT(FALSE);\r
-               return FALSE;\r
-       }\r
-\r
-// Helpers for validation error reporting\r
-       enum _XDataType\r
-       {\r
-               ddxDataNull = 0,\r
-               ddxDataText = 1,\r
-               ddxDataInt = 2,\r
-               ddxDataFloat = 3,\r
-               ddxDataDouble = 4\r
-       };\r
-\r
-       struct _XTextData\r
-       {\r
-               int nLength;\r
-               int nMaxLength;\r
-       };\r
-\r
-       struct _XIntData\r
-       {\r
-               long nVal;\r
-               long nMin;\r
-               long nMax;\r
-       };\r
-\r
-       struct _XFloatData\r
-       {\r
-               double nVal;\r
-               double nMin;\r
-               double nMax;\r
-       };\r
-\r
-       struct _XData\r
-       {\r
-               _XDataType nDataType;\r
-               union\r
-               {\r
-                       _XTextData textData;\r
-                       _XIntData intData;\r
-                       _XFloatData floatData;\r
-               };\r
-       };\r
-\r
-// Text exchange\r
-       BOOL DDX_Text(UINT nID, LPTSTR lpstrText, int cbSize, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-\r
-               if(bSave)\r
-               {\r
-                       HWND hWndCtrl = pT->GetDlgItem(nID);\r
-                       int nRetLen = ::GetWindowText(hWndCtrl, lpstrText, cbSize / sizeof(TCHAR));\r
-                       if(nRetLen < ::GetWindowTextLength(hWndCtrl))\r
-                               bSuccess = FALSE;\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(!bValidate || lstrlen(lpstrText) <= nLength);\r
-                       bSuccess = pT->SetDlgItemText(nID, lpstrText);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nLength > 0);\r
-                       if(lstrlen(lpstrText) > nLength)\r
-                       {\r
-                               _XData data = { ddxDataText };\r
-                               data.textData.nLength = lstrlen(lpstrText);\r
-                               data.textData.nMaxLength = nLength;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-\r
-       BOOL DDX_Text(UINT nID, BSTR& bstrText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-\r
-               if(bSave)\r
-               {\r
-                       bSuccess = pT->GetDlgItemText(nID, bstrText);\r
-               }\r
-               else\r
-               {\r
-                       USES_CONVERSION;\r
-                       LPTSTR lpstrText = OLE2T(bstrText);\r
-                       ATLASSERT(!bValidate || lstrlen(lpstrText) <= nLength);\r
-                       bSuccess = pT->SetDlgItemText(nID, lpstrText);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nLength > 0);\r
-                       if((int)::SysStringLen(bstrText) > nLength)\r
-                       {\r
-                               _XData data = { ddxDataText };\r
-                               data.textData.nLength = (int)::SysStringLen(bstrText);\r
-                               data.textData.nMaxLength = nLength;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-\r
-       BOOL DDX_Text(UINT nID, ATL::CComBSTR& bstrText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-\r
-               if(bSave)\r
-               {\r
-                       bSuccess = pT->GetDlgItemText(nID, (BSTR&)bstrText);\r
-               }\r
-               else\r
-               {\r
-                       USES_CONVERSION;\r
-                       LPTSTR lpstrText = OLE2T(bstrText);\r
-                       ATLASSERT(!bValidate || lstrlen(lpstrText) <= nLength);\r
-                       bSuccess = pT->SetDlgItemText(nID, lpstrText);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nLength > 0);\r
-                       if((int)bstrText.Length() > nLength)\r
-                       {\r
-                               _XData data = { ddxDataText };\r
-                               data.textData.nLength = (int)bstrText.Length();\r
-                               data.textData.nMaxLength = nLength;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       BOOL DDX_Text(UINT nID, _CSTRING_NS::CString& strText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-\r
-               if(bSave)\r
-               {\r
-                       HWND hWndCtrl = pT->GetDlgItem(nID);\r
-                       int nLen = ::GetWindowTextLength(hWndCtrl);\r
-                       int nRetLen = -1;\r
-                       LPTSTR lpstr = strText.GetBufferSetLength(nLen);\r
-                       if(lpstr != NULL)\r
-                       {\r
-                               nRetLen = ::GetWindowText(hWndCtrl, lpstr, nLen + 1);\r
-                               strText.ReleaseBuffer();\r
-                       }\r
-                       if(nRetLen < nLen)\r
-                               bSuccess = FALSE;\r
-               }\r
-               else\r
-               {\r
-                       bSuccess = pT->SetDlgItemText(nID, strText);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nLength > 0);\r
-                       if(strText.GetLength() > nLength)\r
-                       {\r
-                               _XData data = { ddxDataText };\r
-                               data.textData.nLength = strText.GetLength();\r
-                               data.textData.nMaxLength = nLength;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-// Numeric exchange\r
-       template <class Type>\r
-       BOOL DDX_Int(UINT nID, Type& nVal, BOOL bSigned, BOOL bSave, BOOL bValidate = FALSE, Type nMin = 0, Type nMax = 0)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-\r
-               if(bSave)\r
-               {\r
-                       nVal = (Type)pT->GetDlgItemInt(nID, &bSuccess, bSigned);\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(!bValidate || nVal >= nMin && nVal <= nMax);\r
-                       bSuccess = pT->SetDlgItemInt(nID, nVal, bSigned);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nMin != nMax);\r
-                       if(nVal < nMin || nVal > nMax)\r
-                       {\r
-                               _XData data = { ddxDataInt };\r
-                               data.intData.nVal = (long)nVal;\r
-                               data.intData.nMin = (long)nMin;\r
-                               data.intData.nMax = (long)nMax;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-\r
-// Float exchange\r
-#ifdef _ATL_USE_DDX_FLOAT\r
-       static BOOL _AtlSimpleFloatParse(LPCTSTR lpszText, double& d)\r
-       {\r
-               ATLASSERT(lpszText != NULL);\r
-               while (*lpszText == _T(' ') || *lpszText == _T('\t'))\r
-                       lpszText++;\r
-\r
-               TCHAR chFirst = lpszText[0];\r
-               d = _tcstod(lpszText, (LPTSTR*)&lpszText);\r
-               if (d == 0.0 && chFirst != _T('0'))\r
-                       return FALSE;   // could not convert\r
-               while (*lpszText == _T(' ') || *lpszText == _T('\t'))\r
-                       lpszText++;\r
-\r
-               if (*lpszText != _T('\0'))\r
-                       return FALSE;   // not terminated properly\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL DDX_Float(UINT nID, float& nVal, BOOL bSave, BOOL bValidate = FALSE, float nMin = 0.F, float nMax = 0.F, int nPrecision = FLT_DIG)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-               const int cchBuff = 32;\r
-               TCHAR szBuff[cchBuff] = { 0 };\r
-\r
-               if(bSave)\r
-               {\r
-                       pT->GetDlgItemText(nID, szBuff, cchBuff);\r
-                       double d = 0;\r
-                       if(_AtlSimpleFloatParse(szBuff, d))\r
-                               nVal = (float)d;\r
-                       else\r
-                               bSuccess = FALSE;\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(!bValidate || nVal >= nMin && nVal <= nMax);\r
-                       SecureHelper::sprintf_x(szBuff, cchBuff, _T("%.*g"), nPrecision, nVal);\r
-                       bSuccess = pT->SetDlgItemText(nID, szBuff);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nMin != nMax);\r
-                       if(nVal < nMin || nVal > nMax)\r
-                       {\r
-                               _XData data = { ddxDataFloat };\r
-                               data.floatData.nVal = (double)nVal;\r
-                               data.floatData.nMin = (double)nMin;\r
-                               data.floatData.nMax = (double)nMax;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-\r
-       BOOL DDX_Float(UINT nID, double& nVal, BOOL bSave, BOOL bValidate = FALSE, double nMin = 0., double nMax = 0., int nPrecision = DBL_DIG)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               BOOL bSuccess = TRUE;\r
-               const int cchBuff = 32;\r
-               TCHAR szBuff[cchBuff] = { 0 };\r
-\r
-               if(bSave)\r
-               {\r
-                       pT->GetDlgItemText(nID, szBuff, cchBuff);\r
-                       double d = 0;\r
-                       if(_AtlSimpleFloatParse(szBuff, d))\r
-                               nVal = d;\r
-                       else\r
-                               bSuccess = FALSE;\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(!bValidate || nVal >= nMin && nVal <= nMax);\r
-                       SecureHelper::sprintf_x(szBuff, cchBuff, _T("%.*g"), nPrecision, nVal);\r
-                       bSuccess = pT->SetDlgItemText(nID, szBuff);\r
-               }\r
-\r
-               if(!bSuccess)\r
-               {\r
-                       pT->OnDataExchangeError(nID, bSave);\r
-               }\r
-               else if(bSave && bValidate)   // validation\r
-               {\r
-                       ATLASSERT(nMin != nMax);\r
-                       if(nVal < nMin || nVal > nMax)\r
-                       {\r
-                               _XData data = { ddxDataFloat };\r
-                               data.floatData.nVal = nVal;\r
-                               data.floatData.nMin = nMin;\r
-                               data.floatData.nMax = nMax;\r
-                               pT->OnDataValidateError(nID, bSave, data);\r
-                               bSuccess = FALSE;\r
-                       }\r
-               }\r
-               return bSuccess;\r
-       }\r
-#endif // _ATL_USE_DDX_FLOAT\r
-\r
-// Full control subclassing (for CWindowImpl derived controls)\r
-       template <class TControl>\r
-       void DDX_Control(UINT nID, TControl& ctrl, BOOL bSave)\r
-       {\r
-               if(!bSave && ctrl.m_hWnd == NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       ctrl.SubclassWindow(pT->GetDlgItem(nID));\r
-               }\r
-       }\r
-\r
-// Simple control attaching (for HWND wrapper controls)\r
-       template <class TControl>\r
-       void DDX_Control_Handle(UINT nID, TControl& ctrl, BOOL bSave)\r
-       {\r
-               if(!bSave && ctrl.m_hWnd == NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       ctrl = pT->GetDlgItem(nID);\r
-               }\r
-       }\r
-\r
-// Control state\r
-       void DDX_Check(UINT nID, int& nValue, BOOL bSave)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               HWND hWndCtrl = pT->GetDlgItem(nID);\r
-               if(bSave)\r
-               {\r
-                       nValue = (int)::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L);\r
-                       ATLASSERT(nValue >= 0 && nValue <= 2);\r
-               }\r
-               else\r
-               {\r
-                       if(nValue < 0 || nValue > 2)\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ATL: Warning - dialog data checkbox value (%d) out of range.\n"), nValue);\r
-                               nValue = 0;  // default to off\r
-                       }\r
-                       ::SendMessage(hWndCtrl, BM_SETCHECK, nValue, 0L);\r
-               }\r
-       }\r
-\r
-       // variant that supports bool (checked/not-checked, no intermediate state)\r
-       void DDX_Check(UINT nID, bool& bCheck, BOOL bSave)\r
-       {\r
-               int nValue = bCheck ? 1 : 0;\r
-               DDX_Check(nID, nValue, bSave);\r
-\r
-               if(bSave)\r
-               {\r
-                       if(nValue == 2)\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ATL: Warning - checkbox state (%d) out of supported range.\n"), nValue);\r
-                       bCheck = (nValue == 1);\r
-               }\r
-       }\r
-\r
-       void DDX_Radio(UINT nID, int& nValue, BOOL bSave)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               HWND hWndCtrl = pT->GetDlgItem(nID);\r
-               ATLASSERT(hWndCtrl != NULL);\r
-\r
-               // must be first in a group of auto radio buttons\r
-               ATLASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);\r
-               ATLASSERT(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON);\r
-\r
-               if(bSave)\r
-                       nValue = -1;     // value if none found\r
-\r
-               // walk all children in group\r
-               int nButton = 0;\r
-               do\r
-               {\r
-                       if(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON)\r
-                       {\r
-                               // control in group is a radio button\r
-                               if(bSave)\r
-                               {\r
-                                       if(::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L) != 0)\r
-                                       {\r
-                                               ATLASSERT(nValue == -1);    // only set once\r
-                                               nValue = nButton;\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       // select button\r
-                                       ::SendMessage(hWndCtrl, BM_SETCHECK, (nButton == nValue), 0L);\r
-                               }\r
-                               nButton++;\r
-                       }\r
-                       else\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ATL: Warning - skipping non-radio button in group.\n"));\r
-                       }\r
-                       hWndCtrl = ::GetWindow(hWndCtrl, GW_HWNDNEXT);\r
-               }\r
-               while (hWndCtrl != NULL && !(GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP));\r
-       }\r
-\r
-// Overrideables\r
-       void OnDataExchangeError(UINT nCtrlID, BOOL /*bSave*/)\r
-       {\r
-               // Override to display an error message\r
-               ::MessageBeep((UINT)-1);\r
-               T* pT = static_cast<T*>(this);\r
-               ::SetFocus(pT->GetDlgItem(nCtrlID));\r
-       }\r
-\r
-       void OnDataValidateError(UINT nCtrlID, BOOL /*bSave*/, _XData& /*data*/)\r
-       {\r
-               // Override to display an error message\r
-               ::MessageBeep((UINT)-1);\r
-               T* pT = static_cast<T*>(this);\r
-               ::SetFocus(pT->GetDlgItem(nCtrlID));\r
-       }\r
-};\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLDDX_H__\r
diff --git a/WTL80/include/atldlgs.h b/WTL80/include/atldlgs.h
deleted file mode 100644 (file)
index c0fd568..0000000
+++ /dev/null
@@ -1,6212 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLDLGS_H__\r
-#define __ATLDLGS_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atldlgs.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atldlgs.h requires atlwin.h to be included first\r
-#endif\r
-\r
-#include <commdlg.h>\r
-#include <shlobj.h>\r
-\r
-#if (_WIN32_WINNT >= 0x0600) && !defined(_WIN32_WCE)\r
-  #include <shobjidl.h>\r
-#endif // (_WIN32_WINNT >= 0x0600) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CFileDialogImpl<T>\r
-// CFileDialog\r
-// CFileDialogEx\r
-// CMultiFileDialogImpl<T>\r
-// CMultiFileDialog\r
-// CShellFileDialogImpl<T>\r
-// CShellFileOpenDialogImpl<T>\r
-// CShellFileOpenDialog\r
-// CShellFileSaveDialogImpl<T>\r
-// CShellFileSaveDialog\r
-// CFolderDialogImpl<T>\r
-// CFolderDialog\r
-// CFontDialogImpl<T>\r
-// CFontDialog\r
-// CRichEditFontDialogImpl<T>\r
-// CRichEditFontDialog\r
-// CColorDialogImpl<T>\r
-// CColorDialog\r
-// CPrintDialogImpl<T>\r
-// CPrintDialog\r
-// CPrintDialogExImpl<T>\r
-// CPrintDialogEx\r
-// CPageSetupDialogImpl<T>\r
-// CPageSetupDialog\r
-// CFindReplaceDialogImpl<T>\r
-// CFindReplaceDialog\r
-//\r
-// CMemDlgTemplate\r
-// CIndirectDialogImpl<T, TDlgTemplate, TBase>\r
-//\r
-// CPropertySheetWindow\r
-// CPropertySheetImpl<T, TBase>\r
-// CPropertySheet\r
-// CPropertyPageWindow\r
-// CPropertyPageImpl<T, TBase>\r
-// CPropertyPage<t_wDlgTemplateID>\r
-// CAxPropertyPageImpl<T, TBase>\r
-// CAxPropertyPage<t_wDlgTemplateID>\r
-//\r
-// CWizard97SheetWindow\r
-// CWizard97SheetImpl<T, TBase>\r
-// CWizard97Sheet\r
-// CWizard97PageWindow\r
-// CWizard97PageImpl<T, TBase>\r
-// CWizard97ExteriorPageImpl<T, TBase>\r
-// CWizard97InteriorPageImpl<T, TBase>\r
-//\r
-// CAeroWizardFrameWindow\r
-// CAeroWizardFrameImpl<T, TBase>\r
-// CAeroWizardFrame\r
-// CAeroWizardPageWindow\r
-// CAeroWizardPageImpl<T, TBase>\r
-// CAeroWizardPage<t_wDlgTemplateID>\r
-// CAeroWizardAxPageImpl<T, TBase>\r
-// CAeroWizardAxPage<t_wDlgTemplateID>\r
-//\r
-// CTaskDialogConfig\r
-// CTaskDialogImpl<T>\r
-// CTaskDialog\r
-//\r
-// Global functions:\r
-//   AtlTaskDialog()\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFileDialogImpl - used for File Open or File Save As\r
-\r
-// compatibility with the old (vc6.0) headers\r
-#if (_WIN32_WINNT >= 0x0500) && !defined(OPENFILENAME_SIZE_VERSION_400)\r
-  #ifndef CDSIZEOF_STRUCT\r
-    #define CDSIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))\r
-  #endif\r
-  #define OPENFILENAME_SIZE_VERSION_400A  CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)\r
-  #define OPENFILENAME_SIZE_VERSION_400W  CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)\r
-  #ifdef UNICODE\r
-    #define OPENFILENAME_SIZE_VERSION_400  OPENFILENAME_SIZE_VERSION_400W\r
-  #else\r
-    #define OPENFILENAME_SIZE_VERSION_400  OPENFILENAME_SIZE_VERSION_400A\r
-  #endif // !UNICODE\r
-#endif // (_WIN32_WINNT >= 0x0500) && !defined(OPENFILENAME_SIZE_VERSION_400)\r
-\r
-#if !defined(_WIN32_WCE) && !defined(CDN_INCLUDEITEM)\r
-  #define CDN_INCLUDEITEM         (CDN_FIRST - 0x0007)\r
-#endif\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CFileDialogImpl : public ATL::CDialogImplBase\r
-{\r
-public:\r
-#if defined(__AYGSHELL_H__) && (_WIN32_WCE >= 0x0501)\r
-       OPENFILENAMEEX m_ofn;\r
-#else\r
-       OPENFILENAME m_ofn;\r
-#endif\r
-       BOOL m_bOpenFileDialog;            // TRUE for file open, FALSE for file save\r
-       TCHAR m_szFileTitle[_MAX_FNAME];   // contains file title after return\r
-       TCHAR m_szFileName[_MAX_PATH];     // contains full path name after return\r
-\r
-       CFileDialogImpl(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs\r
-                       LPCTSTR lpszDefExt = NULL,\r
-                       LPCTSTR lpszFileName = NULL,\r
-                       DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,\r
-                       LPCTSTR lpszFilter = NULL,\r
-                       HWND hWndParent = NULL)\r
-       {\r
-               memset(&m_ofn, 0, sizeof(m_ofn)); // initialize structure to 0/NULL\r
-               m_szFileName[0] = _T('\0');\r
-               m_szFileTitle[0] = _T('\0');\r
-\r
-               m_bOpenFileDialog = bOpenFileDialog;\r
-\r
-               m_ofn.lStructSize = sizeof(m_ofn);\r
-#if (_WIN32_WINNT >= 0x0500)\r
-               // adjust struct size if running on older version of Windows\r
-               if(AtlIsOldWindows())\r
-               {\r
-                       ATLASSERT(sizeof(m_ofn) > OPENFILENAME_SIZE_VERSION_400);   // must be\r
-                       m_ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;\r
-               }\r
-#endif // (_WIN32_WINNT >= 0x0500)\r
-               m_ofn.lpstrFile = m_szFileName;\r
-               m_ofn.nMaxFile = _MAX_PATH;\r
-               m_ofn.lpstrDefExt = lpszDefExt;\r
-               m_ofn.lpstrFileTitle = (LPTSTR)m_szFileTitle;\r
-               m_ofn.nMaxFileTitle = _MAX_FNAME;\r
-#ifndef _WIN32_WCE\r
-               m_ofn.Flags = dwFlags | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_ENABLESIZING;\r
-#else // CE specific\r
-               m_ofn.Flags = dwFlags | OFN_EXPLORER | OFN_ENABLEHOOK;\r
-#endif // !_WIN32_WCE\r
-               m_ofn.lpstrFilter = lpszFilter;\r
-               m_ofn.hInstance = ModuleHelper::GetResourceInstance();\r
-               m_ofn.lpfnHook = (LPOFNHOOKPROC)T::StartDialogProc;\r
-               m_ofn.hwndOwner = hWndParent;\r
-\r
-               // setup initial file name\r
-               if(lpszFileName != NULL)\r
-               SecureHelper::strncpy_x(m_szFileName, _countof(m_szFileName), lpszFileName, _TRUNCATE);\r
-       }\r
-\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT((m_ofn.Flags & OFN_ENABLEHOOK) != 0);\r
-               ATLASSERT(m_ofn.lpfnHook != NULL);   // can still be a user hook\r
-\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               if(m_ofn.hwndOwner == NULL)   // set only if not specified before\r
-                       m_ofn.hwndOwner = hWndParent;\r
-\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, (ATL::CDialogImplBase*)this);\r
-\r
-               BOOL bRet;\r
-               if(m_bOpenFileDialog)\r
-#if defined(__AYGSHELL_H__) && (_WIN32_WCE >= 0x0501)\r
-                       bRet = ::GetOpenFileNameEx(&m_ofn);\r
-               else\r
-                       bRet = ::GetSaveFileName((LPOPENFILENAME)&m_ofn);\r
-#else\r
-                       bRet = ::GetOpenFileName(&m_ofn);\r
-               else\r
-                       bRet = ::GetSaveFileName(&m_ofn);\r
-#endif\r
-\r
-               m_hWnd = NULL;\r
-\r
-               return bRet ? IDOK : IDCANCEL;\r
-       }\r
-\r
-// Attributes\r
-       ATL::CWindow GetFileDialogWindow() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ATL::CWindow(GetParent());\r
-       }\r
-\r
-       int GetFilePath(LPTSTR lpstrFilePath, int nLength) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               return (int)GetFileDialogWindow().SendMessage(CDM_GETFILEPATH, nLength, (LPARAM)lpstrFilePath);\r
-       }\r
-\r
-       int GetFolderIDList(LPVOID lpBuff, int nLength) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               return (int)GetFileDialogWindow().SendMessage(CDM_GETFOLDERIDLIST, nLength, (LPARAM)lpBuff);\r
-       }\r
-\r
-       int GetFolderPath(LPTSTR lpstrFolderPath, int nLength) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               return (int)GetFileDialogWindow().SendMessage(CDM_GETFOLDERPATH, nLength, (LPARAM)lpstrFolderPath);\r
-       }\r
-\r
-       int GetSpec(LPTSTR lpstrSpec, int nLength) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               return (int)GetFileDialogWindow().SendMessage(CDM_GETSPEC, nLength, (LPARAM)lpstrSpec);\r
-       }\r
-\r
-       void SetControlText(int nCtrlID, LPCTSTR lpstrText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               GetFileDialogWindow().SendMessage(CDM_SETCONTROLTEXT, nCtrlID, (LPARAM)lpstrText);\r
-       }\r
-\r
-       void SetDefExt(LPCTSTR lpstrExt)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               GetFileDialogWindow().SendMessage(CDM_SETDEFEXT, 0, (LPARAM)lpstrExt);\r
-       }\r
-\r
-       BOOL GetReadOnlyPref() const    // return TRUE if readonly checked\r
-       {\r
-               return ((m_ofn.Flags & OFN_READONLY) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-// Operations\r
-       void HideControl(int nCtrlID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((m_ofn.Flags & OFN_EXPLORER) != 0);\r
-\r
-               GetFileDialogWindow().SendMessage(CDM_HIDECONTROL, nCtrlID);\r
-       }\r
-\r
-// Special override for common dialogs\r
-       BOOL EndDialog(INT_PTR /*nRetCode*/ = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               GetFileDialogWindow().SendMessage(WM_COMMAND, MAKEWPARAM(IDCANCEL, 0));\r
-               return TRUE;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CFileDialogImpl)\r
-               NOTIFY_CODE_HANDLER(CDN_FILEOK, _OnFileOK)\r
-               NOTIFY_CODE_HANDLER(CDN_FOLDERCHANGE, _OnFolderChange)\r
-               NOTIFY_CODE_HANDLER(CDN_HELP, _OnHelp)\r
-               NOTIFY_CODE_HANDLER(CDN_INITDONE, _OnInitDone)\r
-               NOTIFY_CODE_HANDLER(CDN_SELCHANGE, _OnSelChange)\r
-               NOTIFY_CODE_HANDLER(CDN_SHAREVIOLATION, _OnShareViolation)\r
-               NOTIFY_CODE_HANDLER(CDN_TYPECHANGE, _OnTypeChange)\r
-#ifndef _WIN32_WCE\r
-               NOTIFY_CODE_HANDLER(CDN_INCLUDEITEM, _OnIncludeItem)\r
-#endif // !_WIN32_WCE\r
-       END_MSG_MAP()\r
-\r
-       LRESULT _OnFileOK(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               return !pT->OnFileOK((LPOFNOTIFY)pnmh);\r
-       }\r
-\r
-       LRESULT _OnFolderChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnFolderChange((LPOFNOTIFY)pnmh);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT _OnHelp(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnHelp((LPOFNOTIFY)pnmh);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT _OnInitDone(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnInitDone((LPOFNOTIFY)pnmh);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT _OnSelChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnSelChange((LPOFNOTIFY)pnmh);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT _OnShareViolation(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               return pT->OnShareViolation((LPOFNOTIFY)pnmh);\r
-       }\r
-\r
-       LRESULT _OnTypeChange(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               pT->OnTypeChange((LPOFNOTIFY)pnmh);\r
-               return 0;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT _OnIncludeItem(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               T* pT = static_cast<T*>(this);\r
-               return pT->OnIncludeItem((LPOFNOTIFYEX)pnmh);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Overrideables\r
-       BOOL OnFileOK(LPOFNOTIFY /*lpon*/)\r
-       {\r
-               return TRUE;\r
-       }\r
-\r
-       void OnFolderChange(LPOFNOTIFY /*lpon*/)\r
-       {\r
-       }\r
-\r
-       void OnHelp(LPOFNOTIFY /*lpon*/)\r
-       {\r
-       }\r
-\r
-       void OnInitDone(LPOFNOTIFY /*lpon*/)\r
-       {\r
-       }\r
-\r
-       void OnSelChange(LPOFNOTIFY /*lpon*/)\r
-       {\r
-       }\r
-\r
-       int OnShareViolation(LPOFNOTIFY /*lpon*/)\r
-       {\r
-               return 0;\r
-       }\r
-\r
-       void OnTypeChange(LPOFNOTIFY /*lpon*/)\r
-       {\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL OnIncludeItem(LPOFNOTIFYEX /*lponex*/)\r
-       {\r
-               return TRUE;   // include item\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-class CFileDialog : public CFileDialogImpl<CFileDialog>\r
-{\r
-public:\r
-       CFileDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs\r
-               LPCTSTR lpszDefExt = NULL,\r
-               LPCTSTR lpszFileName = NULL,\r
-               DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,\r
-               LPCTSTR lpszFilter = NULL,\r
-               HWND hWndParent = NULL)\r
-               : CFileDialogImpl<CFileDialog>(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent)\r
-       { }\r
-\r
-       // override base class map and references to handlers\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-#if defined(__AYGSHELL_H__) && (_WIN32_WCE >= 0x0501)\r
-class CFileDialogEx : public CFileDialogImpl<CFileDialogEx>\r
-{\r
-public:\r
-       CFileDialogEx( // Supports only FileOpen\r
-               LPCTSTR lpszDefExt = NULL,\r
-               LPCTSTR lpszFileName = NULL,\r
-               DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,\r
-               OFN_EXFLAG ExFlags = OFN_EXFLAG_THUMBNAILVIEW,\r
-               OFN_SORTORDER dwSortOrder = OFN_SORTORDER_AUTO,         \r
-               LPCTSTR lpszFilter = NULL,\r
-               HWND hWndParent = NULL)\r
-               : CFileDialogImpl<CFileDialogEx>(TRUE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent)\r
-       {\r
-               m_ofn.ExFlags = ExFlags;\r
-               m_ofn.dwSortOrder = dwSortOrder;\r
-       }\r
-\r
-       // override base class map and references to handlers\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-#endif // defined(__AYGSHELL_H__) && (_WIN32_WCE >= 0x0501)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Multi File Dialog - Multi-select File Open dialog\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-// The class dynamically resizes the buffer as the file selection changes\r
-// (as described in Knowledge Base article 131462). It also expands selected\r
-// shortcut files to take into account the full path of the target file.\r
-// Note that this doesn't work on Win9x for the old style dialogs, as well as\r
-// on NT for non-Unicode builds. \r
-\r
-#ifndef _WTL_FIXED_OFN_BUFFER_LENGTH\r
-  #define _WTL_FIXED_OFN_BUFFER_LENGTH 0x10000\r
-#endif\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CMultiFileDialogImpl : public CFileDialogImpl< T >\r
-{\r
-public:\r
-       mutable LPCTSTR m_pNextFile; \r
-#ifndef _UNICODE\r
-       bool m_bIsNT;\r
-#endif\r
-\r
-       CMultiFileDialogImpl(\r
-               LPCTSTR lpszDefExt = NULL,\r
-               LPCTSTR lpszFileName = NULL,\r
-               DWORD dwFlags = OFN_HIDEREADONLY,\r
-               LPCTSTR lpszFilter = NULL,\r
-               HWND hWndParent = NULL)\r
-               : CFileDialogImpl<T>(TRUE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent), \r
-                 m_pNextFile(NULL)\r
-       {\r
-               m_ofn.Flags |= OFN_ALLOWMULTISELECT;   // Force multiple selection mode\r
-\r
-#ifndef _UNICODE\r
-               OSVERSIONINFO ovi = { sizeof(ovi) };\r
-               ::GetVersionEx(&ovi);\r
-               m_bIsNT = (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT);\r
-               if (m_bIsNT)\r
-               {\r
-                       // On NT platforms, GetOpenFileNameA thunks to GetOpenFileNameW and there \r
-                       // is absolutely nothing we can do except to start off with a large buffer.\r
-                       ATLVERIFY(ResizeFilenameBuffer(_WTL_FIXED_OFN_BUFFER_LENGTH));\r
-               }\r
-#endif\r
-       }\r
-\r
-       ~CMultiFileDialogImpl()\r
-       {\r
-               if (m_ofn.lpstrFile != m_szFileName)   // Free the buffer if we allocated it\r
-                       delete[] m_ofn.lpstrFile;\r
-       }\r
-\r
-// Operations\r
-       // Get the directory that the files were chosen from.\r
-       // The function returns the number of characters copied, not including the terminating zero. \r
-       // If the buffer is NULL, the function returns the required size, in characters, including the terminating zero.\r
-       // If the function fails, the return value is zero.\r
-       int GetDirectory(LPTSTR pBuffer, int nBufLen) const\r
-       {\r
-               if (m_ofn.lpstrFile == NULL)\r
-                       return 0;\r
-\r
-               LPCTSTR pStr = m_ofn.lpstrFile;\r
-               int nLength = lstrlen(pStr);\r
-               if (pStr[nLength + 1] == 0)\r
-               {\r
-                       // The OFN buffer contains a single item so extract its path.\r
-                       LPCTSTR pSep = _strrchr(pStr, _T('\\'));\r
-                       if (pSep != NULL)\r
-                               nLength = (int)(DWORD_PTR)(pSep - pStr);\r
-               }\r
-\r
-               int nRet = 0;\r
-               if (pBuffer == NULL)   // If the buffer is NULL, return the required length\r
-               {\r
-                       nRet = nLength + 1;\r
-               }\r
-               else if (nBufLen > nLength)\r
-               {\r
-                       SecureHelper::strncpy_x(pBuffer, nBufLen, pStr, nLength);\r
-                       nRet = nLength;\r
-               }\r
-\r
-               return nRet;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       bool GetDirectory(_CSTRING_NS::CString& strDir) const\r
-       {\r
-               bool bRet = false;\r
-\r
-               int nLength = GetDirectory(NULL, 0);\r
-               if (nLength > 0)\r
-               {\r
-                       bRet = (GetDirectory(strDir.GetBuffer(nLength), nLength) > 0);\r
-                       strDir.ReleaseBuffer(nLength - 1);\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       // Get the first filename as a pointer into the buffer.\r
-       LPCTSTR GetFirstFileName() const\r
-       {\r
-               if (m_ofn.lpstrFile == NULL)\r
-                       return NULL;\r
-\r
-               m_pNextFile = NULL;   // Reset internal buffer pointer\r
-\r
-               LPCTSTR pStr = m_ofn.lpstrFile;\r
-               int nLength = lstrlen(pStr);\r
-               if (pStr[nLength + 1] != 0)\r
-               {\r
-                       // Multiple items were selected. The first string is the directory,\r
-                       // so skip forwards to the second string.\r
-                       pStr += nLength + 1;\r
-\r
-                       // Set up m_pNext so it points to the second item (or null).\r
-                       m_pNextFile = pStr;\r
-                       GetNextFileName();\r
-               }\r
-               else\r
-               {\r
-                       // A single item was selected. Skip forward past the path.\r
-                       LPCTSTR pSep = _strrchr(pStr, _T('\\'));\r
-                       if (pSep != NULL)\r
-                               pStr = pSep + 1;\r
-               }\r
-\r
-               return pStr;\r
-       }\r
-\r
-       // Get the next filename as a pointer into the buffer.\r
-       LPCTSTR GetNextFileName() const\r
-       {\r
-               if (m_pNextFile == NULL)\r
-                       return NULL;\r
-\r
-               LPCTSTR pStr = m_pNextFile;\r
-               // Set "m_pNextFile" to point to the next file name, or null if we \r
-               // have reached the last file in the list.\r
-               int nLength = lstrlen(pStr);\r
-               m_pNextFile = (pStr[nLength + 1] != 0) ? &pStr[nLength + 1] : NULL;\r
-\r
-               return pStr;\r
-       }\r
-\r
-       // Get the first filename as a full path.\r
-       // The function returns the number of characters copied, not including the terminating zero. \r
-       // If the buffer is NULL, the function returns the required size, in characters, including the terminating zero.\r
-       // If the function fails, the return value is zero.\r
-       int GetFirstPathName(LPTSTR pBuffer, int nBufLen) const\r
-       {\r
-               LPCTSTR pStr = GetFirstFileName();\r
-               int nLengthDir = GetDirectory(NULL, 0);\r
-               if((pStr == NULL) || (nLengthDir == 0))\r
-                       return 0;\r
-\r
-               // Figure out the required length.\r
-               int nLengthTotal = nLengthDir + lstrlen(pStr);\r
-\r
-               int nRet = 0;\r
-               if(pBuffer == NULL) // If the buffer is NULL, return the required length\r
-               {\r
-                       nRet = nLengthTotal + 1;\r
-               }\r
-               else if (nBufLen > nLengthTotal) // If the buffer is big enough, go ahead and construct the path\r
-               {               \r
-                       GetDirectory(pBuffer, nBufLen);\r
-                       SecureHelper::strcat_x(pBuffer, nBufLen, _T("\\"));\r
-                       SecureHelper::strcat_x(pBuffer, nBufLen, pStr);\r
-                       nRet = nLengthTotal;\r
-               }\r
-\r
-               return nRet;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       bool GetFirstPathName(_CSTRING_NS::CString& strPath) const\r
-       {\r
-               bool bRet = false;\r
-\r
-               int nLength = GetFirstPathName(NULL, 0);\r
-               if (nLength > 0)\r
-               {\r
-                       bRet = (GetFirstPathName(strPath.GetBuffer(nLength), nLength) > 0);\r
-                       strPath.ReleaseBuffer(nLength - 1);\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       // Get the next filename as a full path.\r
-       // The function returns the number of characters copied, not including the terminating zero. \r
-       // If the buffer is NULL, the function returns the required size, in characters, including the terminating zero.\r
-       // If the function fails, the return value is zero.\r
-       // The internal position marker is moved forward only if the function succeeds and the buffer was large enough.\r
-       int GetNextPathName(LPTSTR pBuffer, int nBufLen) const\r
-       {\r
-               if (m_pNextFile == NULL)\r
-                       return 0;\r
-\r
-               int nRet = 0;\r
-               LPCTSTR pStr = m_pNextFile;\r
-               // Does the filename contain a backslash?\r
-               if (_strrchr(pStr, _T('\\')) != NULL)\r
-               {\r
-                       // Yes, so we'll assume it's a full path.\r
-                       int nLength = lstrlen(pStr);\r
-\r
-                       if (pBuffer == NULL) // If the buffer is NULL, return the required length\r
-                       {\r
-                               nRet = nLength + 1;\r
-                       }\r
-                       else if (nBufLen > nLength) // The buffer is big enough, so go ahead and copy the filename\r
-                       {\r
-                               SecureHelper::strcpy_x(pBuffer, nBufLen, GetNextFileName());\r
-                               nRet = nBufLen;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       // The filename is relative, so construct the full path.\r
-                       int nLengthDir = GetDirectory(NULL, 0);\r
-                       if (nLengthDir > 0)\r
-                       {\r
-                               // Calculate the required space.\r
-                               int nLengthTotal = nLengthDir + lstrlen(pStr);\r
-\r
-                               if(pBuffer == NULL) // If the buffer is NULL, return the required length\r
-                               {\r
-                                       nRet = nLengthTotal + 1;\r
-                               }\r
-                               else if (nBufLen > nLengthTotal) // If the buffer is big enough, go ahead and construct the path\r
-                               {\r
-                                       GetDirectory(pBuffer, nBufLen);\r
-                                       SecureHelper::strcat_x(pBuffer, nBufLen, _T("\\"));\r
-                                       SecureHelper::strcat_x(pBuffer, nBufLen, GetNextFileName());\r
-                                       nRet = nLengthTotal;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               return nRet;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       bool GetNextPathName(_CSTRING_NS::CString& strPath) const\r
-       {\r
-               bool bRet = false;\r
-\r
-               int nLength = GetNextPathName(NULL, 0);\r
-               if (nLength > 0)\r
-               {\r
-                       bRet = (GetNextPathName(strPath.GetBuffer(nLength), nLength) > 0);\r
-                       strPath.ReleaseBuffer(nLength - 1);\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-// Implementation\r
-       bool ResizeFilenameBuffer(DWORD dwLength)\r
-       {\r
-               if (dwLength > m_ofn.nMaxFile)\r
-               {\r
-                       // Free the old buffer.\r
-                       if (m_ofn.lpstrFile != m_szFileName)\r
-                       {\r
-                               delete[] m_ofn.lpstrFile;\r
-                               m_ofn.lpstrFile = NULL;\r
-                               m_ofn.nMaxFile = 0;\r
-                       }\r
-\r
-                       // Allocate the new buffer.\r
-                       LPTSTR lpstrBuff = NULL;\r
-                       ATLTRY(lpstrBuff = new TCHAR[dwLength]);\r
-                       if (lpstrBuff != NULL)\r
-                       {\r
-                               m_ofn.lpstrFile = lpstrBuff;\r
-                               m_ofn.lpstrFile[0] = 0;\r
-                               m_ofn.nMaxFile = dwLength;\r
-                       }\r
-               }\r
-\r
-               return (m_ofn.lpstrFile != NULL);\r
-       }\r
-\r
-       void OnSelChange(LPOFNOTIFY /*lpon*/)\r
-       {\r
-#ifndef _UNICODE\r
-               // There is no point resizing the buffer in ANSI builds running on NT.\r
-               if (m_bIsNT)\r
-                       return;\r
-#endif\r
-\r
-               // Get the buffer length required to hold the spec.\r
-               int nLength = GetSpec(NULL, 0);\r
-               if (nLength <= 1)\r
-                       return; // no files are selected, presumably\r
-               \r
-               // Add room for the directory, and an extra terminating zero.\r
-               nLength += GetFolderPath(NULL, 0) + 1;\r
-\r
-               if (!ResizeFilenameBuffer(nLength))\r
-               {\r
-                       ATLASSERT(FALSE);\r
-                       return;\r
-               }\r
-\r
-               // If we are not following links then our work is done.\r
-               if ((m_ofn.Flags & OFN_NODEREFERENCELINKS) != 0)\r
-                       return;\r
-\r
-               // Get the file spec, which is the text in the edit control.\r
-               if (GetSpec(m_ofn.lpstrFile, m_ofn.nMaxFile) <= 0)\r
-                       return;\r
-               \r
-               // Get the ID-list of the current folder.\r
-               int nBytes = GetFolderIDList(NULL, 0);\r
-               CTempBuffer<ITEMIDLIST> idlist;\r
-               idlist.AllocateBytes(nBytes);\r
-               if ((nBytes <= 0) || (GetFolderIDList(idlist, nBytes) <= 0))\r
-                       return;\r
-\r
-               // First bind to the desktop folder, then to the current folder.\r
-               ATL::CComPtr<IShellFolder> pDesktop, pFolder;\r
-               if (FAILED(::SHGetDesktopFolder(&pDesktop)))\r
-                       return;\r
-               if (FAILED(pDesktop->BindToObject(idlist, NULL, IID_IShellFolder, (void**)&pFolder)))\r
-                       return;\r
-\r
-               // Work through the file spec, looking for quoted filenames. If we find a shortcut file, then \r
-               // we need to add enough extra buffer space to hold its target path.\r
-               DWORD nExtraChars = 0;\r
-               bool bInsideQuotes = false;\r
-               LPCTSTR pAnchor = m_ofn.lpstrFile;\r
-               LPCTSTR pChar = m_ofn.lpstrFile;\r
-               for ( ; *pChar; ++pChar)\r
-               {\r
-                       // Look for quotation marks.\r
-                       if (*pChar == _T('\"'))\r
-                       {\r
-                               // We are either entering or leaving a passage of quoted text.\r
-                               bInsideQuotes = !bInsideQuotes;\r
-\r
-                               // Is it an opening or closing quote?\r
-                               if (bInsideQuotes)\r
-                               {\r
-                                       // We found an opening quote, so set "pAnchor" to the following character.\r
-                                       pAnchor = pChar + 1;\r
-                               }\r
-                               else // closing quote\r
-                               {\r
-                                       // Each quoted entity should be shorter than MAX_PATH.\r
-                                       if (pChar - pAnchor >= MAX_PATH)\r
-                                               return;\r
-\r
-                                       // Get the ID-list and attributes of the file.\r
-                                       USES_CONVERSION;\r
-                                       int nFileNameLength = (int)(DWORD_PTR)(pChar - pAnchor);\r
-                                       TCHAR szFileName[MAX_PATH];\r
-                                       SecureHelper::strncpy_x(szFileName, MAX_PATH, pAnchor, nFileNameLength);\r
-                                       LPITEMIDLIST pidl = NULL;\r
-                                       DWORD dwAttrib = SFGAO_LINK;\r
-                                       if (SUCCEEDED(pFolder->ParseDisplayName(NULL, NULL, T2W(szFileName), NULL, &pidl, &dwAttrib)))\r
-                                       {\r
-                                               // Is it a shortcut file?\r
-                                               if (dwAttrib & SFGAO_LINK)\r
-                                               {\r
-                                                       // Bind to its IShellLink interface.\r
-                                                       ATL::CComPtr<IShellLink> pLink;\r
-                                                       if (SUCCEEDED(pFolder->BindToObject(pidl, NULL, IID_IShellLink, (void**)&pLink)))\r
-                                                       {\r
-                                                               // Get the shortcut's target path.\r
-                                                               TCHAR szPath[MAX_PATH];\r
-                                                               if (SUCCEEDED(pLink->GetPath(szPath, MAX_PATH, NULL, 0)))\r
-                                                               {\r
-                                                                       // If the target path is longer than the shortcut name, then add on the number \r
-                                                                       // of extra characters that are required.\r
-                                                                       int nNewLength = lstrlen(szPath);\r
-                                                                       if (nNewLength > nFileNameLength)\r
-                                                                               nExtraChars += nNewLength - nFileNameLength;\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-\r
-                                               // Free the ID-list returned by ParseDisplayName.\r
-                                               ::CoTaskMemFree(pidl);\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-               // If we need more space for shortcut targets, then reallocate.\r
-               if (nExtraChars > 0)\r
-                       ATLVERIFY(ResizeFilenameBuffer(m_ofn.nMaxFile + nExtraChars));\r
-       }\r
-\r
-       // Helper for _ATM_MIN_CRT\r
-       static const TCHAR* _strrchr(const TCHAR* p, TCHAR ch)\r
-       {\r
-#ifndef _ATL_MIN_CRT\r
-               return _tcsrchr(p, ch);\r
-#else // _ATL_MIN_CRT\r
-               const TCHAR* lpsz = NULL;\r
-               while (*p != 0)\r
-               {\r
-                       if (*p == ch)\r
-                               lpsz = p;\r
-                       p = ::CharNext(p);\r
-               }\r
-               return lpsz;\r
-#endif // _ATL_MIN_CRT\r
-       }\r
-};\r
-\r
-class CMultiFileDialog : public CMultiFileDialogImpl<CMultiFileDialog>\r
-{\r
-public:\r
-       CMultiFileDialog(\r
-               LPCTSTR lpszDefExt = NULL,\r
-               LPCTSTR lpszFileName = NULL,\r
-               DWORD dwFlags = OFN_HIDEREADONLY,\r
-               LPCTSTR lpszFilter = NULL,\r
-               HWND hWndParent = NULL)\r
-               : CMultiFileDialogImpl<CMultiFileDialog>(lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent)\r
-       { }\r
-\r
-       BEGIN_MSG_MAP(CMultiFileDialog)\r
-               CHAIN_MSG_MAP(CMultiFileDialogImpl<CMultiFileDialog>)\r
-       END_MSG_MAP()\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Shell File Dialog - new Shell File Open and Save dialogs in Vista\r
-\r
-// Note: Use GetPtr() to access dialog interface methods.\r
-// Example:\r
-//     CShellFileOpenDialog dlg;\r
-//     dlg.GetPtr()->SetTitle(L"MyFileOpenDialog");\r
-\r
-#if (_WIN32_WINNT >= 0x0600) && !defined(_WIN32_WCE)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CShellFileDialogImpl - base class for CShellFileOpenDialogImpl and CShellFileSaveDialogImpl\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CShellFileDialogImpl : public IFileDialogEvents\r
-{\r
-public:\r
-// Operations\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               INT_PTR nRet = -1;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(pT->m_spFileDlg == NULL)\r
-               {\r
-                       ATLASSERT(FALSE);\r
-                       return nRet;\r
-               }\r
-\r
-               DWORD dwCookie = 0;\r
-               pT->_Advise(dwCookie);\r
-\r
-               HRESULT hRet = pT->m_spFileDlg->Show(hWndParent);\r
-               if(SUCCEEDED(hRet))\r
-                       nRet = IDOK;\r
-               else if(hRet == HRESULT_FROM_WIN32(ERROR_CANCELLED))\r
-                       nRet = IDCANCEL;\r
-               else\r
-                       ATLASSERT(FALSE);   // error\r
-\r
-               pT->_Unadvise(dwCookie);\r
-\r
-               return nRet;\r
-       }\r
-\r
-       bool IsNull() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-               return (pT->m_spFileDlg == NULL);\r
-       }\r
-\r
-// Operations - get file path after dialog returns\r
-       HRESULT GetFilePath(LPWSTR lpstrFilePath, int cchLength)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-\r
-               ATL::CComPtr<IShellItem> spItem;\r
-               HRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\r
-\r
-               if(SUCCEEDED(hRet))\r
-                       hRet = GetFileNameFromShellItem(spItem, SIGDN_FILESYSPATH, lpstrFilePath, cchLength);\r
-\r
-               return hRet;\r
-       }\r
-\r
-       HRESULT GetFileTitle(LPWSTR lpstrFileTitle, int cchLength)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-\r
-               ATL::CComPtr<IShellItem> spItem;\r
-               HRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\r
-\r
-               if(SUCCEEDED(hRet))\r
-                       hRet = GetFileNameFromShellItem(spItem, SIGDN_NORMALDISPLAY, lpstrFileTitle, cchLength);\r
-\r
-               return hRet;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       HRESULT GetFilePath(_CSTRING_NS::CString& strFilePath)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-\r
-               ATL::CComPtr<IShellItem> spItem;\r
-               HRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\r
-\r
-               if(SUCCEEDED(hRet))\r
-                       hRet = GetFileNameFromShellItem(spItem, SIGDN_FILESYSPATH, strFilePath);\r
-\r
-               return hRet;\r
-       }\r
-\r
-       HRESULT GetFileTitle(_CSTRING_NS::CString& strFileTitle)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-\r
-               ATL::CComPtr<IShellItem> spItem;\r
-               HRESULT hRet = pT->m_spFileDlg->GetResult(&spItem);\r
-\r
-               if(SUCCEEDED(hRet))\r
-                       hRet = GetFileNameFromShellItem(spItem, SIGDN_NORMALDISPLAY, strFileTitle);\r
-\r
-               return hRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-// Helpers for IShellItem\r
-       static HRESULT GetFileNameFromShellItem(IShellItem* pShellItem, SIGDN type, LPWSTR lpstr, int cchLength)\r
-       {\r
-               ATLASSERT(pShellItem != NULL);\r
-\r
-               LPWSTR lpstrName = NULL;\r
-               HRESULT hRet = pShellItem->GetDisplayName(type, &lpstrName);\r
-\r
-               if(SUCCEEDED(hRet))\r
-               {\r
-                       if(lstrlenW(lpstrName) < cchLength)\r
-                       {\r
-                               SecureHelper::strcpyW_x(lpstr, cchLength, lpstrName);\r
-                       }\r
-                       else\r
-                       {\r
-                               ATLASSERT(FALSE);\r
-                               hRet = DISP_E_BUFFERTOOSMALL;\r
-                       }\r
-\r
-                       ::CoTaskMemFree(lpstrName);\r
-               }\r
-\r
-               return hRet;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       static HRESULT GetFileNameFromShellItem(IShellItem* pShellItem, SIGDN type, _CSTRING_NS::CString& str)\r
-       {\r
-               ATLASSERT(pShellItem != NULL);\r
-\r
-               LPWSTR lpstrName = NULL;\r
-               HRESULT hRet = pShellItem->GetDisplayName(type, &lpstrName);\r
-\r
-               if(SUCCEEDED(hRet))\r
-               {\r
-                       str = lpstrName;\r
-                       ::CoTaskMemFree(lpstrName);\r
-               }\r
-\r
-               return hRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-// Implementation\r
-       void _Advise(DWORD& dwCookie)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-               HRESULT hRet = pT->m_spFileDlg->Advise((IFileDialogEvents*)this, &dwCookie);\r
-               ATLVERIFY(SUCCEEDED(hRet));\r
-       }\r
-\r
-       void _Unadvise(DWORD dwCookie)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-               HRESULT hRet = pT->m_spFileDlg->Unadvise(dwCookie);\r
-               ATLVERIFY(SUCCEEDED(hRet));\r
-       }\r
-\r
-       void _Init(LPCWSTR lpszFileName, DWORD dwOptions, LPCWSTR lpszDefExt, const COMDLG_FILTERSPEC* arrFilterSpec, UINT uFilterSpecCount)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg != NULL);\r
-\r
-               HRESULT hRet = E_FAIL;\r
-\r
-               if(lpszFileName != NULL)\r
-               {\r
-                       hRet = pT->m_spFileDlg->SetFileName(lpszFileName);\r
-                       ATLASSERT(SUCCEEDED(hRet));\r
-               }\r
-\r
-               hRet = pT->m_spFileDlg->SetOptions(dwOptions);\r
-               ATLASSERT(SUCCEEDED(hRet));\r
-\r
-               if(lpszDefExt != NULL)\r
-               {\r
-                       hRet = pT->m_spFileDlg->SetDefaultExtension(lpszDefExt);\r
-                       ATLASSERT(SUCCEEDED(hRet));\r
-               }\r
-\r
-               if(arrFilterSpec != NULL && uFilterSpecCount != 0U)\r
-               {\r
-                       hRet = pT->m_spFileDlg->SetFileTypes(uFilterSpecCount, arrFilterSpec);\r
-                       ATLASSERT(SUCCEEDED(hRet));\r
-               }\r
-       }\r
-\r
-// Implementation - IUnknown interface\r
-       STDMETHOD(QueryInterface)(REFIID riid, void** ppvObject)\r
-       {\r
-               if(ppvObject == NULL)\r
-                       return E_POINTER;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(IsEqualGUID(riid, IID_IUnknown) || IsEqualGUID(riid, IID_IFileDialogEvents))\r
-               {\r
-                       *ppvObject = (IFileDialogEvents*)pT;\r
-                       // AddRef() not needed\r
-                       return S_OK;\r
-               }\r
-\r
-               return E_NOINTERFACE;\r
-       }\r
-\r
-       virtual ULONG STDMETHODCALLTYPE AddRef()\r
-       {\r
-               return 1;\r
-       }\r
-\r
-       virtual ULONG STDMETHODCALLTYPE Release()\r
-       {\r
-               return 1;\r
-       }\r
-\r
-// Implementation - IFileDialogEvents interface\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnFileOk(IFileDialog* pfd)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnFileOk();\r
-       }\r
-\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnFolderChanging(IFileDialog* pfd, IShellItem* psiFolder)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnFolderChanging(psiFolder);\r
-       }\r
-\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnFolderChange(IFileDialog* pfd)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnFolderChange();\r
-       }\r
-\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnSelectionChange(IFileDialog* pfd)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnSelectionChange();\r
-       }\r
-\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnShareViolation(IFileDialog* pfd, IShellItem* psi, FDE_SHAREVIOLATION_RESPONSE* pResponse)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnShareViolation(psi, pResponse);\r
-       }\r
-\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnTypeChange(IFileDialog* pfd)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnTypeChange();\r
-       }\r
-\r
-       virtual HRESULT STDMETHODCALLTYPE IFileDialogEvents::OnOverwrite(IFileDialog* pfd, IShellItem* psi, FDE_OVERWRITE_RESPONSE* pResponse)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_spFileDlg.IsEqualObject(pfd));\r
-               pfd;   // avoid level 4 warning\r
-               return pT->OnOverwrite(psi, pResponse);\r
-       }\r
-\r
-// Overrideables - Event handlers\r
-       HRESULT OnFileOk()\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-\r
-       HRESULT OnFolderChanging(IShellItem* /*psiFolder*/)\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-\r
-       HRESULT OnFolderChange()\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-\r
-       HRESULT OnSelectionChange()\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-\r
-       HRESULT OnShareViolation(IShellItem* /*psi*/, FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/)\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-\r
-       HRESULT OnTypeChange()\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-\r
-       HRESULT OnOverwrite(IShellItem* /*psi*/, FDE_OVERWRITE_RESPONSE* /*pResponse*/)\r
-       {\r
-               return E_NOTIMPL;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CShellFileOpenDialogImpl - implements new Shell File Open dialog\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CShellFileOpenDialogImpl : public CShellFileDialogImpl< T >\r
-{\r
-public:\r
-       ATL::CComPtr<IFileOpenDialog> m_spFileDlg;\r
-\r
-       CShellFileOpenDialogImpl(LPCWSTR lpszFileName = NULL, \r
-                                DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST, \r
-                                LPCWSTR lpszDefExt = NULL, \r
-                                const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \r
-                                UINT uFilterSpecCount = 0U)\r
-       {\r
-               HRESULT hRet = m_spFileDlg.CoCreateInstance(CLSID_FileOpenDialog);\r
-\r
-               if(SUCCEEDED(hRet))\r
-                       _Init(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount);\r
-       }\r
-\r
-       IFileOpenDialog* GetPtr()\r
-       {\r
-               return m_spFileDlg;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CShellFileOpenDialog - new Shell File Open dialog without events\r
-\r
-class CShellFileOpenDialog : public CShellFileOpenDialogImpl<CShellFileOpenDialog>\r
-{\r
-public:\r
-       CShellFileOpenDialog(LPCWSTR lpszFileName = NULL, \r
-                            DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST, \r
-                            LPCWSTR lpszDefExt = NULL, \r
-                            const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \r
-                            UINT uFilterSpecCount = 0U) : CShellFileOpenDialogImpl<CShellFileOpenDialog>(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount)\r
-       { }\r
-\r
-// Implementation (remove _Advise/_Unadvise code using template magic)\r
-       void _Advise(DWORD& /*dwCookie*/)\r
-       { }\r
-\r
-       void _Unadvise(DWORD /*dwCookie*/)\r
-       { }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CShellFileSaveDialogImpl - implements new Shell File Save dialog\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CShellFileSaveDialogImpl : public CShellFileDialogImpl< T >\r
-{\r
-public:\r
-       ATL::CComPtr<IFileSaveDialog> m_spFileDlg;\r
-\r
-       CShellFileSaveDialogImpl(LPCWSTR lpszFileName = NULL, \r
-                                DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT, \r
-                                LPCWSTR lpszDefExt = NULL, \r
-                                const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \r
-                                UINT uFilterSpecCount = 0U)\r
-       {\r
-               HRESULT hRet = m_spFileDlg.CoCreateInstance(CLSID_FileSaveDialog);\r
-\r
-               if(SUCCEEDED(hRet))\r
-                       _Init(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount);\r
-       }\r
-\r
-       IFileSaveDialog* GetPtr()\r
-       {\r
-               return m_spFileDlg;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CShellFileSaveDialog - new Shell File Save dialog without events\r
-\r
-class CShellFileSaveDialog : public CShellFileSaveDialogImpl<CShellFileSaveDialog>\r
-{\r
-public:\r
-       CShellFileSaveDialog(LPCWSTR lpszFileName = NULL, \r
-                            DWORD dwOptions = FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT, \r
-                            LPCWSTR lpszDefExt = NULL, \r
-                            const COMDLG_FILTERSPEC* arrFilterSpec = NULL, \r
-                            UINT uFilterSpecCount = 0U) : CShellFileSaveDialogImpl<CShellFileSaveDialog>(lpszFileName, dwOptions, lpszDefExt, arrFilterSpec, uFilterSpecCount)\r
-       { }\r
-\r
-// Implementation (remove _Advise/_Unadvise code using template magic)\r
-       void _Advise(DWORD& /*dwCookie*/)\r
-       { }\r
-\r
-       void _Unadvise(DWORD /*dwCookie*/)\r
-       { }\r
-};\r
-\r
-#endif // (_WIN32_WINNT >= 0x0600) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFolderDialogImpl - used for browsing for a folder\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CFolderDialogImpl\r
-{\r
-public:\r
-       BROWSEINFO m_bi;\r
-       LPCTSTR m_lpstrInitialFolder;\r
-       LPCITEMIDLIST m_pidlInitialSelection;\r
-       bool m_bExpandInitialSelection;\r
-       TCHAR m_szFolderDisplayName[MAX_PATH];\r
-       TCHAR m_szFolderPath[MAX_PATH];\r
-       LPITEMIDLIST m_pidlSelected;\r
-       HWND m_hWnd;   // used only in the callback function\r
-\r
-// Constructor\r
-       CFolderDialogImpl(HWND hWndParent = NULL, LPCTSTR lpstrTitle = NULL, UINT uFlags = BIF_RETURNONLYFSDIRS) : \r
-                       m_lpstrInitialFolder(NULL), m_pidlInitialSelection(NULL), m_bExpandInitialSelection(false), m_pidlSelected(NULL), m_hWnd(NULL)\r
-       {\r
-               memset(&m_bi, 0, sizeof(m_bi)); // initialize structure to 0/NULL\r
-\r
-               m_bi.hwndOwner = hWndParent;\r
-               m_bi.pidlRoot = NULL;\r
-               m_bi.pszDisplayName = m_szFolderDisplayName;\r
-               m_bi.lpszTitle = lpstrTitle;\r
-               m_bi.ulFlags = uFlags;\r
-               m_bi.lpfn = BrowseCallbackProc;\r
-               m_bi.lParam = (LPARAM)static_cast<T*>(this);\r
-\r
-               m_szFolderPath[0] = 0;\r
-               m_szFolderDisplayName[0] = 0;\r
-       }\r
-\r
-       ~CFolderDialogImpl()\r
-       {\r
-               ::CoTaskMemFree(m_pidlSelected);\r
-       }\r
-\r
-// Operations\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               if(m_bi.hwndOwner == NULL)   // set only if not specified before\r
-                       m_bi.hwndOwner = hWndParent;\r
-\r
-               // Clear out any previous results\r
-               m_szFolderPath[0] = 0;\r
-               m_szFolderDisplayName[0] = 0;\r
-               ::CoTaskMemFree(m_pidlSelected);\r
-\r
-               INT_PTR nRet = IDCANCEL;\r
-               m_pidlSelected = ::SHBrowseForFolder(&m_bi);\r
-\r
-               if(m_pidlSelected != NULL)\r
-               {\r
-                       nRet = IDOK;\r
-\r
-                       // If BIF_RETURNONLYFSDIRS is set, we try to get the filesystem path.\r
-                       // Otherwise, the caller must handle the ID-list directly.\r
-                       if((m_bi.ulFlags & BIF_RETURNONLYFSDIRS) != 0)\r
-                       {\r
-                               if(::SHGetPathFromIDList(m_pidlSelected, m_szFolderPath) == FALSE)\r
-                                       nRet = IDCANCEL;\r
-                       }\r
-               }\r
-\r
-               return nRet;\r
-       }\r
-\r
-       // Methods to call before DoModal\r
-       void SetInitialFolder(LPCTSTR lpstrInitialFolder, bool bExpand = true)\r
-       {\r
-               // lpstrInitialFolder may be a file if BIF_BROWSEINCLUDEFILES is specified\r
-               m_lpstrInitialFolder = lpstrInitialFolder;\r
-               m_bExpandInitialSelection = bExpand;\r
-       }\r
-\r
-       void SetInitialSelection(LPCITEMIDLIST pidl, bool bExpand = true)\r
-       {\r
-               m_pidlInitialSelection = pidl;\r
-               m_bExpandInitialSelection = bExpand;\r
-       }\r
-\r
-       // Methods to call after DoModal\r
-       LPITEMIDLIST GetSelectedItem(bool bDetach = false)\r
-       {\r
-               LPITEMIDLIST pidl = m_pidlSelected;\r
-               if(bDetach)\r
-                       m_pidlSelected = NULL;\r
-\r
-               return pidl;\r
-       }\r
-\r
-       LPCTSTR GetFolderPath() const\r
-       {\r
-               return m_szFolderPath;\r
-       }\r
-\r
-       LPCTSTR GetFolderDisplayName() const\r
-       {\r
-               return m_szFolderDisplayName;\r
-       }\r
-\r
-       int GetFolderImageIndex() const\r
-       {\r
-               return m_bi.iImage;\r
-       }\r
-\r
-// Callback function and overrideables\r
-       static int CALLBACK BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)\r
-       {\r
-#ifndef BFFM_VALIDATEFAILED\r
-  #ifdef UNICODE\r
-               const int BFFM_VALIDATEFAILED = 4;\r
-  #else\r
-               const int BFFM_VALIDATEFAILED = 3;\r
-  #endif\r
-#endif // !BFFM_VALIDATEFAILED\r
-#ifndef BFFM_IUNKNOWN\r
-               const int BFFM_IUNKNOWN = 5;\r
-#endif // !BFFM_IUNKNOWN\r
-#ifndef BIF_NEWDIALOGSTYLE\r
-               const UINT BIF_NEWDIALOGSTYLE = 0x0040;\r
-#endif // !BIF_NEWDIALOGSTYLE\r
-\r
-               int nRet = 0;\r
-               T* pT = (T*)lpData;\r
-               bool bClear = false;\r
-               if(pT->m_hWnd == NULL)\r
-               {\r
-                       pT->m_hWnd = hWnd;\r
-                       bClear = true;\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(pT->m_hWnd == hWnd);\r
-               }\r
-\r
-               switch(uMsg)\r
-               {\r
-               case BFFM_INITIALIZED:\r
-                       // Set initial selection\r
-                       // Note that m_pidlInitialSelection, if set, takes precedence over m_lpstrInitialFolder\r
-                       if(pT->m_pidlInitialSelection != NULL)\r
-                               pT->SetSelection(pT->m_pidlInitialSelection);\r
-                       else if(pT->m_lpstrInitialFolder != NULL)\r
-                               pT->SetSelection(pT->m_lpstrInitialFolder);\r
-\r
-                       // Expand initial selection if appropriate\r
-                       if(pT->m_bExpandInitialSelection && ((pT->m_bi.ulFlags & BIF_NEWDIALOGSTYLE) != 0))\r
-                       {\r
-                               if(pT->m_pidlInitialSelection != NULL)\r
-                                       pT->SetExpanded(pT->m_pidlInitialSelection);\r
-                               else if(pT->m_lpstrInitialFolder != NULL)\r
-                                       pT->SetExpanded(pT->m_lpstrInitialFolder);\r
-                       }\r
-                       pT->OnInitialized();\r
-                       break;\r
-               case BFFM_SELCHANGED:\r
-                       pT->OnSelChanged((LPITEMIDLIST)lParam);\r
-                       break;\r
-               case BFFM_VALIDATEFAILED:\r
-                       nRet = pT->OnValidateFailed((LPCTSTR)lParam);\r
-                       break;\r
-               case BFFM_IUNKNOWN:\r
-                       pT->OnIUnknown((IUnknown*)lParam);\r
-                       break;\r
-               default:\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Unknown message received in CFolderDialogImpl::BrowseCallbackProc\n"));\r
-                       break;\r
-               }\r
-\r
-               if(bClear)\r
-                       pT->m_hWnd = NULL;\r
-               return nRet;\r
-       }\r
-\r
-       void OnInitialized()\r
-       {\r
-       }\r
-\r
-       void OnSelChanged(LPITEMIDLIST /*pItemIDList*/)\r
-       {\r
-       }\r
-\r
-       int OnValidateFailed(LPCTSTR /*lpstrFolderPath*/)\r
-       {\r
-               return 1;   // 1=continue, 0=EndDialog\r
-       }\r
-\r
-       void OnIUnknown(IUnknown* /*pUnknown*/)\r
-       {\r
-       }\r
-\r
-       // Commands - valid to call only from handlers\r
-       void EnableOK(BOOL bEnable)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, BFFM_ENABLEOK, 0, bEnable);\r
-       }\r
-\r
-       void SetSelection(LPCITEMIDLIST pItemIDList)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, BFFM_SETSELECTION, FALSE, (LPARAM)pItemIDList);\r
-       }\r
-\r
-       void SetSelection(LPCTSTR lpstrFolderPath)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, BFFM_SETSELECTION, TRUE, (LPARAM)lpstrFolderPath);\r
-       }\r
-\r
-       void SetStatusText(LPCTSTR lpstrText)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)lpstrText);\r
-       }\r
-\r
-       void SetOKText(LPCTSTR lpstrOKText)\r
-       {\r
-#ifndef BFFM_SETOKTEXT\r
-               const UINT BFFM_SETOKTEXT = WM_USER + 105;\r
-#endif\r
-               ATLASSERT(m_hWnd != NULL);\r
-               USES_CONVERSION;\r
-               LPCWSTR lpstr = T2CW(lpstrOKText);\r
-               ::SendMessage(m_hWnd, BFFM_SETOKTEXT, (WPARAM)lpstr, 0L);\r
-       }\r
-\r
-       void SetExpanded(LPCITEMIDLIST pItemIDList)\r
-       {\r
-#ifndef BFFM_SETEXPANDED\r
-               const UINT BFFM_SETEXPANDED = WM_USER + 106;\r
-#endif\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, BFFM_SETEXPANDED, FALSE, (LPARAM)pItemIDList);\r
-       }\r
-\r
-       void SetExpanded(LPCTSTR lpstrFolderPath)\r
-       {\r
-#ifndef BFFM_SETEXPANDED\r
-               const UINT BFFM_SETEXPANDED = WM_USER + 106;\r
-#endif\r
-               ATLASSERT(m_hWnd != NULL);\r
-               USES_CONVERSION;\r
-               LPCWSTR lpstr = T2CW(lpstrFolderPath);\r
-               ::SendMessage(m_hWnd, BFFM_SETEXPANDED, TRUE, (LPARAM)lpstr);\r
-       }\r
-};\r
-\r
-class CFolderDialog : public CFolderDialogImpl<CFolderDialog>\r
-{\r
-public:\r
-       CFolderDialog(HWND hWndParent = NULL, LPCTSTR lpstrTitle = NULL, UINT uFlags = BIF_RETURNONLYFSDIRS)\r
-               : CFolderDialogImpl<CFolderDialog>(hWndParent, lpstrTitle, uFlags)\r
-       { }\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCommonDialogImplBase - base class for common dialog classes\r
-\r
-class ATL_NO_VTABLE CCommonDialogImplBase : public ATL::CWindowImplBase\r
-{\r
-public:\r
-       static UINT_PTR APIENTRY HookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               if(uMsg != WM_INITDIALOG)\r
-                       return 0;\r
-               CCommonDialogImplBase* pT = (CCommonDialogImplBase*)ModuleHelper::ExtractCreateWndData();\r
-               ATLASSERT(pT != NULL);\r
-               ATLASSERT(pT->m_hWnd == NULL);\r
-               ATLASSERT(::IsWindow(hWnd));\r
-               // subclass dialog's window\r
-               if(!pT->SubclassWindow(hWnd))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Subclassing a common dialog failed\n"));\r
-                       return 0;\r
-               }\r
-               // check message map for WM_INITDIALOG handler\r
-               LRESULT lRes = 0;\r
-               if(pT->ProcessWindowMessage(pT->m_hWnd, uMsg, wParam, lParam, lRes, 0) == FALSE)\r
-                       return 0;\r
-               return lRes;\r
-       }\r
-\r
-// Special override for common dialogs\r
-       BOOL EndDialog(INT_PTR /*nRetCode*/ = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               SendMessage(WM_COMMAND, MAKEWPARAM(IDABORT, 0));\r
-               return TRUE;\r
-       }\r
-\r
-// Implementation - try to override these, to prevent errors\r
-       HWND Create(HWND, ATL::_U_RECT, LPCTSTR, DWORD, DWORD, ATL::_U_MENUorID, ATOM, LPVOID)\r
-       {\r
-               ATLASSERT(FALSE);   // should not be called\r
-               return NULL;\r
-       }\r
-\r
-       static LRESULT CALLBACK StartWindowProc(HWND /*hWnd*/, UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/)\r
-       {\r
-               ATLASSERT(FALSE);   // should not be called\r
-               return 0;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFontDialogImpl - font selection dialog\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CFontDialogImpl : public CCommonDialogImplBase\r
-{\r
-public:\r
-       enum { _cchStyleName = 64 };\r
-\r
-       CHOOSEFONT m_cf;\r
-       TCHAR m_szStyleName[_cchStyleName];  // contains style name after return\r
-       LOGFONT m_lf;                        // default LOGFONT to store the info\r
-\r
-// Constructors\r
-       CFontDialogImpl(LPLOGFONT lplfInitial = NULL,\r
-                       DWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS,\r
-                       HDC hDCPrinter = NULL,\r
-                       HWND hWndParent = NULL)\r
-       {\r
-               memset(&m_cf, 0, sizeof(m_cf));\r
-               memset(&m_lf, 0, sizeof(m_lf));\r
-               memset(&m_szStyleName, 0, sizeof(m_szStyleName));\r
-\r
-               m_cf.lStructSize = sizeof(m_cf);\r
-               m_cf.hwndOwner = hWndParent;\r
-               m_cf.rgbColors = RGB(0, 0, 0);\r
-               m_cf.lpszStyle = (LPTSTR)&m_szStyleName;\r
-               m_cf.Flags = dwFlags | CF_ENABLEHOOK;\r
-               m_cf.lpfnHook = (LPCFHOOKPROC)T::HookProc;\r
-\r
-               if(lplfInitial != NULL)\r
-               {\r
-                       m_cf.lpLogFont = lplfInitial;\r
-                       m_cf.Flags |= CF_INITTOLOGFONTSTRUCT;\r
-                       m_lf = *lplfInitial;\r
-               }\r
-               else\r
-               {\r
-                       m_cf.lpLogFont = &m_lf;\r
-               }\r
-\r
-               if(hDCPrinter != NULL)\r
-               {\r
-                       m_cf.hDC = hDCPrinter;\r
-                       m_cf.Flags |= CF_PRINTERFONTS;\r
-               }\r
-       }\r
-\r
-// Operations\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT((m_cf.Flags & CF_ENABLEHOOK) != 0);\r
-               ATLASSERT(m_cf.lpfnHook != NULL);   // can still be a user hook\r
-\r
-               if(m_cf.hwndOwner == NULL)          // set only if not specified before\r
-                       m_cf.hwndOwner = hWndParent;\r
-\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\r
-\r
-               BOOL bRet = ::ChooseFont(&m_cf);\r
-\r
-               m_hWnd = NULL;\r
-\r
-               if(bRet)   // copy logical font from user's initialization buffer (if needed)\r
-                       SecureHelper::memcpy_x(&m_lf, sizeof(m_lf), m_cf.lpLogFont, sizeof(m_lf));\r
-\r
-               return bRet ? IDOK : IDCANCEL;\r
-       }\r
-\r
-       // works only when the dialog is dislayed or after\r
-       void GetCurrentFont(LPLOGFONT lplf) const\r
-       {\r
-               ATLASSERT(lplf != NULL);\r
-\r
-               if(m_hWnd != NULL)\r
-                       ::SendMessage(m_hWnd, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM)lplf);\r
-               else\r
-                       *lplf = m_lf;\r
-       }\r
-\r
-       // works only when the dialog is dislayed or before\r
-#ifndef _WIN32_WCE\r
-       void SetLogFont(LPLOGFONT lplf)\r
-       {\r
-               ATLASSERT(lplf != NULL);\r
-#ifndef WM_CHOOSEFONT_SETLOGFONT\r
-               const UINT WM_CHOOSEFONT_SETLOGFONT = (WM_USER + 101);\r
-#endif\r
-               if(m_hWnd != NULL)\r
-               {\r
-                       ::SendMessage(m_hWnd, WM_CHOOSEFONT_SETLOGFONT, 0, (LPARAM)lplf);\r
-               }\r
-               else\r
-               {\r
-                       m_lf = *lplf;\r
-                       m_cf.Flags |= CF_INITTOLOGFONTSTRUCT;\r
-               }\r
-       }\r
-\r
-       void SetFlags(DWORD dwFlags)\r
-       {\r
-#ifndef WM_CHOOSEFONT_SETFLAGS\r
-               const UINT WM_CHOOSEFONT_SETFLAGS = (WM_USER + 102);\r
-#endif\r
-               if(m_hWnd != NULL)\r
-               {\r
-                       CHOOSEFONT cf = { sizeof(CHOOSEFONT) };\r
-                       cf.Flags = dwFlags;\r
-                       ::SendMessage(m_hWnd, WM_CHOOSEFONT_SETFLAGS, 0, (LPARAM)&cf);\r
-               }\r
-               else\r
-               {\r
-                       m_cf.Flags = dwFlags;\r
-               }\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // Helpers for parsing information after successful return\r
-       LPCTSTR GetFaceName() const   // return the face name of the font\r
-       {\r
-               return (LPCTSTR)m_cf.lpLogFont->lfFaceName;\r
-       }\r
-\r
-       LPCTSTR GetStyleName() const  // return the style name of the font\r
-       {\r
-               return m_cf.lpszStyle;\r
-       }\r
-\r
-       int GetSize() const           // return the pt size of the font\r
-       {\r
-               return m_cf.iPointSize;\r
-       }\r
-\r
-       COLORREF GetColor() const     // return the color of the font\r
-       {\r
-               return m_cf.rgbColors;\r
-       }\r
-\r
-       int GetWeight() const         // return the chosen font weight\r
-       {\r
-               return (int)m_cf.lpLogFont->lfWeight;\r
-       }\r
-\r
-       BOOL IsStrikeOut() const      // return TRUE if strikeout\r
-       {\r
-               return (m_cf.lpLogFont->lfStrikeOut) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL IsUnderline() const      // return TRUE if underline\r
-       {\r
-               return (m_cf.lpLogFont->lfUnderline) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL IsBold() const           // return TRUE if bold font\r
-       {\r
-               return (m_cf.lpLogFont->lfWeight == FW_BOLD) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL IsItalic() const         // return TRUE if italic font\r
-       {\r
-               return m_cf.lpLogFont->lfItalic ? TRUE : FALSE;\r
-       }\r
-};\r
-\r
-class CFontDialog : public CFontDialogImpl<CFontDialog>\r
-{\r
-public:\r
-       CFontDialog(LPLOGFONT lplfInitial = NULL,\r
-               DWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS,\r
-               HDC hDCPrinter = NULL,\r
-               HWND hWndParent = NULL)\r
-               : CFontDialogImpl<CFontDialog>(lplfInitial, dwFlags, hDCPrinter, hWndParent)\r
-       { }\r
-\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRichEditFontDialogImpl - font selection for the Rich Edit ctrl\r
-\r
-#if defined(_RICHEDIT_) && !defined(_WIN32_WCE)\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CRichEditFontDialogImpl : public CFontDialogImpl< T >\r
-{\r
-public:\r
-       CRichEditFontDialogImpl(const CHARFORMAT& charformat,\r
-                       DWORD dwFlags = CF_SCREENFONTS,\r
-                       HDC hDCPrinter = NULL,\r
-                       HWND hWndParent = NULL)\r
-                       : CFontDialogImpl< T >(NULL, dwFlags, hDCPrinter, hWndParent)\r
-       {\r
-               m_cf.Flags |= CF_INITTOLOGFONTSTRUCT;\r
-               m_cf.Flags |= FillInLogFont(charformat);\r
-               m_cf.lpLogFont = &m_lf;\r
-\r
-               if((charformat.dwMask & CFM_COLOR) != 0)\r
-                       m_cf.rgbColors = charformat.crTextColor;\r
-       }\r
-\r
-       void GetCharFormat(CHARFORMAT& cf) const\r
-       {\r
-               USES_CONVERSION;\r
-               cf.dwEffects = 0;\r
-               cf.dwMask = 0;\r
-               if((m_cf.Flags & CF_NOSTYLESEL) == 0)\r
-               {\r
-                       cf.dwMask |= CFM_BOLD | CFM_ITALIC;\r
-                       cf.dwEffects |= IsBold() ? CFE_BOLD : 0;\r
-                       cf.dwEffects |= IsItalic() ? CFE_ITALIC : 0;\r
-               }\r
-               if((m_cf.Flags & CF_NOSIZESEL) == 0)\r
-               {\r
-                       cf.dwMask |= CFM_SIZE;\r
-                       // GetSize() returns in tenths of points so mulitply by 2 to get twips\r
-                       cf.yHeight = GetSize() * 2;\r
-               }\r
-\r
-               if((m_cf.Flags & CF_NOFACESEL) == 0)\r
-               {\r
-                       cf.dwMask |= CFM_FACE;\r
-                       cf.bPitchAndFamily = m_cf.lpLogFont->lfPitchAndFamily;\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-                       SecureHelper::strcpy_x(cf.szFaceName, _countof(cf.szFaceName), GetFaceName());\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-                       SecureHelper::strcpyA_x(cf.szFaceName, _countof(cf.szFaceName), T2A((LPTSTR)(LPCTSTR)GetFaceName()));\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-               }\r
-\r
-               if((m_cf.Flags & CF_EFFECTS) != 0)\r
-               {\r
-                       cf.dwMask |= CFM_UNDERLINE | CFM_STRIKEOUT | CFM_COLOR;\r
-                       cf.dwEffects |= IsUnderline() ? CFE_UNDERLINE : 0;\r
-                       cf.dwEffects |= IsStrikeOut() ? CFE_STRIKEOUT : 0;\r
-                       cf.crTextColor = GetColor();\r
-               }\r
-               if((m_cf.Flags & CF_NOSCRIPTSEL) == 0)\r
-               {\r
-                       cf.bCharSet = m_cf.lpLogFont->lfCharSet;\r
-                       cf.dwMask |= CFM_CHARSET;\r
-               }\r
-               cf.yOffset = 0;\r
-       }\r
-\r
-       DWORD FillInLogFont(const CHARFORMAT& cf)\r
-       {\r
-               USES_CONVERSION;\r
-               DWORD dwFlags = 0;\r
-               if((cf.dwMask & CFM_SIZE) != 0)\r
-               {\r
-                       HDC hDC = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);\r
-                       LONG yPerInch = ::GetDeviceCaps(hDC, LOGPIXELSY);\r
-                       m_lf.lfHeight = -(int)((cf.yHeight * yPerInch) / 1440);\r
-               }\r
-               else\r
-                       m_lf.lfHeight = 0;\r
-\r
-               m_lf.lfWidth = 0;\r
-               m_lf.lfEscapement = 0;\r
-               m_lf.lfOrientation = 0;\r
-\r
-               if((cf.dwMask & (CFM_ITALIC | CFM_BOLD)) == (CFM_ITALIC | CFM_BOLD))\r
-               {\r
-                       m_lf.lfWeight = ((cf.dwEffects & CFE_BOLD) != 0) ? FW_BOLD : FW_NORMAL;\r
-                       m_lf.lfItalic = (BYTE)(((cf.dwEffects & CFE_ITALIC) != 0) ? TRUE : FALSE);\r
-               }\r
-               else\r
-               {\r
-                       dwFlags |= CF_NOSTYLESEL;\r
-                       m_lf.lfWeight = FW_DONTCARE;\r
-                       m_lf.lfItalic = FALSE;\r
-               }\r
-\r
-               if((cf.dwMask & (CFM_UNDERLINE | CFM_STRIKEOUT | CFM_COLOR)) == (CFM_UNDERLINE|CFM_STRIKEOUT|CFM_COLOR))\r
-               {\r
-                       dwFlags |= CF_EFFECTS;\r
-                       m_lf.lfUnderline = (BYTE)(((cf.dwEffects & CFE_UNDERLINE) != 0) ? TRUE : FALSE);\r
-                       m_lf.lfStrikeOut = (BYTE)(((cf.dwEffects & CFE_STRIKEOUT) != 0) ? TRUE : FALSE);\r
-               }\r
-               else\r
-               {\r
-                       m_lf.lfUnderline = (BYTE)FALSE;\r
-                       m_lf.lfStrikeOut = (BYTE)FALSE;\r
-               }\r
-\r
-               if((cf.dwMask & CFM_CHARSET) != 0)\r
-                       m_lf.lfCharSet = cf.bCharSet;\r
-               else\r
-                       dwFlags |= CF_NOSCRIPTSEL;\r
-               m_lf.lfOutPrecision = OUT_DEFAULT_PRECIS;\r
-               m_lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;\r
-               m_lf.lfQuality = DEFAULT_QUALITY;\r
-               if((cf.dwMask & CFM_FACE) != 0)\r
-               {\r
-                       m_lf.lfPitchAndFamily = cf.bPitchAndFamily;\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-                       SecureHelper::strcpy_x(m_lf.lfFaceName, _countof(m_lf.lfFaceName), cf.szFaceName);\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-                       SecureHelper::strcpy_x(m_lf.lfFaceName, _countof(m_lf.lfFaceName), A2T((LPSTR)cf.szFaceName));\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-               }\r
-               else\r
-               {\r
-                       m_lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;\r
-                       m_lf.lfFaceName[0] = (TCHAR)0;\r
-               }\r
-               return dwFlags;\r
-       }\r
-};\r
-\r
-class CRichEditFontDialog : public CRichEditFontDialogImpl<CRichEditFontDialog>\r
-{\r
-public:\r
-       CRichEditFontDialog(const CHARFORMAT& charformat,\r
-               DWORD dwFlags = CF_SCREENFONTS,\r
-               HDC hDCPrinter = NULL,\r
-               HWND hWndParent = NULL)\r
-               : CRichEditFontDialogImpl<CRichEditFontDialog>(charformat, dwFlags, hDCPrinter, hWndParent)\r
-       { }\r
-\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-#endif // defined(_RICHEDIT_) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CColorDialogImpl - color selection\r
-\r
-#if !defined(_WIN32_WCE) || ((_WIN32_WCE > 420) && !(defined(WIN32_PLATFORM_WFSP) && (_WIN32_WCE > 0x0500)))\r
-\r
-#ifdef _WIN32_WCE\r
-  #pragma comment(lib, "commdlg.lib")\r
-\r
-  #ifndef SETRGBSTRING\r
-    #define SETRGBSTRING _T("commdlg_SetRGBColor")\r
-  #endif\r
-\r
-  #ifndef COLOROKSTRING\r
-    #define COLOROKSTRING _T("commdlg_ColorOK")\r
-  #endif\r
-#endif\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CColorDialogImpl : public CCommonDialogImplBase\r
-{\r
-public:\r
-       CHOOSECOLOR m_cc;\r
-\r
-// Constructor\r
-       CColorDialogImpl(COLORREF clrInit = 0, DWORD dwFlags = 0, HWND hWndParent = NULL)\r
-       {\r
-               memset(&m_cc, 0, sizeof(m_cc));\r
-\r
-               m_cc.lStructSize = sizeof(m_cc);\r
-               m_cc.lpCustColors = GetCustomColors();\r
-               m_cc.hwndOwner = hWndParent;\r
-               m_cc.Flags = dwFlags | CC_ENABLEHOOK;\r
-               m_cc.lpfnHook = (LPCCHOOKPROC)T::HookProc;\r
-\r
-               if(clrInit != 0)\r
-               {\r
-                       m_cc.rgbResult = clrInit;\r
-                       m_cc.Flags |= CC_RGBINIT;\r
-               }\r
-       }\r
-\r
-// Operations\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT((m_cc.Flags & CC_ENABLEHOOK) != 0);\r
-               ATLASSERT(m_cc.lpfnHook != NULL);   // can still be a user hook\r
-\r
-               if(m_cc.hwndOwner == NULL)          // set only if not specified before\r
-                       m_cc.hwndOwner = hWndParent;\r
-\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\r
-\r
-               BOOL bRet = ::ChooseColor(&m_cc);\r
-\r
-               m_hWnd = NULL;\r
-\r
-               return bRet ? IDOK : IDCANCEL;\r
-       }\r
-\r
-       // Set the current color while dialog is displayed\r
-       void SetCurrentColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               SendMessage(_GetSetRGBMessage(), 0, (LPARAM)clr);\r
-       }\r
-\r
-       // Get the selected color after DoModal returns, or in OnColorOK\r
-       COLORREF GetColor() const\r
-       {\r
-               return m_cc.rgbResult;\r
-       }\r
-\r
-// Special override for the color dialog\r
-       static UINT_PTR APIENTRY HookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               if(uMsg != WM_INITDIALOG && uMsg != _GetColorOKMessage())\r
-                       return 0;\r
-\r
-               LPCHOOSECOLOR lpCC = (LPCHOOSECOLOR)lParam;\r
-               CCommonDialogImplBase* pT = NULL;\r
-\r
-               if(uMsg == WM_INITDIALOG)\r
-               {\r
-                       pT = (CCommonDialogImplBase*)ModuleHelper::ExtractCreateWndData();\r
-                       lpCC->lCustData = (LPARAM)pT;\r
-                       ATLASSERT(pT != NULL);\r
-                       ATLASSERT(pT->m_hWnd == NULL);\r
-                       ATLASSERT(::IsWindow(hWnd));\r
-                       // subclass dialog's window\r
-                       if(!pT->SubclassWindow(hWnd))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("Subclassing a Color common dialog failed\n"));\r
-                               return 0;\r
-                       }\r
-               }\r
-               else if(uMsg == _GetColorOKMessage())\r
-               {\r
-                       pT = (CCommonDialogImplBase*)lpCC->lCustData;\r
-                       ATLASSERT(pT != NULL);\r
-                       ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               }\r
-\r
-               // pass to the message map\r
-               LRESULT lRes;\r
-               if(pT->ProcessWindowMessage(pT->m_hWnd, uMsg, wParam, lParam, lRes, 0) == FALSE)\r
-                       return 0;\r
-               return lRes;\r
-       }\r
-\r
-// Helpers\r
-       static COLORREF* GetCustomColors()\r
-       {\r
-               static COLORREF rgbCustomColors[16] =\r
-               {\r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-                       RGB(255, 255, 255), RGB(255, 255, 255), \r
-               };\r
-\r
-               return rgbCustomColors;\r
-       }\r
-\r
-       static UINT _GetSetRGBMessage()\r
-       {\r
-               static UINT uSetRGBMessage = 0;\r
-               if(uSetRGBMessage == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CColorDialogImpl::_GetSetRGBMessage.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uSetRGBMessage == 0)\r
-                               uSetRGBMessage = ::RegisterWindowMessage(SETRGBSTRING);\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uSetRGBMessage != 0);\r
-               return uSetRGBMessage;\r
-       }\r
-\r
-       static UINT _GetColorOKMessage()\r
-       {\r
-               static UINT uColorOKMessage = 0;\r
-               if(uColorOKMessage == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CColorDialogImpl::_GetColorOKMessage.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uColorOKMessage == 0)\r
-                               uColorOKMessage = ::RegisterWindowMessage(COLOROKSTRING);\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uColorOKMessage != 0);\r
-               return uColorOKMessage;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CColorDialogImpl)\r
-               MESSAGE_HANDLER(_GetColorOKMessage(), _OnColorOK)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT _OnColorOK(UINT, WPARAM, LPARAM, BOOL&)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return pT->OnColorOK();\r
-       }\r
-\r
-// Overrideable\r
-       BOOL OnColorOK()        // validate color\r
-       {\r
-               return FALSE;\r
-       }\r
-};\r
-\r
-class CColorDialog : public CColorDialogImpl<CColorDialog>\r
-{\r
-public:\r
-       CColorDialog(COLORREF clrInit = 0, DWORD dwFlags = 0, HWND hWndParent = NULL)\r
-               : CColorDialogImpl<CColorDialog>(clrInit, dwFlags, hWndParent)\r
-       { }\r
-\r
-       // override base class map and references to handlers\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-#endif // !defined(_WIN32_WCE) || ((_WIN32_WCE > 420) && !(defined(WIN32_PLATFORM_WFSP) && (_WIN32_WCE > 0x0500)))\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrintDialogImpl - used for Print... and PrintSetup...\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-// global helper\r
-static HDC _AtlCreateDC(HGLOBAL hDevNames, HGLOBAL hDevMode)\r
-{\r
-       if(hDevNames == NULL)\r
-               return NULL;\r
-\r
-       LPDEVNAMES lpDevNames = (LPDEVNAMES)::GlobalLock(hDevNames);\r
-       LPDEVMODE  lpDevMode = (hDevMode != NULL) ? (LPDEVMODE)::GlobalLock(hDevMode) : NULL;\r
-\r
-       if(lpDevNames == NULL)\r
-               return NULL;\r
-\r
-       HDC hDC = ::CreateDC((LPCTSTR)lpDevNames + lpDevNames->wDriverOffset,\r
-                                         (LPCTSTR)lpDevNames + lpDevNames->wDeviceOffset,\r
-                                         (LPCTSTR)lpDevNames + lpDevNames->wOutputOffset,\r
-                                         lpDevMode);\r
-\r
-       ::GlobalUnlock(hDevNames);\r
-       if(hDevMode != NULL)\r
-               ::GlobalUnlock(hDevMode);\r
-       return hDC;\r
-}\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CPrintDialogImpl : public CCommonDialogImplBase\r
-{\r
-public:\r
-       // print dialog parameter block (note this is a reference)\r
-       PRINTDLG& m_pd;\r
-\r
-// Constructors\r
-       CPrintDialogImpl(BOOL bPrintSetupOnly = FALSE,  // TRUE for Print Setup, FALSE for Print Dialog\r
-                       DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION,\r
-                       HWND hWndParent = NULL)\r
-                       : m_pd(m_pdActual)\r
-       {\r
-               memset(&m_pdActual, 0, sizeof(m_pdActual));\r
-\r
-               m_pd.lStructSize = sizeof(m_pdActual);\r
-               m_pd.hwndOwner = hWndParent;\r
-               m_pd.Flags = (dwFlags | PD_ENABLEPRINTHOOK | PD_ENABLESETUPHOOK);\r
-               m_pd.lpfnPrintHook = (LPPRINTHOOKPROC)T::HookProc;\r
-               m_pd.lpfnSetupHook = (LPSETUPHOOKPROC)T::HookProc;\r
-\r
-               if(bPrintSetupOnly)\r
-                       m_pd.Flags |= PD_PRINTSETUP;\r
-               else\r
-                       m_pd.Flags |= PD_RETURNDC;\r
-\r
-               m_pd.Flags &= ~PD_RETURNIC; // do not support information context\r
-       }\r
-\r
-// Operations\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT((m_pd.Flags & PD_ENABLEPRINTHOOK) != 0);\r
-               ATLASSERT((m_pd.Flags & PD_ENABLESETUPHOOK) != 0);\r
-               ATLASSERT(m_pd.lpfnPrintHook != NULL);   // can still be a user hook\r
-               ATLASSERT(m_pd.lpfnSetupHook != NULL);   // can still be a user hook\r
-               ATLASSERT((m_pd.Flags & PD_RETURNDEFAULT) == 0);   // use GetDefaults for this\r
-\r
-               if(m_pd.hwndOwner == NULL)   // set only if not specified before\r
-                       m_pd.hwndOwner = hWndParent;\r
-\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\r
-\r
-               BOOL bRet = ::PrintDlg(&m_pd);\r
-\r
-               m_hWnd = NULL;\r
-\r
-               return bRet ? IDOK : IDCANCEL;\r
-       }\r
-\r
-       // GetDefaults will not display a dialog but will get device defaults\r
-       BOOL GetDefaults()\r
-       {\r
-               m_pd.Flags |= PD_RETURNDEFAULT;\r
-               ATLASSERT(m_pd.hDevMode == NULL);    // must be NULL\r
-               ATLASSERT(m_pd.hDevNames == NULL);   // must be NULL\r
-\r
-               return ::PrintDlg(&m_pd);\r
-       }\r
-\r
-       // Helpers for parsing information after successful return num. copies requested\r
-       int GetCopies() const\r
-       {\r
-               if((m_pd.Flags & PD_USEDEVMODECOPIES) != 0)\r
-               {\r
-                       LPDEVMODE lpDevMode = GetDevMode();\r
-                       return (lpDevMode != NULL) ? lpDevMode->dmCopies : -1;\r
-               }\r
-\r
-               return m_pd.nCopies;\r
-       }\r
-\r
-       BOOL PrintCollate() const       // TRUE if collate checked\r
-       {\r
-               return ((m_pd.Flags & PD_COLLATE) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintSelection() const     // TRUE if printing selection\r
-       {\r
-               return ((m_pd.Flags & PD_SELECTION) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintAll() const           // TRUE if printing all pages\r
-       {\r
-               return (!PrintRange() && !PrintSelection()) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintRange() const         // TRUE if printing page range\r
-       {\r
-               return ((m_pd.Flags & PD_PAGENUMS) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintToFile() const        // TRUE if printing to a file\r
-       {\r
-               return ((m_pd.Flags & PD_PRINTTOFILE) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       int GetFromPage() const         // starting page if valid\r
-       {\r
-               return PrintRange() ? m_pd.nFromPage : -1;\r
-       }\r
-\r
-       int GetToPage() const           // ending page if valid\r
-       {\r
-               return PrintRange() ? m_pd.nToPage : -1;\r
-       }\r
-\r
-       LPDEVMODE GetDevMode() const    // return DEVMODE\r
-       {\r
-               if(m_pd.hDevMode == NULL)\r
-                       return NULL;\r
-\r
-               return (LPDEVMODE)::GlobalLock(m_pd.hDevMode);\r
-       }\r
-\r
-       LPCTSTR GetDriverName() const   // return driver name\r
-       {\r
-               if(m_pd.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pd.hDevNames);\r
-               if(lpDev == NULL)\r
-                       return NULL;\r
-\r
-               return (LPCTSTR)lpDev + lpDev->wDriverOffset;\r
-       }\r
-\r
-       LPCTSTR GetDeviceName() const   // return device name\r
-       {\r
-               if(m_pd.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pd.hDevNames);\r
-               if(lpDev == NULL)\r
-                       return NULL;\r
-\r
-               return (LPCTSTR)lpDev + lpDev->wDeviceOffset;\r
-       }\r
-\r
-       LPCTSTR GetPortName() const     // return output port name\r
-       {\r
-               if(m_pd.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pd.hDevNames);\r
-               if(lpDev == NULL)\r
-                       return NULL;\r
-\r
-               return (LPCTSTR)lpDev + lpDev->wOutputOffset;\r
-       }\r
-\r
-       HDC GetPrinterDC() const        // return HDC (caller must delete)\r
-       {\r
-               ATLASSERT((m_pd.Flags & PD_RETURNDC) != 0);\r
-               return m_pd.hDC;\r
-       }\r
-\r
-       // This helper creates a DC based on the DEVNAMES and DEVMODE structures.\r
-       // This DC is returned, but also stored in m_pd.hDC as though it had been\r
-       // returned by CommDlg.  It is assumed that any previously obtained DC\r
-       // has been/will be deleted by the user.  This may be\r
-       // used without ever invoking the print/print setup dialogs.\r
-       HDC CreatePrinterDC()\r
-       {\r
-               m_pd.hDC = _AtlCreateDC(m_pd.hDevNames, m_pd.hDevMode);\r
-               return m_pd.hDC;\r
-       }\r
-\r
-// Implementation\r
-       PRINTDLG m_pdActual; // the Print/Print Setup need to share this\r
-\r
-       // The following handle the case of print setup... from the print dialog\r
-       CPrintDialogImpl(PRINTDLG& pdInit) : m_pd(pdInit)\r
-       { }\r
-\r
-       BEGIN_MSG_MAP(CPrintDialogImpl)\r
-#ifdef psh1\r
-               COMMAND_ID_HANDLER(psh1, OnPrintSetup) // print setup button when print is displayed\r
-#else // !psh1\r
-               COMMAND_ID_HANDLER(0x0400, OnPrintSetup) // value from dlgs.h\r
-#endif // !psh1\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnPrintSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/)\r
-       {\r
-               T dlgSetup(m_pd);\r
-               ModuleHelper::AddCreateWndData(&dlgSetup.m_thunk.cd, (CCommonDialogImplBase*)&dlgSetup);\r
-               return DefWindowProc(WM_COMMAND, MAKEWPARAM(wID, wNotifyCode), (LPARAM)hWndCtl);\r
-       }\r
-};\r
-\r
-class CPrintDialog : public CPrintDialogImpl<CPrintDialog>\r
-{\r
-public:\r
-       CPrintDialog(BOOL bPrintSetupOnly = FALSE,\r
-               DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION,\r
-               HWND hWndParent = NULL)\r
-               : CPrintDialogImpl<CPrintDialog>(bPrintSetupOnly, dwFlags, hWndParent)\r
-       { }\r
-\r
-       CPrintDialog(PRINTDLG& pdInit) : CPrintDialogImpl<CPrintDialog>(pdInit)\r
-       { }\r
-};\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrintDialogExImpl - new print dialog for Windows 2000\r
-\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-}; // namespace WTL\r
-\r
-#include <atlcom.h>\r
-\r
-extern "C" const __declspec(selectany) IID IID_IPrintDialogCallback = {0x5852a2c3, 0x6530, 0x11d1, {0xb6, 0xa3, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9}};\r
-extern "C" const __declspec(selectany) IID IID_IPrintDialogServices = {0x509aaeda, 0x5639, 0x11d1, {0xb6, 0xa1, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9}};\r
-\r
-namespace WTL\r
-{\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CPrintDialogExImpl : \r
-                               public ATL::CWindow,\r
-                               public ATL::CMessageMap,\r
-                               public IPrintDialogCallback,\r
-                               public ATL::IObjectWithSiteImpl< T >\r
-{\r
-public:\r
-       PRINTDLGEX m_pdex;\r
-\r
-// Constructor\r
-       CPrintDialogExImpl(DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION | PD_NOCURRENTPAGE,\r
-                               HWND hWndParent = NULL)\r
-       {\r
-               memset(&m_pdex, 0, sizeof(m_pdex));\r
-\r
-               m_pdex.lStructSize = sizeof(PRINTDLGEX);\r
-               m_pdex.hwndOwner = hWndParent;\r
-               m_pdex.Flags = dwFlags;\r
-               m_pdex.nStartPage = START_PAGE_GENERAL;\r
-               // callback object will be set in DoModal\r
-\r
-               m_pdex.Flags &= ~PD_RETURNIC; // do not support information context\r
-       }\r
-\r
-// Operations\r
-       HRESULT DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ATLASSERT((m_pdex.Flags & PD_RETURNDEFAULT) == 0);   // use GetDefaults for this\r
-\r
-               if(m_pdex.hwndOwner == NULL)   // set only if not specified before\r
-                       m_pdex.hwndOwner = hWndParent;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               m_pdex.lpCallback = (IUnknown*)(IPrintDialogCallback*)pT;\r
-\r
-               HRESULT hResult = ::PrintDlgEx(&m_pdex);\r
-\r
-               m_hWnd = NULL;\r
-\r
-               return hResult;\r
-       }\r
-\r
-       BOOL EndDialog(INT_PTR /*nRetCode*/ = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               SendMessage(WM_COMMAND, MAKEWPARAM(IDABORT, 0));\r
-               return TRUE;\r
-       }\r
-\r
-       // GetDefaults will not display a dialog but will get device defaults\r
-       HRESULT GetDefaults()\r
-       {\r
-               m_pdex.Flags |= PD_RETURNDEFAULT;\r
-               ATLASSERT(m_pdex.hDevMode == NULL);    // must be NULL\r
-               ATLASSERT(m_pdex.hDevNames == NULL);   // must be NULL\r
-\r
-               return ::PrintDlgEx(&m_pdex);\r
-       }\r
-\r
-       // Helpers for parsing information after successful return num. copies requested\r
-       int GetCopies() const\r
-       {\r
-               if((m_pdex.Flags & PD_USEDEVMODECOPIES) != 0)\r
-               {\r
-                       LPDEVMODE lpDevMode = GetDevMode();\r
-                       return (lpDevMode != NULL) ? lpDevMode->dmCopies : -1;\r
-               }\r
-\r
-               return m_pdex.nCopies;\r
-       }\r
-\r
-       BOOL PrintCollate() const       // TRUE if collate checked\r
-       {\r
-               return ((m_pdex.Flags & PD_COLLATE) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintSelection() const     // TRUE if printing selection\r
-       {\r
-               return ((m_pdex.Flags & PD_SELECTION) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintAll() const           // TRUE if printing all pages\r
-       {\r
-               return (!PrintRange() && !PrintSelection()) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintRange() const         // TRUE if printing page range\r
-       {\r
-               return ((m_pdex.Flags & PD_PAGENUMS) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL PrintToFile() const        // TRUE if printing to a file\r
-       {\r
-               return ((m_pdex.Flags & PD_PRINTTOFILE) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       LPDEVMODE GetDevMode() const    // return DEVMODE\r
-       {\r
-               if(m_pdex.hDevMode == NULL)\r
-                       return NULL;\r
-\r
-               return (LPDEVMODE)::GlobalLock(m_pdex.hDevMode);\r
-       }\r
-\r
-       LPCTSTR GetDriverName() const   // return driver name\r
-       {\r
-               if(m_pdex.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pdex.hDevNames);\r
-               if(lpDev == NULL)\r
-                       return NULL;\r
-\r
-               return (LPCTSTR)lpDev + lpDev->wDriverOffset;\r
-       }\r
-\r
-       LPCTSTR GetDeviceName() const   // return device name\r
-       {\r
-               if(m_pdex.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pdex.hDevNames);\r
-               if(lpDev == NULL)\r
-                       return NULL;\r
-\r
-               return (LPCTSTR)lpDev + lpDev->wDeviceOffset;\r
-       }\r
-\r
-       LPCTSTR GetPortName() const     // return output port name\r
-       {\r
-               if(m_pdex.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_pdex.hDevNames);\r
-               if(lpDev == NULL)\r
-                       return NULL;\r
-\r
-               return (LPCTSTR)lpDev + lpDev->wOutputOffset;\r
-       }\r
-\r
-       HDC GetPrinterDC() const        // return HDC (caller must delete)\r
-       {\r
-               ATLASSERT((m_pdex.Flags & PD_RETURNDC) != 0);\r
-               return m_pdex.hDC;\r
-       }\r
-\r
-       // This helper creates a DC based on the DEVNAMES and DEVMODE structures.\r
-       // This DC is returned, but also stored in m_pdex.hDC as though it had been\r
-       // returned by CommDlg.  It is assumed that any previously obtained DC\r
-       // has been/will be deleted by the user.  This may be\r
-       // used without ever invoking the print/print setup dialogs.\r
-       HDC CreatePrinterDC()\r
-       {\r
-               m_pdex.hDC = _AtlCreateDC(m_pdex.hDevNames, m_pdex.hDevMode);\r
-               return m_pdex.hDC;\r
-       }\r
-\r
-// Implementation - interfaces\r
-\r
-// IUnknown\r
-       STDMETHOD(QueryInterface)(REFIID riid, void** ppvObject)\r
-       {\r
-               if(ppvObject == NULL)\r
-                       return E_POINTER;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(IsEqualGUID(riid, IID_IUnknown) || IsEqualGUID(riid, IID_IPrintDialogCallback))\r
-               {\r
-                       *ppvObject = (IPrintDialogCallback*)pT;\r
-                       // AddRef() not needed\r
-                       return S_OK;\r
-               }\r
-               else if(IsEqualGUID(riid, IID_IObjectWithSite))\r
-               {\r
-                       *ppvObject = (IObjectWithSite*)pT;\r
-                       // AddRef() not needed\r
-                       return S_OK;\r
-               }\r
-\r
-               return E_NOINTERFACE;\r
-       }\r
-\r
-       virtual ULONG STDMETHODCALLTYPE AddRef()\r
-       {\r
-               return 1;\r
-       }\r
-\r
-       virtual ULONG STDMETHODCALLTYPE Release()\r
-       {\r
-               return 1;\r
-       }\r
-\r
-// IPrintDialogCallback\r
-       STDMETHOD(InitDone)()\r
-       {\r
-               return S_FALSE;\r
-       }\r
-\r
-       STDMETHOD(SelectionChange)()\r
-       {\r
-               return S_FALSE;\r
-       }\r
-\r
-       STDMETHOD(HandleMessage)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult)\r
-       {\r
-               // set up m_hWnd the first time\r
-               if(m_hWnd == NULL)\r
-                       Attach(hWnd);\r
-\r
-               // call message map\r
-               HRESULT hRet = ProcessWindowMessage(hWnd, uMsg, wParam, lParam, *plResult, 0) ? S_OK : S_FALSE;\r
-               if(hRet == S_OK && uMsg == WM_NOTIFY)   // return in DWLP_MSGRESULT\r
-                       ::SetWindowLongPtr(GetParent(), DWLP_MSGRESULT, (LONG_PTR)*plResult);\r
-\r
-               if(uMsg == WM_INITDIALOG && hRet == S_OK && (BOOL)*plResult != FALSE)\r
-                       hRet = S_FALSE;\r
-\r
-               return hRet;\r
-       }\r
-};\r
-\r
-class CPrintDialogEx : public CPrintDialogExImpl<CPrintDialogEx>\r
-{\r
-public:\r
-       CPrintDialogEx(\r
-               DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION | PD_NOCURRENTPAGE,\r
-               HWND hWndParent = NULL)\r
-               : CPrintDialogExImpl<CPrintDialogEx>(dwFlags, hWndParent)\r
-       { }\r
-\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPageSetupDialogImpl - Page Setup dialog\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CPageSetupDialogImpl : public CCommonDialogImplBase\r
-{\r
-public:\r
-       PAGESETUPDLG m_psd;\r
-       ATL::CWndProcThunk m_thunkPaint;\r
-\r
-// Constructors\r
-       CPageSetupDialogImpl(DWORD dwFlags = PSD_MARGINS | PSD_INWININIINTLMEASURE, HWND hWndParent = NULL)\r
-       {\r
-               memset(&m_psd, 0, sizeof(m_psd));\r
-\r
-               m_psd.lStructSize = sizeof(m_psd);\r
-               m_psd.hwndOwner = hWndParent;\r
-               m_psd.Flags = (dwFlags | PSD_ENABLEPAGESETUPHOOK | PSD_ENABLEPAGEPAINTHOOK);\r
-               m_psd.lpfnPageSetupHook = (LPPAGESETUPHOOK)T::HookProc;\r
-               m_thunkPaint.Init((WNDPROC)T::PaintHookProc, this);\r
-#if (_ATL_VER >= 0x0700)\r
-               m_psd.lpfnPagePaintHook = (LPPAGEPAINTHOOK)m_thunkPaint.GetWNDPROC();\r
-#else\r
-               m_psd.lpfnPagePaintHook = (LPPAGEPAINTHOOK)&(m_thunkPaint.thunk);\r
-#endif\r
-       }\r
-\r
-       DECLARE_EMPTY_MSG_MAP()\r
-\r
-// Attributes\r
-       LPDEVMODE GetDevMode() const    // return DEVMODE\r
-       {\r
-               if(m_psd.hDevMode == NULL)\r
-                       return NULL;\r
-\r
-               return (LPDEVMODE)::GlobalLock(m_psd.hDevMode);\r
-       }\r
-\r
-       LPCTSTR GetDriverName() const   // return driver name\r
-       {\r
-               if(m_psd.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_psd.hDevNames);\r
-               return (LPCTSTR)lpDev + lpDev->wDriverOffset;\r
-       }\r
-\r
-       LPCTSTR GetDeviceName() const   // return device name\r
-       {\r
-               if(m_psd.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_psd.hDevNames);\r
-               return (LPCTSTR)lpDev + lpDev->wDeviceOffset;\r
-       }\r
-\r
-       LPCTSTR GetPortName() const     // return output port name\r
-       {\r
-               if(m_psd.hDevNames == NULL)\r
-                       return NULL;\r
-\r
-               LPDEVNAMES lpDev = (LPDEVNAMES)::GlobalLock(m_psd.hDevNames);\r
-               return (LPCTSTR)lpDev + lpDev->wOutputOffset;\r
-       }\r
-\r
-       HDC CreatePrinterDC()\r
-       {\r
-               return _AtlCreateDC(m_psd.hDevNames, m_psd.hDevMode);\r
-       }\r
-\r
-       SIZE GetPaperSize() const\r
-       {\r
-               SIZE size;\r
-               size.cx = m_psd.ptPaperSize.x;\r
-               size.cy = m_psd.ptPaperSize.y;\r
-               return size;\r
-       }\r
-\r
-       void GetMargins(LPRECT lpRectMargins, LPRECT lpRectMinMargins) const\r
-       {\r
-               if(lpRectMargins != NULL)\r
-                       *lpRectMargins = m_psd.rtMargin;\r
-               if(lpRectMinMargins != NULL)\r
-                       *lpRectMinMargins = m_psd.rtMinMargin;\r
-       }\r
-\r
-// Operations\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT((m_psd.Flags & PSD_ENABLEPAGESETUPHOOK) != 0);\r
-               ATLASSERT((m_psd.Flags & PSD_ENABLEPAGEPAINTHOOK) != 0);\r
-               ATLASSERT(m_psd.lpfnPageSetupHook != NULL);   // can still be a user hook\r
-               ATLASSERT(m_psd.lpfnPagePaintHook != NULL);   // can still be a user hook\r
-\r
-               if(m_psd.hwndOwner == NULL)   // set only if not specified before\r
-                       m_psd.hwndOwner = hWndParent;\r
-\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\r
-\r
-               BOOL bRet = ::PageSetupDlg(&m_psd);\r
-\r
-               m_hWnd = NULL;\r
-\r
-               return bRet ? IDOK : IDCANCEL;\r
-       }\r
-\r
-// Implementation\r
-       static UINT_PTR CALLBACK PaintHookProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               T* pT = (T*)hWnd;\r
-               UINT_PTR uRet = 0;\r
-               switch(uMsg)\r
-               {\r
-               case WM_PSD_PAGESETUPDLG:\r
-                       uRet = pT->PreDrawPage(LOWORD(wParam), HIWORD(wParam), (LPPAGESETUPDLG)lParam);\r
-                       break;\r
-               case WM_PSD_FULLPAGERECT:\r
-               case WM_PSD_MINMARGINRECT:\r
-               case WM_PSD_MARGINRECT:\r
-               case WM_PSD_GREEKTEXTRECT:\r
-               case WM_PSD_ENVSTAMPRECT:\r
-               case WM_PSD_YAFULLPAGERECT:\r
-                       uRet = pT->OnDrawPage(uMsg, (HDC)wParam, (LPRECT)lParam);\r
-                       break;\r
-               default:\r
-                       ATLTRACE2(atlTraceUI, 0, _T("CPageSetupDialogImpl::PaintHookProc - unknown message received\n"));\r
-                       break;\r
-               }\r
-               return uRet;\r
-       }\r
-\r
-// Overridables\r
-       UINT_PTR PreDrawPage(WORD /*wPaper*/, WORD /*wFlags*/, LPPAGESETUPDLG /*pPSD*/)\r
-       {\r
-               // return 1 to prevent any more drawing\r
-               return 0;\r
-       }\r
-\r
-       UINT_PTR OnDrawPage(UINT /*uMsg*/, HDC /*hDC*/, LPRECT /*lpRect*/)\r
-       {\r
-               return 0; // do the default\r
-       }\r
-};\r
-\r
-class CPageSetupDialog : public CPageSetupDialogImpl<CPageSetupDialog>\r
-{\r
-public:\r
-       CPageSetupDialog(DWORD dwFlags = PSD_MARGINS | PSD_INWININIINTLMEASURE, HWND hWndParent = NULL)\r
-               : CPageSetupDialogImpl<CPageSetupDialog>(dwFlags, hWndParent)\r
-       { }\r
-\r
-       // override PaintHookProc and references to handlers\r
-       static UINT_PTR CALLBACK PaintHookProc(HWND, UINT, WPARAM, LPARAM)\r
-       {\r
-               return 0;\r
-       }\r
-};\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFindReplaceDialogImpl - Find/FindReplace modeless dialogs\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CFindReplaceDialogImpl : public CCommonDialogImplBase\r
-{\r
-public:\r
-       enum { _cchFindReplaceBuffer = 128 };\r
-\r
-       FINDREPLACE m_fr;\r
-       TCHAR m_szFindWhat[_cchFindReplaceBuffer];\r
-       TCHAR m_szReplaceWith[_cchFindReplaceBuffer];\r
-\r
-// Constructors\r
-       CFindReplaceDialogImpl()\r
-       {\r
-               memset(&m_fr, 0, sizeof(m_fr));\r
-               m_szFindWhat[0] = _T('\0');\r
-               m_szReplaceWith[0] = _T('\0');\r
-\r
-               m_fr.lStructSize = sizeof(m_fr);\r
-               m_fr.Flags = FR_ENABLEHOOK;\r
-               m_fr.lpfnHook = (LPFRHOOKPROC)T::HookProc;\r
-               m_fr.lpstrFindWhat = (LPTSTR)m_szFindWhat;\r
-               m_fr.wFindWhatLen = _cchFindReplaceBuffer;\r
-               m_fr.lpstrReplaceWith = (LPTSTR)m_szReplaceWith;\r
-               m_fr.wReplaceWithLen = _cchFindReplaceBuffer;\r
-       }\r
-\r
-       // Note: You must allocate the object on the heap.\r
-       //       If you do not, you must override OnFinalMessage()\r
-       virtual void OnFinalMessage(HWND /*hWnd*/)\r
-       {\r
-               delete this;\r
-       }\r
-\r
-       HWND Create(BOOL bFindDialogOnly, // TRUE for Find, FALSE for FindReplace\r
-                       LPCTSTR lpszFindWhat,\r
-                       LPCTSTR lpszReplaceWith = NULL,\r
-                       DWORD dwFlags = FR_DOWN,\r
-                       HWND hWndParent = NULL)\r
-       {\r
-               ATLASSERT((m_fr.Flags & FR_ENABLEHOOK) != 0);\r
-               ATLASSERT(m_fr.lpfnHook != NULL);\r
-\r
-               m_fr.Flags |= dwFlags;\r
-\r
-               if(hWndParent == NULL)\r
-                       m_fr.hwndOwner = ::GetActiveWindow();\r
-               else\r
-                       m_fr.hwndOwner = hWndParent;\r
-               ATLASSERT(m_fr.hwndOwner != NULL); // must have an owner for modeless dialog\r
-\r
-               if(lpszFindWhat != NULL)\r
-                       SecureHelper::strncpy_x(m_szFindWhat, _countof(m_szFindWhat), lpszFindWhat, _TRUNCATE);\r
-\r
-               if(lpszReplaceWith != NULL)\r
-                       SecureHelper::strncpy_x(m_szReplaceWith, _countof(m_szReplaceWith), lpszReplaceWith, _TRUNCATE);\r
-\r
-               ATLASSERT(m_hWnd == NULL);\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, (CCommonDialogImplBase*)this);\r
-\r
-               HWND hWnd = NULL;\r
-               if(bFindDialogOnly)\r
-                       hWnd = ::FindText(&m_fr);\r
-               else\r
-                       hWnd = ::ReplaceText(&m_fr);\r
-\r
-               ATLASSERT(m_hWnd == hWnd);\r
-               return hWnd;\r
-       }\r
-\r
-       static const UINT GetFindReplaceMsg()\r
-       {\r
-               static const UINT nMsgFindReplace = ::RegisterWindowMessage(FINDMSGSTRING);\r
-               return nMsgFindReplace;\r
-       }\r
-       // call while handling FINDMSGSTRING registered message\r
-       // to retreive the object\r
-       static T* PASCAL GetNotifier(LPARAM lParam)\r
-       {\r
-               ATLASSERT(lParam != NULL);\r
-               T* pDlg = (T*)(lParam - offsetof(T, m_fr));\r
-               return pDlg;\r
-       }\r
-\r
-// Operations\r
-       // Helpers for parsing information after successful return\r
-       LPCTSTR GetFindString() const    // get find string\r
-       {\r
-               return (LPCTSTR)m_fr.lpstrFindWhat;\r
-       }\r
-\r
-       LPCTSTR GetReplaceString() const // get replacement string\r
-       {\r
-               return (LPCTSTR)m_fr.lpstrReplaceWith;\r
-       }\r
-\r
-       BOOL SearchDown() const          // TRUE if search down, FALSE is up\r
-       {\r
-               return ((m_fr.Flags & FR_DOWN) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL FindNext() const            // TRUE if command is find next\r
-       {\r
-               return ((m_fr.Flags & FR_FINDNEXT) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL MatchCase() const           // TRUE if matching case\r
-       {\r
-               return ((m_fr.Flags & FR_MATCHCASE) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL MatchWholeWord() const      // TRUE if matching whole words only\r
-       {\r
-               return ((m_fr.Flags & FR_WHOLEWORD) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL ReplaceCurrent() const      // TRUE if replacing current string\r
-       {\r
-               return ((m_fr. Flags & FR_REPLACE) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL ReplaceAll() const          // TRUE if replacing all occurrences\r
-       {\r
-               return ((m_fr.Flags & FR_REPLACEALL) != 0) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL IsTerminating() const       // TRUE if terminating dialog\r
-       {\r
-               return ((m_fr.Flags & FR_DIALOGTERM) != 0) ? TRUE : FALSE ;\r
-       }\r
-};\r
-\r
-class CFindReplaceDialog : public CFindReplaceDialogImpl<CFindReplaceDialog>\r
-{\r
-public:\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-#if (_ATL_VER >= 0x800)\r
-typedef ATL::_DialogSplitHelper::DLGTEMPLATEEX DLGTEMPLATEEX;\r
-typedef ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX DLGITEMTEMPLATEEX;\r
-#else // (_ATL_VER >= 0x800)\r
-typedef ATL::_DialogSizeHelper::_ATL_DLGTEMPLATEEX DLGTEMPLATEEX;\r
-#pragma pack(push, 4)\r
-struct DLGITEMTEMPLATEEX\r
-{\r
-       DWORD helpID;\r
-       DWORD exStyle;\r
-       DWORD style;\r
-       short x;\r
-       short y;\r
-       short cx;\r
-       short cy;\r
-       WORD id;\r
-};\r
-#pragma pack(pop)\r
-#endif // (_ATL_VER >= 0x800)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMemDlgTemplate - in-memory dialog template - DLGTEMPLATE or DLGTEMPLATEEX\r
-\r
-class CMemDlgTemplate\r
-{\r
-public:\r
-       enum StdCtrlType\r
-       {\r
-               CTRL_BUTTON    = 0x0080,\r
-               CTRL_EDIT      = 0x0081,\r
-               CTRL_STATIC    = 0x0082,\r
-               CTRL_LISTBOX   = 0x0083,\r
-               CTRL_SCROLLBAR = 0x0084,\r
-               CTRL_COMBOBOX  = 0x0085\r
-       };\r
-\r
-       CMemDlgTemplate() : m_pData(NULL), m_pPtr(NULL), m_cAllocated(0)\r
-       { }\r
-\r
-       ~CMemDlgTemplate()\r
-       {\r
-               Reset();\r
-       }\r
-\r
-       bool IsValid() const\r
-       {\r
-               return (m_pData != NULL);\r
-       }\r
-\r
-       bool IsTemplateEx() const\r
-       {\r
-               return (IsValid() && ((DLGTEMPLATEEX*)m_pData)->signature == 0xFFFF);\r
-       }\r
-\r
-       LPDLGTEMPLATE GetTemplatePtr()\r
-       {\r
-               return reinterpret_cast<LPDLGTEMPLATE>(m_pData);\r
-       }\r
-\r
-       DLGTEMPLATEEX* GetTemplateExPtr()\r
-       {\r
-               return reinterpret_cast<DLGTEMPLATEEX*>(m_pData);\r
-       }\r
-\r
-       void Reset()\r
-       {\r
-               if (IsValid())\r
-                       ATLVERIFY(::GlobalFree(m_pData) == NULL);\r
-\r
-               m_pData = NULL;\r
-               m_pPtr = NULL;\r
-               m_cAllocated = 0;\r
-       }\r
-\r
-       void Create(bool bDlgEx, LPCTSTR lpszCaption, short nX, short nY, short nWidth, short nHeight, DWORD dwStyle = 0, DWORD dwExStyle = 0, \r
-                   LPCTSTR lpstrFontName = NULL, WORD wFontSize = 0, WORD wWeight = 0, BYTE bItalic = 0, BYTE bCharset = 0, DWORD dwHelpID = 0,\r
-                               ATL::_U_STRINGorID ClassName = 0U, ATL::_U_STRINGorID Menu = 0U)\r
-       {\r
-               // Should have DS_SETFONT style to set the dialog font name and size\r
-               if (lpstrFontName != NULL)\r
-               {\r
-                       dwStyle |= DS_SETFONT;\r
-               }\r
-               else\r
-               {\r
-                       dwStyle &= ~DS_SETFONT;\r
-               }\r
-\r
-               if (bDlgEx)\r
-               {\r
-                       DLGTEMPLATEEX dlg = {1, 0xFFFF, dwHelpID, dwExStyle, dwStyle, 0, nX, nY, nWidth, nHeight};\r
-                       AddData(&dlg, sizeof(dlg));\r
-               }\r
-               else\r
-               {\r
-                       DLGTEMPLATE dlg = {dwStyle, dwExStyle, 0, nX, nY, nWidth, nHeight};\r
-                       AddData(&dlg, sizeof(dlg));\r
-               }\r
-\r
-#ifndef _WIN32_WCE\r
-               if (Menu.m_lpstr == NULL)\r
-               {\r
-                       WORD menuData = 0;\r
-                       AddData(&menuData, sizeof(WORD));\r
-               }\r
-               else if (IS_INTRESOURCE(Menu.m_lpstr))\r
-               {\r
-                       WORD menuData[] = {0xFFFF, (WORD)Menu.m_lpstr};\r
-                       AddData(menuData, sizeof(menuData));\r
-               }\r
-               else\r
-               {\r
-                       AddString(Menu.m_lpstr);\r
-               }\r
-#else // _WIN32_WCE\r
-               // Windows CE doesn't support the addition of menus to a dialog box\r
-               ATLASSERT(Menu.m_lpstr == NULL);\r
-               Menu.m_lpstr;   // avoid level 4 warning\r
-               WORD menuData = 0;\r
-               AddData(&menuData, sizeof(WORD));\r
-#endif // _WIN32_WCE\r
-\r
-               if (ClassName.m_lpstr == NULL)\r
-               {\r
-                       WORD classData = 0;\r
-                       AddData(&classData, sizeof(WORD));\r
-               }\r
-               else if (IS_INTRESOURCE(ClassName.m_lpstr))\r
-               {\r
-                       WORD classData[] = {0xFFFF, (WORD)ClassName.m_lpstr};\r
-                       AddData(classData, sizeof(classData));\r
-               }\r
-               else\r
-               {\r
-                       AddString(ClassName.m_lpstr);\r
-               }\r
-\r
-               // Set dialog caption\r
-               AddString(lpszCaption);\r
-\r
-               if (lpstrFontName != NULL)\r
-               {\r
-                       AddData(&wFontSize, sizeof(wFontSize));\r
-\r
-                       if (bDlgEx)\r
-                       {\r
-                               AddData(&wWeight, sizeof(wWeight));\r
-                               AddData(&bItalic, sizeof(bItalic));\r
-                               AddData(&bCharset, sizeof(bCharset));\r
-                       }\r
-\r
-                       AddString(lpstrFontName);\r
-               }\r
-       }\r
-\r
-       void AddControl(ATL::_U_STRINGorID ClassName, WORD wId, short nX, short nY, short nWidth, short nHeight, DWORD dwStyle, DWORD dwExStyle,\r
-                       ATL::_U_STRINGorID Text, const WORD* pCreationData = NULL, WORD nCreationData = 0, DWORD dwHelpID = 0)\r
-       {\r
-               ATLASSERT(IsValid());\r
-\r
-               // DWORD align data\r
-               m_pPtr = (LPBYTE)(DWORD_PTR)((DWORD)(DWORD_PTR)(m_pPtr + 3) & (~3));\r
-\r
-               if (IsTemplateEx())\r
-               {\r
-                       DLGTEMPLATEEX* dlg = (DLGTEMPLATEEX*)m_pData;\r
-                       dlg->cDlgItems++;\r
-\r
-                       DLGITEMTEMPLATEEX item = {dwHelpID, ATL::CControlWinTraits::GetWndExStyle(0) | dwExStyle, ATL::CControlWinTraits::GetWndStyle(0) | dwStyle, nX, nY, nWidth, nHeight, wId};\r
-                       AddData(&item, sizeof(item));\r
-               }\r
-               else\r
-               {\r
-                       LPDLGTEMPLATE dlg = (LPDLGTEMPLATE)m_pData;\r
-                       dlg->cdit++;\r
-\r
-                       DLGITEMTEMPLATE item = {ATL::CControlWinTraits::GetWndStyle(0) | dwStyle, ATL::CControlWinTraits::GetWndExStyle(0) | dwExStyle, nX, nY, nWidth, nHeight, wId};\r
-                       AddData(&item, sizeof(item));\r
-               }\r
-\r
-               ATLASSERT(ClassName.m_lpstr != NULL);\r
-               if (IS_INTRESOURCE(ClassName.m_lpstr))\r
-               {\r
-                       WORD wData[] = {0xFFFF, (WORD)ClassName.m_lpstr};\r
-                       AddData(wData, sizeof(wData));\r
-               }\r
-               else\r
-               {\r
-                       AddString(ClassName.m_lpstr);\r
-               }\r
-\r
-               if (Text.m_lpstr == NULL)\r
-               {\r
-                       WORD classData = 0;\r
-                       AddData(&classData, sizeof(WORD));\r
-               }\r
-               else if (IS_INTRESOURCE(Text.m_lpstr))\r
-               {\r
-                       WORD wData[] = {0xFFFF, (WORD)Text.m_lpstr};\r
-                       AddData(wData, sizeof(wData));\r
-               }\r
-               else\r
-               {\r
-                       AddString(Text.m_lpstr);\r
-               }\r
-\r
-               AddData(&nCreationData, sizeof(nCreationData));\r
-\r
-               if ((nCreationData != 0))\r
-               {\r
-                       ATLASSERT(pCreationData != NULL);\r
-                       AddData(pCreationData, nCreationData * sizeof(WORD));\r
-               }\r
-       }\r
-\r
-       void AddStdControl(StdCtrlType CtrlType, WORD wId, short nX, short nY, short nWidth, short nHeight,\r
-                          DWORD dwStyle, DWORD dwExStyle, ATL::_U_STRINGorID Text, const WORD* pCreationData = NULL, WORD nCreationData = 0, DWORD dwHelpID = 0)\r
-       {\r
-               AddControl(CtrlType, wId, nX, nY, nWidth, nHeight, dwStyle, dwExStyle, Text, pCreationData, nCreationData, dwHelpID);\r
-       }\r
-\r
-protected:\r
-       void AddData(LPCVOID pData, size_t nData)\r
-       {\r
-               ATLASSERT(pData != NULL);\r
-\r
-               const size_t ALLOCATION_INCREMENT = 1024;\r
-\r
-               if (m_pData == NULL)\r
-               {\r
-                       m_cAllocated = ((nData / ALLOCATION_INCREMENT) + 1) * ALLOCATION_INCREMENT;\r
-                       m_pPtr = m_pData = static_cast<LPBYTE>(::GlobalAlloc(GPTR, m_cAllocated));\r
-                       ATLASSERT(m_pData != NULL);\r
-               }\r
-               else if (((m_pPtr - m_pData) + nData) > m_cAllocated)\r
-               {\r
-                       size_t ptrPos = (m_pPtr - m_pData);\r
-                       m_cAllocated += ((nData / ALLOCATION_INCREMENT) + 1) * ALLOCATION_INCREMENT;\r
-                       m_pData = static_cast<LPBYTE>(::GlobalReAlloc(m_pData, m_cAllocated, 0));\r
-                       ATLASSERT(m_pData != NULL);\r
-                       m_pPtr = m_pData + ptrPos;\r
-               }\r
-\r
-               SecureHelper::memcpy_x(m_pPtr, m_cAllocated - (m_pPtr - m_pData), pData, nData);\r
-\r
-               m_pPtr += nData;\r
-       }\r
-\r
-       void AddString(LPCTSTR lpszStr)\r
-       {\r
-               if (lpszStr == NULL)\r
-               {\r
-                       WCHAR szEmpty = 0;\r
-                       AddData(&szEmpty, sizeof(szEmpty));\r
-               }\r
-               else\r
-               {\r
-                       USES_CONVERSION;\r
-                       LPCWSTR lpstr = T2CW(lpszStr);\r
-                       int nSize = lstrlenW(lpstr) + 1;\r
-                       AddData(lpstr, nSize * sizeof(WCHAR));\r
-               }\r
-       }\r
-\r
-       LPBYTE m_pData;\r
-       LPBYTE m_pPtr;\r
-       SIZE_T m_cAllocated;\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Dialog and control macros for indirect dialogs\r
-\r
-// for DLGTEMPLATE\r
-#define BEGIN_DIALOG(x, y, width, height) \\r
-       void DoInitTemplate() \\r
-       { \\r
-               bool bExTemplate = false; \\r
-               short nX = x, nY = y, nWidth = width, nHeight = height; \\r
-               LPCTSTR szCaption = NULL; \\r
-               DWORD dwStyle = WS_POPUP | WS_BORDER | WS_SYSMENU; \\r
-               DWORD dwExStyle = 0; \\r
-               LPCTSTR szFontName = NULL; \\r
-               WORD wFontSize = 0; \\r
-               WORD wWeight = 0; \\r
-               BYTE bItalic = 0; \\r
-               BYTE bCharset = 0; \\r
-               DWORD dwHelpID = 0; \\r
-               ATL::_U_STRINGorID Menu = 0U; \\r
-               ATL::_U_STRINGorID ClassName = 0U;\r
-\r
-// for DLGTEMPLATEEX\r
-#define BEGIN_DIALOG_EX(x, y, width, height, helpID) \\r
-       void DoInitTemplate() \\r
-       { \\r
-               bool bExTemplate = true; \\r
-               short nX = x, nY = y, nWidth = width, nHeight = height; \\r
-               LPCTSTR szCaption = NULL; \\r
-               DWORD dwStyle = WS_POPUP | WS_BORDER | WS_SYSMENU; \\r
-               DWORD dwExStyle = 0; \\r
-               LPCTSTR szFontName = NULL; \\r
-               WORD wFontSize = 0; \\r
-               WORD wWeight = 0; \\r
-               BYTE bItalic = 0; \\r
-               BYTE bCharset = 0; \\r
-               DWORD dwHelpID = helpID; \\r
-               ATL::_U_STRINGorID Menu = 0U; \\r
-               ATL::_U_STRINGorID ClassName = 0U;\r
-\r
-#define END_DIALOG() \\r
-               m_Template.Create(bExTemplate, szCaption, nX, nY, nWidth, nHeight, dwStyle, dwExStyle, szFontName, wFontSize, wWeight, bItalic, bCharset, dwHelpID, ClassName, Menu); \\r
-       };\r
-\r
-#define DIALOG_CAPTION(caption) \\r
-               szCaption = caption;\r
-#define DIALOG_STYLE(style) \\r
-               dwStyle = style;\r
-#define DIALOG_EXSTYLE(exStyle) \\r
-               dwExStyle = exStyle;\r
-#define DIALOG_FONT(pointSize, typeFace) \\r
-               wFontSize = pointSize; \\r
-               szFontName = typeFace;\r
-#define DIALOG_FONT_EX(pointsize, typeface, weight, italic, charset) \\r
-               ATLASSERT(bExTemplate); \\r
-               wFontSize = pointsize; \\r
-               szFontName = typeface; \\r
-               wWeight = weight; \\r
-               bItalic = italic; \\r
-               bCharset = charset;\r
-#define DIALOG_MENU(menuName) \\r
-               Menu = menuName;\r
-#define DIALOG_CLASS(className) \\r
-               ClassName = className;\r
-\r
-#define BEGIN_CONTROLS_MAP() \\r
-       void DoInitControls() \\r
-       {\r
-\r
-#define END_CONTROLS_MAP() \\r
-       };\r
-\r
-\r
-#define CONTROL_LTEXT(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_LEFT | WS_GROUP, exStyle, text, NULL, 0);\r
-#define CONTROL_CTEXT(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_CENTER | WS_GROUP, exStyle, text, NULL, 0);\r
-#define CONTROL_RTEXT(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_RIGHT | WS_GROUP, exStyle, text, NULL, 0);\r
-#define CONTROL_PUSHBUTTON(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_PUSHBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_DEFPUSHBUTTON(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_DEFPUSHBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#ifndef _WIN32_WCE\r
-#define CONTROL_PUSHBOX(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_PUSHBOX | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#endif // !_WIN32_WCE\r
-#define CONTROL_STATE3(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_3STATE | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_AUTO3STATE(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_AUTO3STATE | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_CHECKBOX(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_CHECKBOX | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_AUTOCHECKBOX(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_AUTOCHECKBOX | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_RADIOBUTTON(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_RADIOBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_AUTORADIOBUTTON(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_AUTORADIOBUTTON | WS_TABSTOP, exStyle, text, NULL, 0);\r
-#define CONTROL_COMBOBOX(id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_COMBOBOX, (WORD)id, x, y, width, height, style | CBS_DROPDOWN | WS_TABSTOP, exStyle, (LPCTSTR)NULL, NULL, 0);\r
-#define CONTROL_EDITTEXT(id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_EDIT, (WORD)id, x, y, width, height, style | ES_LEFT | WS_BORDER | WS_TABSTOP, exStyle, (LPCTSTR)NULL, NULL, 0);\r
-#define CONTROL_GROUPBOX(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_BUTTON, (WORD)id, x, y, width, height, style | BS_GROUPBOX, exStyle, text, NULL, 0);\r
-#define CONTROL_LISTBOX(id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_LISTBOX, (WORD)id, x, y, width, height, style | LBS_NOTIFY | WS_BORDER, exStyle, (LPCTSTR)NULL, NULL, 0);\r
-#define CONTROL_SCROLLBAR(id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_SCROLLBAR, (WORD)id, x, y, width, height, style | SBS_HORZ, exStyle, (LPCTSTR)NULL, NULL, 0);\r
-#define CONTROL_ICON(text, id, x, y, width, height, style, exStyle) \\r
-       m_Template.AddStdControl(WTL::CMemDlgTemplate::CTRL_STATIC, (WORD)id, x, y, width, height, style | SS_ICON, exStyle, text, NULL, 0);\r
-#define CONTROL_CONTROL(text, id, className, style, x, y, width, height, exStyle) \\r
-       m_Template.AddControl(className, (WORD)id, x, y, width, height, style, exStyle, text, NULL, 0);\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CIndirectDialogImpl - dialogs with template in memory\r
-\r
-template <class T, class TDlgTemplate = CMemDlgTemplate, class TBase = ATL::CDialogImpl<T, ATL::CWindow> >\r
-class ATL_NO_VTABLE CIndirectDialogImpl : public TBase\r
-{\r
-public:\r
-       enum { IDD = 0 };   // no dialog template resource\r
-\r
-       TDlgTemplate m_Template;\r
-\r
-       void CreateTemplate()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->DoInitTemplate();\r
-               pT->DoInitControls();\r
-       }\r
-\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow(), LPARAM dwInitParam = NULL)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_hWnd == NULL);\r
-\r
-               if (!m_Template.IsValid())\r
-                       CreateTemplate();\r
-\r
-#if (_ATL_VER >= 0x0800)\r
-               // Allocate the thunk structure here, where we can fail gracefully.\r
-               BOOL result = m_thunk.Init(NULL, NULL);\r
-               if (result == FALSE)\r
-               {\r
-                       SetLastError(ERROR_OUTOFMEMORY);\r
-                       return -1;\r
-               }\r
-#endif // (_ATL_VER >= 0x0800)\r
-\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, pT);\r
-\r
-#ifdef _DEBUG\r
-               m_bModal = true;\r
-#endif // _DEBUG\r
-\r
-               return ::DialogBoxIndirectParam(ModuleHelper::GetResourceInstance(), m_Template.GetTemplatePtr(), hWndParent, (DLGPROC)T::StartDialogProc, dwInitParam);\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, LPARAM dwInitParam = NULL)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->m_hWnd == NULL);\r
-\r
-               if (!m_Template.IsValid())\r
-                       CreateTemplate();\r
-\r
-#if (_ATL_VER >= 0x0800)\r
-               // Allocate the thunk structure here, where we can fail gracefully.\r
-               BOOL result = m_thunk.Init(NULL, NULL);\r
-               if (result == FALSE) \r
-               {\r
-                       SetLastError(ERROR_OUTOFMEMORY);\r
-                       return NULL;\r
-               }\r
-#endif // (_ATL_VER >= 0x0800)\r
-\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, pT);\r
-\r
-#ifdef _DEBUG\r
-               m_bModal = false;\r
-#endif // _DEBUG\r
-\r
-               HWND hWnd = ::CreateDialogIndirectParam(ModuleHelper::GetResourceInstance(), (LPCDLGTEMPLATE)m_Template.GetTemplatePtr(), hWndParent, (DLGPROC)T::StartDialogProc, dwInitParam);\r
-               ATLASSERT(m_hWnd == hWnd);\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       // for CComControl\r
-       HWND Create(HWND hWndParent, RECT&, LPARAM dwInitParam = NULL)\r
-       {\r
-               return Create(hWndParent, dwInitParam);\r
-       }\r
-\r
-       void DoInitTemplate() \r
-       {\r
-               ATLASSERT(FALSE);   // MUST be defined in derived class\r
-       }\r
-\r
-       void DoInitControls() \r
-       {\r
-               ATLASSERT(FALSE);   // MUST be defined in derived class\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPropertySheetWindow - client side for a property sheet\r
-\r
-class CPropertySheetWindow : public ATL::CWindow\r
-{\r
-public:\r
-// Constructors\r
-       CPropertySheetWindow(HWND hWnd = NULL) : ATL::CWindow(hWnd)\r
-       { }\r
-\r
-       CPropertySheetWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       int GetPageCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HWND hWndTabCtrl = GetTabControl();\r
-               ATLASSERT(hWndTabCtrl != NULL);\r
-               return (int)::SendMessage(hWndTabCtrl, TCM_GETITEMCOUNT, 0, 0L);\r
-       }\r
-\r
-       HWND GetActivePage() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HWND)::SendMessage(m_hWnd, PSM_GETCURRENTPAGEHWND, 0, 0L);\r
-       }\r
-\r
-       int GetActiveIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               HWND hWndTabCtrl = GetTabControl();\r
-               ATLASSERT(hWndTabCtrl != NULL);\r
-               return (int)::SendMessage(hWndTabCtrl, TCM_GETCURSEL, 0, 0L);\r
-       }\r
-\r
-       BOOL SetActivePage(int nPageIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_SETCURSEL, nPageIndex, 0L);\r
-       }\r
-\r
-       BOOL SetActivePage(HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hPage != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_SETCURSEL, 0, (LPARAM)hPage);\r
-       }\r
-\r
-       BOOL SetActivePageByID(int nPageID)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_SETCURSELID, 0, nPageID);\r
-       }\r
-\r
-       void SetTitle(LPCTSTR lpszText, UINT nStyle = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT((nStyle & ~PSH_PROPTITLE) == 0); // only PSH_PROPTITLE is valid\r
-               ATLASSERT(lpszText != NULL);\r
-               ::SendMessage(m_hWnd, PSM_SETTITLE, nStyle, (LPARAM)lpszText);\r
-       }\r
-\r
-       HWND GetTabControl() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HWND)::SendMessage(m_hWnd, PSM_GETTABCONTROL, 0, 0L);\r
-       }\r
-\r
-       void SetFinishText(LPCTSTR lpszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText);\r
-       }\r
-\r
-       void SetWizardButtons(DWORD dwFlags)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::PostMessage(m_hWnd, PSM_SETWIZBUTTONS, 0, dwFlags);\r
-       }\r
-\r
-// Operations\r
-       BOOL AddPage(HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hPage != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_ADDPAGE, 0, (LPARAM)hPage);\r
-       }\r
-\r
-       BOOL AddPage(LPCPROPSHEETPAGE pPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pPage != NULL);\r
-               HPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\r
-               if(hPage == NULL)\r
-                       return FALSE;\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_ADDPAGE, 0, (LPARAM)hPage);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL InsertPage(int nNewPageIndex, HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hPage != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, nNewPageIndex, (LPARAM)hPage);\r
-       }\r
-\r
-       BOOL InsertPage(int nNewPageIndex, LPCPROPSHEETPAGE pPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pPage != NULL);\r
-               HPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\r
-               if(hPage == NULL)\r
-                       return FALSE;\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, nNewPageIndex, (LPARAM)hPage);\r
-       }\r
-\r
-       BOOL InsertPage(HPROPSHEETPAGE hPageInsertAfter, HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hPage != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, (WPARAM)hPageInsertAfter, (LPARAM)hPage);\r
-       }\r
-\r
-       BOOL InsertPage(HPROPSHEETPAGE hPageInsertAfter, LPCPROPSHEETPAGE pPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pPage != NULL);\r
-               HPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\r
-               if(hPage == NULL)\r
-                       return FALSE;\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_INSERTPAGE, (WPARAM)hPageInsertAfter, (LPARAM)hPage);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void RemovePage(int nPageIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_REMOVEPAGE, nPageIndex, 0L);\r
-       }\r
-\r
-       void RemovePage(HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(hPage != NULL);\r
-               ::SendMessage(m_hWnd, PSM_REMOVEPAGE, 0, (LPARAM)hPage);\r
-       }\r
-\r
-       BOOL PressButton(int nButton)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_PRESSBUTTON, nButton, 0L);\r
-       }\r
-\r
-       BOOL Apply()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_APPLY, 0, 0L);\r
-       }\r
-\r
-       void CancelToClose()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_CANCELTOCLOSE, 0, 0L);\r
-       }\r
-\r
-       void SetModified(HWND hWndPage, BOOL bChanged = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(::IsWindow(hWndPage));\r
-               UINT uMsg = bChanged ? PSM_CHANGED : PSM_UNCHANGED;\r
-               ::SendMessage(m_hWnd, uMsg, (WPARAM)hWndPage, 0L);\r
-       }\r
-\r
-       LRESULT QuerySiblings(WPARAM wParam, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return ::SendMessage(m_hWnd, PSM_QUERYSIBLINGS, wParam, lParam);\r
-       }\r
-\r
-       void RebootSystem()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_REBOOTSYSTEM, 0, 0L);\r
-       }\r
-\r
-       void RestartWindows()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_RESTARTWINDOWS, 0, 0L);\r
-       }\r
-\r
-       BOOL IsDialogMessage(LPMSG lpMsg)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_ISDIALOGMESSAGE, 0, (LPARAM)lpMsg);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       int HwndToIndex(HWND hWnd) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PSM_HWNDTOINDEX, (WPARAM)hWnd, 0L);\r
-       }\r
-\r
-       HWND IndexToHwnd(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HWND)::SendMessage(m_hWnd, PSM_INDEXTOHWND, nIndex, 0L);\r
-       }\r
-\r
-       int PageToIndex(HPROPSHEETPAGE hPage) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PSM_PAGETOINDEX, 0, (LPARAM)hPage);\r
-       }\r
-\r
-       HPROPSHEETPAGE IndexToPage(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HPROPSHEETPAGE)::SendMessage(m_hWnd, PSM_INDEXTOPAGE, nIndex, 0L);\r
-       }\r
-\r
-       int IdToIndex(int nID) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PSM_IDTOINDEX, 0, nID);\r
-       }\r
-\r
-       int IndexToId(int nIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PSM_INDEXTOID, nIndex, 0L);\r
-       }\r
-\r
-       int GetResult() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, PSM_GETRESULT, 0, 0L);\r
-       }\r
-\r
-       BOOL RecalcPageSizes()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, PSM_RECALCPAGESIZES, 0, 0L);\r
-       }\r
-\r
-       void SetHeaderTitle(int nIndex, LPCTSTR lpstrHeaderTitle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_SETHEADERTITLE, nIndex, (LPARAM)lpstrHeaderTitle);\r
-       }\r
-\r
-       void SetHeaderSubTitle(int nIndex, LPCTSTR lpstrHeaderSubTitle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_SETHEADERSUBTITLE, nIndex, (LPARAM)lpstrHeaderSubTitle);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-// Implementation - override to prevent usage\r
-       HWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\r
-       {\r
-               ATLASSERT(FALSE);\r
-               return NULL;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPropertySheetImpl - implements a property sheet\r
-\r
-template <class T, class TBase = CPropertySheetWindow>\r
-class ATL_NO_VTABLE CPropertySheetImpl : public ATL::CWindowImplBaseT< TBase >\r
-{\r
-public:\r
-       PROPSHEETHEADER m_psh;\r
-       ATL::CSimpleArray<HPROPSHEETPAGE> m_arrPages;\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC specific\r
-  #ifndef PROPSHEET_LINK_SIZE\r
-       #define PROPSHEET_LINK_SIZE 128\r
-  #endif // PROPSHEET_LINK_SIZE\r
-       TCHAR m_szLink[PROPSHEET_LINK_SIZE];\r
-       static LPCTSTR m_pszTitle;\r
-       static LPCTSTR m_pszLink;\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) \r
-\r
-// Construction/Destruction\r
-       CPropertySheetImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL)\r
-       {\r
-               memset(&m_psh, 0, sizeof(PROPSHEETHEADER));\r
-               m_psh.dwSize = sizeof(PROPSHEETHEADER);\r
-               m_psh.dwFlags = PSH_USECALLBACK;\r
-               m_psh.hInstance = ModuleHelper::GetResourceInstance();\r
-               m_psh.phpage = NULL;   // will be set later\r
-               m_psh.nPages = 0;      // will be set later\r
-               m_psh.pszCaption = title.m_lpstr;\r
-               m_psh.nStartPage = uStartPage;\r
-               m_psh.hwndParent = hWndParent;   // if NULL, will be set in DoModal/Create\r
-               m_psh.pfnCallback = T::PropSheetCallback;\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC specific \r
-               m_psh.dwFlags |= PSH_MAXIMIZE;\r
-               m_szLink[0] = 0;\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__)\r
-       }\r
-\r
-       ~CPropertySheetImpl()\r
-       {\r
-               if(m_arrPages.GetSize() > 0)   // sheet never created, destroy all pages\r
-               {\r
-                       for(int i = 0; i < m_arrPages.GetSize(); i++)\r
-                               ::DestroyPropertySheetPage((HPROPSHEETPAGE)m_arrPages[i]);\r
-               }\r
-       }\r
-\r
-// Callback function and overrideables\r
-       static int CALLBACK PropSheetCallback(HWND hWnd, UINT uMsg, LPARAM lParam)\r
-       {\r
-               lParam;   // avoid level 4 warning\r
-               int nRet = 0;\r
-\r
-               if(uMsg == PSCB_INITIALIZED)\r
-               {\r
-                       ATLASSERT(hWnd != NULL);\r
-                       T* pT = (T*)ModuleHelper::ExtractCreateWndData();\r
-                       // subclass the sheet window\r
-                       pT->SubclassWindow(hWnd);\r
-                       // remove page handles array\r
-                       pT->_CleanUpPages();\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC specific\r
-                       m_pszTitle = pT->m_psh.pszCaption;\r
-                       if(*pT->m_szLink != 0)\r
-                               m_pszLink = pT->m_szLink;\r
-#endif  // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC specific\r
-\r
-                       pT->OnSheetInitialized();\r
-               }\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC specific uMsg\r
-               else\r
-               {\r
-                       switch(uMsg)\r
-                       {\r
-                       case PSCB_GETVERSION :\r
-                               nRet = COMCTL32_VERSION;\r
-                               break;\r
-                       case PSCB_GETTITLE :\r
-                               if(m_pszTitle != NULL)\r
-                               {\r
-                                       lstrcpy((LPTSTR)lParam, m_pszTitle);\r
-                                       m_pszTitle = NULL;\r
-                               }\r
-                               break;\r
-                       case PSCB_GETLINKTEXT:\r
-                               if(m_pszLink != NULL)\r
-                               {\r
-                                       lstrcpy((LPTSTR)lParam, m_pszLink);\r
-                                       m_pszLink = NULL;\r
-                               }\r
-                               break;\r
-                       default:\r
-                               break;\r
-                       }\r
-               }\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) \r
-\r
-               return nRet;\r
-       }\r
-\r
-       void OnSheetInitialized()\r
-       {\r
-       }\r
-\r
-// Create method\r
-       HWND Create(HWND hWndParent = NULL)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);\r
-\r
-               m_psh.dwFlags |= PSH_MODELESS;\r
-               if(m_psh.hwndParent == NULL)\r
-                       m_psh.hwndParent = hWndParent;\r
-               m_psh.phpage = (HPROPSHEETPAGE*)m_arrPages.GetData();\r
-               m_psh.nPages = m_arrPages.GetSize();\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ModuleHelper::AddCreateWndData(&pT->m_thunk.cd, pT);\r
-\r
-               HWND hWnd = (HWND)::PropertySheet(&m_psh);\r
-               _CleanUpPages();   // ensure clean-up, required if call failed\r
-\r
-               ATLASSERT(m_hWnd == hWnd);\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow())\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);\r
-\r
-               m_psh.dwFlags &= ~PSH_MODELESS;\r
-               if(m_psh.hwndParent == NULL)\r
-                       m_psh.hwndParent = hWndParent;\r
-               m_psh.phpage = (HPROPSHEETPAGE*)m_arrPages.GetData();\r
-               m_psh.nPages = m_arrPages.GetSize();\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ModuleHelper::AddCreateWndData(&pT->m_thunk.cd, pT);\r
-\r
-               INT_PTR nRet = ::PropertySheet(&m_psh);\r
-               _CleanUpPages();   // ensure clean-up, required if call failed\r
-\r
-               return nRet;\r
-       }\r
-\r
-       // implementation helper - clean up pages array\r
-       void _CleanUpPages()\r
-       {\r
-               m_psh.nPages = 0;\r
-               m_psh.phpage = NULL;\r
-               m_arrPages.RemoveAll();\r
-       }\r
-\r
-// Attributes (extended overrides of client class methods)\r
-// These now can be called before the sheet is created\r
-// Note: Calling these after the sheet is created gives unpredictable results\r
-       int GetPageCount() const\r
-       {\r
-               if(m_hWnd == NULL)   // not created yet\r
-                       return m_arrPages.GetSize();\r
-               return TBase::GetPageCount();\r
-       }\r
-\r
-       int GetActiveIndex() const\r
-       {\r
-               if(m_hWnd == NULL)   // not created yet\r
-                       return m_psh.nStartPage;\r
-               return TBase::GetActiveIndex();\r
-       }\r
-\r
-       HPROPSHEETPAGE GetPage(int nPageIndex) const\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               return (HPROPSHEETPAGE)m_arrPages[nPageIndex];\r
-       }\r
-\r
-       int GetPageIndex(HPROPSHEETPAGE hPage) const\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               return m_arrPages.Find((HPROPSHEETPAGE&)hPage);\r
-       }\r
-\r
-       BOOL SetActivePage(int nPageIndex)\r
-       {\r
-               if(m_hWnd == NULL)   // not created yet\r
-               {\r
-                       ATLASSERT(nPageIndex >= 0 && nPageIndex < m_arrPages.GetSize());\r
-                       m_psh.nStartPage = nPageIndex;\r
-                       return TRUE;\r
-               }\r
-               return TBase::SetActivePage(nPageIndex);\r
-       }\r
-\r
-       BOOL SetActivePage(HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(hPage != NULL);\r
-               if (m_hWnd == NULL)   // not created yet\r
-               {\r
-                       int nPageIndex = GetPageIndex(hPage);\r
-                       if(nPageIndex == -1)\r
-                               return FALSE;\r
-\r
-                       return SetActivePage(nPageIndex);\r
-               }\r
-               return TBase::SetActivePage(hPage);\r
-\r
-       }\r
-\r
-       void SetTitle(LPCTSTR lpszText, UINT nStyle = 0)\r
-       {\r
-               ATLASSERT((nStyle & ~PSH_PROPTITLE) == 0);   // only PSH_PROPTITLE is valid\r
-               ATLASSERT(lpszText != NULL);\r
-\r
-               if(m_hWnd == NULL)\r
-               {\r
-                       // set internal state\r
-                       m_psh.pszCaption = lpszText;   // must exist until sheet is created\r
-                       m_psh.dwFlags &= ~PSH_PROPTITLE;\r
-                       m_psh.dwFlags |= nStyle;\r
-               }\r
-               else\r
-               {\r
-                       // set external state\r
-                       TBase::SetTitle(lpszText, nStyle);\r
-               }\r
-       }\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC specific Link field        \r
-       void SetLinkText(LPCTSTR lpszText)\r
-       {\r
-               ATLASSERT(lpszText != NULL);\r
-               ATLASSERT(lstrlen(lpszText) < PROPSHEET_LINK_SIZE);\r
-               lstrcpy(m_szLink, lpszText);\r
-       }\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) \r
-\r
-       void SetWizardMode()\r
-       {\r
-               m_psh.dwFlags |= PSH_WIZARD;\r
-       }\r
-\r
-       void EnableHelp()\r
-       {\r
-               m_psh.dwFlags |= PSH_HASHELP;\r
-       }\r
-\r
-// Operations\r
-       BOOL AddPage(HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(hPage != NULL);\r
-               BOOL bRet = FALSE;\r
-               if(m_hWnd != NULL)\r
-                       bRet = TBase::AddPage(hPage);\r
-               else    // sheet not created yet, use internal data\r
-                       bRet = m_arrPages.Add((HPROPSHEETPAGE&)hPage);\r
-               return bRet;\r
-       }\r
-\r
-       BOOL AddPage(LPCPROPSHEETPAGE pPage)\r
-       {\r
-               ATLASSERT(pPage != NULL);\r
-               HPROPSHEETPAGE hPage = ::CreatePropertySheetPage(pPage);\r
-               if(hPage == NULL)\r
-                       return FALSE;\r
-               BOOL bRet = AddPage(hPage);\r
-               if(!bRet)\r
-                       ::DestroyPropertySheetPage(hPage);\r
-               return bRet;\r
-       }\r
-\r
-       BOOL RemovePage(HPROPSHEETPAGE hPage)\r
-       {\r
-               ATLASSERT(hPage != NULL);\r
-               if (m_hWnd == NULL)   // not created yet\r
-               {\r
-                       int nPage = GetPageIndex(hPage);\r
-                       if(nPage == -1)\r
-                               return FALSE;\r
-                       return RemovePage(nPage);\r
-               }\r
-               TBase::RemovePage(hPage);\r
-               return TRUE;\r
-\r
-       }\r
-\r
-       BOOL RemovePage(int nPageIndex)\r
-       {\r
-               BOOL bRet = TRUE;\r
-               if(m_hWnd != NULL)\r
-                       TBase::RemovePage(nPageIndex);\r
-               else    // sheet not created yet, use internal data\r
-                       bRet = m_arrPages.RemoveAt(nPageIndex);\r
-               return bRet;\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-       void SetHeader(LPCTSTR szbmHeader)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-\r
-               m_psh.dwFlags &= ~PSH_WIZARD;\r
-               m_psh.dwFlags |= (PSH_HEADER | PSH_WIZARD97);\r
-               m_psh.pszbmHeader = szbmHeader;\r
-       }\r
-\r
-       void SetHeader(HBITMAP hbmHeader)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-\r
-               m_psh.dwFlags &= ~PSH_WIZARD;\r
-               m_psh.dwFlags |= (PSH_HEADER | PSH_USEHBMHEADER | PSH_WIZARD97);\r
-               m_psh.hbmHeader = hbmHeader;\r
-       }\r
-\r
-       void SetWatermark(LPCTSTR szbmWatermark, HPALETTE hplWatermark = NULL)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-\r
-               m_psh.dwFlags &= ~PSH_WIZARD;\r
-               m_psh.dwFlags |= PSH_WATERMARK | PSH_WIZARD97;\r
-               m_psh.pszbmWatermark = szbmWatermark;\r
-\r
-               if (hplWatermark != NULL)\r
-               {\r
-                       m_psh.dwFlags |= PSH_USEHPLWATERMARK;\r
-                       m_psh.hplWatermark = hplWatermark;\r
-               }\r
-       }\r
-\r
-       void SetWatermark(HBITMAP hbmWatermark, HPALETTE hplWatermark = NULL)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-\r
-               m_psh.dwFlags &= ~PSH_WIZARD;\r
-               m_psh.dwFlags |= (PSH_WATERMARK | PSH_USEHBMWATERMARK | PSH_WIZARD97);\r
-               m_psh.hbmWatermark = hbmWatermark;\r
-\r
-               if (hplWatermark != NULL)\r
-               {\r
-                       m_psh.dwFlags |= PSH_USEHPLWATERMARK;\r
-                       m_psh.hplWatermark = hplWatermark;\r
-               }\r
-       }\r
-\r
-       void StretchWatermark(bool bStretchWatermark)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               if (bStretchWatermark)\r
-                       m_psh.dwFlags |= PSH_STRETCHWATERMARK;\r
-               else\r
-                       m_psh.dwFlags &= ~PSH_STRETCHWATERMARK;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CPropertySheetImpl)\r
-               MESSAGE_HANDLER(WM_COMMAND, OnCommand)\r
-               MESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);\r
-               if(HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) &&\r
-                  ((m_psh.dwFlags & PSH_MODELESS) != 0) && (GetActivePage() == NULL))\r
-                       DestroyWindow();\r
-               return lRet;\r
-       }\r
-\r
-       LRESULT OnSysCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(((m_psh.dwFlags & PSH_MODELESS) == PSH_MODELESS) && ((wParam & 0xFFF0) == SC_CLOSE))\r
-                       SendMessage(WM_CLOSE);\r
-               else\r
-                       bHandled = FALSE;\r
-               return 0;\r
-       }\r
-};\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__) // PPC static pointers\r
-template < class T, class TBase >\r
-LPCWSTR CPropertySheetImpl<T,TBase>::m_pszTitle = NULL;\r
-template < class T, class TBase>\r
-LPCWSTR CPropertySheetImpl<T,TBase>::m_pszLink = NULL;\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__)\r
-\r
-// for non-customized sheets\r
-class CPropertySheet : public CPropertySheetImpl<CPropertySheet>\r
-{\r
-public:\r
-       CPropertySheet(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL)\r
-               : CPropertySheetImpl<CPropertySheet>(title, uStartPage, hWndParent)\r
-       { }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPropertyPageWindow - client side for a property page\r
-\r
-class CPropertyPageWindow : public ATL::CWindow\r
-{\r
-public:\r
-// Constructors\r
-       CPropertyPageWindow(HWND hWnd = NULL) : ATL::CWindow(hWnd)\r
-       { }\r
-\r
-       CPropertyPageWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       CPropertySheetWindow GetPropertySheet() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CPropertySheetWindow(GetParent());\r
-       }\r
-\r
-// Operations\r
-       BOOL Apply()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               return GetPropertySheet().Apply();\r
-       }\r
-\r
-       void CancelToClose()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetPropertySheet().CancelToClose();\r
-       }\r
-\r
-       void SetModified(BOOL bChanged = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetPropertySheet().SetModified(m_hWnd, bChanged);\r
-       }\r
-\r
-       LRESULT QuerySiblings(WPARAM wParam, LPARAM lParam)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               return GetPropertySheet().QuerySiblings(wParam, lParam);\r
-       }\r
-\r
-       void RebootSystem()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetPropertySheet().RebootSystem();\r
-       }\r
-\r
-       void RestartWindows()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetPropertySheet().RestartWindows();\r
-       }\r
-\r
-       void SetWizardButtons(DWORD dwFlags)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetPropertySheet().SetWizardButtons(dwFlags);\r
-       }\r
-\r
-// Implementation - overrides to prevent usage\r
-       HWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\r
-       {\r
-               ATLASSERT(FALSE);\r
-               return NULL;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPropertyPageImpl - implements a property page\r
-\r
-template <class T, class TBase = CPropertyPageWindow>\r
-class ATL_NO_VTABLE CPropertyPageImpl : public ATL::CDialogImplBaseT< TBase >\r
-{\r
-public:\r
-       PROPSHEETPAGE m_psp;\r
-\r
-       operator PROPSHEETPAGE*() { return &m_psp; }\r
-\r
-// Construction\r
-       CPropertyPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL)\r
-       {\r
-               // initialize PROPSHEETPAGE struct\r
-               memset(&m_psp, 0, sizeof(PROPSHEETPAGE));\r
-               m_psp.dwSize = sizeof(PROPSHEETPAGE);\r
-               m_psp.dwFlags = PSP_USECALLBACK;\r
-               m_psp.hInstance = ModuleHelper::GetResourceInstance();\r
-               T* pT = static_cast<T*>(this);\r
-               m_psp.pszTemplate = MAKEINTRESOURCE(pT->IDD);\r
-               m_psp.pfnDlgProc = (DLGPROC)T::StartDialogProc;\r
-               m_psp.pfnCallback = T::PropPageCallback;\r
-               m_psp.lParam = (LPARAM)pT;\r
-\r
-               if(title.m_lpstr != NULL)\r
-                       SetTitle(title);\r
-       }\r
-\r
-// Callback function and overrideables\r
-       static UINT CALLBACK PropPageCallback(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)\r
-       {\r
-               hWnd;   // avoid level 4 warning\r
-               ATLASSERT(hWnd == NULL);\r
-               T* pT = (T*)ppsp->lParam;\r
-               UINT uRet = 0;\r
-\r
-               switch(uMsg)\r
-               {\r
-               case PSPCB_CREATE:\r
-                       {\r
-                               ATL::CDialogImplBaseT< TBase >* pPage = (ATL::CDialogImplBaseT< TBase >*)pT;\r
-                               ModuleHelper::AddCreateWndData(&pPage->m_thunk.cd, pPage);\r
-                               uRet = pT->OnPageCreate() ? 1 : 0;\r
-                       }\r
-                       break;\r
-#if (_WIN32_IE >= 0x0500)\r
-               case PSPCB_ADDREF:\r
-                       pT->OnPageAddRef();\r
-                       break;\r
-#endif // (_WIN32_IE >= 0x0500)\r
-               case PSPCB_RELEASE:\r
-                       pT->OnPageRelease();\r
-                       break;\r
-               default:\r
-                       break;\r
-               }\r
-\r
-               return uRet;\r
-       }\r
-\r
-       bool OnPageCreate()\r
-       {\r
-               return true;   // true - allow page to be created, false - prevent creation\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       void OnPageAddRef()\r
-       {\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-\r
-       void OnPageRelease()\r
-       {\r
-       }\r
-\r
-// Create method\r
-       HPROPSHEETPAGE Create()\r
-       {\r
-               return ::CreatePropertySheetPage(&m_psp);\r
-       }\r
-\r
-// Attributes\r
-       void SetTitle(ATL::_U_STRINGorID title)\r
-       {\r
-               m_psp.pszTitle = title.m_lpstr;\r
-               m_psp.dwFlags |= PSP_USETITLE;\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       void SetHeaderTitle(LPCTSTR lpstrHeaderTitle)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               m_psp.dwFlags |= PSP_USEHEADERTITLE;\r
-               m_psp.pszHeaderTitle = lpstrHeaderTitle;\r
-       }\r
-\r
-       void SetHeaderSubTitle(LPCTSTR lpstrHeaderSubTitle)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               m_psp.dwFlags |= PSP_USEHEADERSUBTITLE;\r
-               m_psp.pszHeaderSubTitle = lpstrHeaderSubTitle;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-// Operations\r
-       void EnableHelp()\r
-       {\r
-               m_psp.dwFlags |= PSP_HASHELP;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CPropertyPageImpl)\r
-               MESSAGE_HANDLER(WM_NOTIFY, OnNotify)\r
-       END_MSG_MAP()\r
-\r
-       // NOTE: Define _WTL_NEW_PAGE_NOTIFY_HANDLERS to use new notification\r
-       // handlers that return direct values without any restrictions\r
-       LRESULT OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               // This notification is sometimes received on Windows CE after the window is already destroyed\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#endif\r
-               NMHDR* pNMHDR = (NMHDR*)lParam;\r
-\r
-               // don't handle messages not from the page/sheet itself\r
-               if(pNMHDR->hwndFrom != m_hWnd && pNMHDR->hwndFrom != ::GetParent(m_hWnd))\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-#ifdef _WIN32_WCE\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-#endif\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               LRESULT lResult = 0;\r
-               switch(pNMHDR->code)\r
-               {\r
-#ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-               case PSN_SETACTIVE:\r
-                       lResult = pT->OnSetActive();\r
-                       break;\r
-               case PSN_KILLACTIVE:\r
-                       lResult = pT->OnKillActive();\r
-                       break;\r
-               case PSN_APPLY:\r
-                       lResult = pT->OnApply();\r
-                       break;\r
-               case PSN_RESET:\r
-                       pT->OnReset();\r
-                       break;\r
-               case PSN_QUERYCANCEL:\r
-                       lResult = pT->OnQueryCancel();\r
-                       break;\r
-               case PSN_WIZNEXT:\r
-                       lResult = pT->OnWizardNext();\r
-                       break;\r
-               case PSN_WIZBACK:\r
-                       lResult = pT->OnWizardBack();\r
-                       break;\r
-               case PSN_WIZFINISH:\r
-                       lResult = pT->OnWizardFinish();\r
-                       break;\r
-               case PSN_HELP:\r
-                       pT->OnHelp();\r
-                       break;\r
-#ifndef _WIN32_WCE\r
-#if (_WIN32_IE >= 0x0400)\r
-               case PSN_GETOBJECT:\r
-                       if(!pT->OnGetObject((LPNMOBJECTNOTIFY)lParam))\r
-                               bHandled = FALSE;\r
-                       break;\r
-#endif // (_WIN32_IE >= 0x0400)\r
-#if (_WIN32_IE >= 0x0500)\r
-               case PSN_TRANSLATEACCELERATOR:\r
-                       {\r
-                               LPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\r
-                               lResult = pT->OnTranslateAccelerator((LPMSG)lpPSHNotify->lParam);\r
-                       }\r
-                       break;\r
-               case PSN_QUERYINITIALFOCUS:\r
-                       {\r
-                               LPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\r
-                               lResult = (LRESULT)pT->OnQueryInitialFocus((HWND)lpPSHNotify->lParam);\r
-                       }\r
-                       break;\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_WIN32_WCE\r
-\r
-#else // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-               case PSN_SETACTIVE:\r
-                       lResult = pT->OnSetActive() ? 0 : -1;\r
-                       break;\r
-               case PSN_KILLACTIVE:\r
-                       lResult = !pT->OnKillActive();\r
-                       break;\r
-               case PSN_APPLY:\r
-                       lResult = pT->OnApply() ? PSNRET_NOERROR : PSNRET_INVALID_NOCHANGEPAGE;\r
-                       break;\r
-               case PSN_RESET:\r
-                       pT->OnReset();\r
-                       break;\r
-               case PSN_QUERYCANCEL:\r
-                       lResult = !pT->OnQueryCancel();\r
-                       break;\r
-               case PSN_WIZNEXT:\r
-                       lResult = pT->OnWizardNext();\r
-                       break;\r
-               case PSN_WIZBACK:\r
-                       lResult = pT->OnWizardBack();\r
-                       break;\r
-               case PSN_WIZFINISH:\r
-                       lResult = !pT->OnWizardFinish();\r
-                       break;\r
-               case PSN_HELP:\r
-                       pT->OnHelp();\r
-                       break;\r
-#ifndef _WIN32_WCE\r
-#if (_WIN32_IE >= 0x0400)\r
-               case PSN_GETOBJECT:\r
-                       if(!pT->OnGetObject((LPNMOBJECTNOTIFY)lParam))\r
-                               bHandled = FALSE;\r
-                       break;\r
-#endif // (_WIN32_IE >= 0x0400)\r
-#if (_WIN32_IE >= 0x0500)\r
-               case PSN_TRANSLATEACCELERATOR:\r
-                       {\r
-                               LPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\r
-                               lResult = pT->OnTranslateAccelerator((LPMSG)lpPSHNotify->lParam) ? PSNRET_MESSAGEHANDLED : PSNRET_NOERROR;\r
-                       }\r
-                       break;\r
-               case PSN_QUERYINITIALFOCUS:\r
-                       {\r
-                               LPPSHNOTIFY lpPSHNotify = (LPPSHNOTIFY)lParam;\r
-                               lResult = (LRESULT)pT->OnQueryInitialFocus((HWND)lpPSHNotify->lParam);\r
-                       }\r
-                       break;\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_WIN32_WCE\r
-\r
-#endif // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-               default:\r
-                       bHandled = FALSE;   // not handled\r
-               }\r
-\r
-               return lResult;\r
-       }\r
-\r
-// Overridables\r
-       // NOTE: Define _WTL_NEW_PAGE_NOTIFY_HANDLERS to use new notification\r
-       // handlers that return direct values without any restrictions\r
-#ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-       int OnSetActive()\r
-       {\r
-               // 0 = allow activate\r
-               // -1 = go back that was active\r
-               // page ID = jump to page\r
-               return 0;\r
-       }\r
-\r
-       BOOL OnKillActive()\r
-       {\r
-               // FALSE = allow deactivate\r
-               // TRUE = prevent deactivation\r
-               return FALSE;\r
-       }\r
-\r
-       int OnApply()\r
-       {\r
-               // PSNRET_NOERROR = apply OK\r
-               // PSNRET_INVALID = apply not OK, return to this page\r
-               // PSNRET_INVALID_NOCHANGEPAGE = apply not OK, don't change focus\r
-               return PSNRET_NOERROR;\r
-       }\r
-\r
-       void OnReset()\r
-       {\r
-       }\r
-\r
-       BOOL OnQueryCancel()\r
-       {\r
-               // FALSE = allow cancel\r
-               // TRUE = prevent cancel\r
-               return FALSE;\r
-       }\r
-\r
-       int OnWizardBack()\r
-       {\r
-               // 0  = goto previous page\r
-               // -1 = prevent page change\r
-               // >0 = jump to page by dlg ID\r
-               return 0;\r
-       }\r
-\r
-       int OnWizardNext()\r
-       {\r
-               // 0  = goto next page\r
-               // -1 = prevent page change\r
-               // >0 = jump to page by dlg ID\r
-               return 0;\r
-       }\r
-\r
-       INT_PTR OnWizardFinish()\r
-       {\r
-               // FALSE = allow finish\r
-               // TRUE = prevent finish\r
-               // HWND = prevent finish and set focus to HWND (CommCtrl 5.80 only)\r
-               return FALSE;\r
-       }\r
-\r
-       void OnHelp()\r
-       {\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-#if (_WIN32_IE >= 0x0400)\r
-       BOOL OnGetObject(LPNMOBJECTNOTIFY /*lpObjectNotify*/)\r
-       {\r
-               return FALSE;   // not processed\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       int OnTranslateAccelerator(LPMSG /*lpMsg*/)\r
-       {\r
-               // PSNRET_NOERROR - message not handled\r
-               // PSNRET_MESSAGEHANDLED - message handled\r
-               return PSNRET_NOERROR;\r
-       }\r
-\r
-       HWND OnQueryInitialFocus(HWND /*hWndFocus*/)\r
-       {\r
-               // NULL = set focus to default control\r
-               // HWND = set focus to HWND\r
-               return NULL;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_WIN32_WCE\r
-\r
-#else // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-       BOOL OnSetActive()\r
-       {\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL OnKillActive()\r
-       {\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL OnApply()\r
-       {\r
-               return TRUE;\r
-       }\r
-\r
-       void OnReset()\r
-       {\r
-       }\r
-\r
-       BOOL OnQueryCancel()\r
-       {\r
-               return TRUE;    // ok to cancel\r
-       }\r
-\r
-       int OnWizardBack()\r
-       {\r
-               // 0  = goto previous page\r
-               // -1 = prevent page change\r
-               // >0 = jump to page by dlg ID\r
-               return 0;\r
-       }\r
-\r
-       int OnWizardNext()\r
-       {\r
-               // 0  = goto next page\r
-               // -1 = prevent page change\r
-               // >0 = jump to page by dlg ID\r
-               return 0;\r
-       }\r
-\r
-       BOOL OnWizardFinish()\r
-       {\r
-               return TRUE;\r
-       }\r
-\r
-       void OnHelp()\r
-       {\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-#if (_WIN32_IE >= 0x0400)\r
-       BOOL OnGetObject(LPNMOBJECTNOTIFY /*lpObjectNotify*/)\r
-       {\r
-               return FALSE;   // not processed\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       BOOL OnTranslateAccelerator(LPMSG /*lpMsg*/)\r
-       {\r
-               return FALSE;   // not translated\r
-       }\r
-\r
-       HWND OnQueryInitialFocus(HWND /*hWndFocus*/)\r
-       {\r
-               return NULL;   // default\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_WIN32_WCE\r
-\r
-#endif // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-};\r
-\r
-// for non-customized pages\r
-template <WORD t_wDlgTemplateID>\r
-class CPropertyPage : public CPropertyPageImpl<CPropertyPage<t_wDlgTemplateID> >\r
-{\r
-public:\r
-       enum { IDD = t_wDlgTemplateID };\r
-\r
-       CPropertyPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CPropertyPageImpl<CPropertyPage>(title)\r
-       { }\r
-\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAxPropertyPageImpl - property page that hosts ActiveX controls\r
-\r
-#ifndef _ATL_NO_HOSTING\r
-\r
-// Note: You must #include <atlhost.h> to use these classes\r
-\r
-template <class T, class TBase = CPropertyPageWindow>\r
-class ATL_NO_VTABLE CAxPropertyPageImpl : public CPropertyPageImpl< T, TBase >\r
-{\r
-public:\r
-// Data members\r
-       HGLOBAL m_hInitData;\r
-       HGLOBAL m_hDlgRes;\r
-       HGLOBAL m_hDlgResSplit;\r
-\r
-// Constructor/destructor\r
-       CAxPropertyPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : \r
-                       CPropertyPageImpl< T, TBase >(title),\r
-                       m_hInitData(NULL), m_hDlgRes(NULL), m_hDlgResSplit(NULL)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-\r
-               // initialize ActiveX hosting and modify dialog template\r
-               ATL::AtlAxWinInit();\r
-\r
-               HINSTANCE hInstance = ModuleHelper::GetResourceInstance();\r
-               LPCTSTR lpTemplateName = MAKEINTRESOURCE(pT->IDD);\r
-               HRSRC hDlg = ::FindResource(hInstance, lpTemplateName, (LPTSTR)RT_DIALOG);\r
-               if(hDlg != NULL)\r
-               {\r
-                       HRSRC hDlgInit = ::FindResource(hInstance, lpTemplateName, (LPTSTR)_ATL_RT_DLGINIT);\r
-\r
-                       BYTE* pInitData = NULL;\r
-                       if(hDlgInit != NULL)\r
-                       {\r
-                               m_hInitData = ::LoadResource(hInstance, hDlgInit);\r
-                               pInitData = (BYTE*)::LockResource(m_hInitData);\r
-                       }\r
-\r
-                       m_hDlgRes = ::LoadResource(hInstance, hDlg);\r
-                       DLGTEMPLATE* pDlg = (DLGTEMPLATE*)::LockResource(m_hDlgRes);\r
-                       LPCDLGTEMPLATE lpDialogTemplate = ATL::_DialogSplitHelper::SplitDialogTemplate(pDlg, pInitData);\r
-                       if(lpDialogTemplate != pDlg)\r
-                               m_hDlgResSplit = GlobalHandle(lpDialogTemplate);\r
-\r
-                       // set up property page to use in-memory dialog template\r
-                       if(lpDialogTemplate != NULL)\r
-                       {\r
-                               m_psp.dwFlags |= PSP_DLGINDIRECT;\r
-                               m_psp.pResource = lpDialogTemplate;\r
-                       }\r
-                       else\r
-                       {\r
-                               ATLASSERT(FALSE && _T("CAxPropertyPageImpl - ActiveX initializtion failed!"));\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       ATLASSERT(FALSE && _T("CAxPropertyPageImpl - Cannot find dialog template!"));\r
-               }\r
-       }\r
-\r
-       ~CAxPropertyPageImpl()\r
-       {\r
-               if(m_hInitData != NULL)\r
-               {\r
-                       UnlockResource(m_hInitData);\r
-                       FreeResource(m_hInitData);\r
-               }\r
-               if(m_hDlgRes != NULL)\r
-               {\r
-                       UnlockResource(m_hDlgRes);\r
-                       FreeResource(m_hDlgRes);\r
-               }\r
-               if(m_hDlgResSplit != NULL)\r
-               {\r
-                       ::GlobalFree(m_hDlgResSplit);\r
-               }\r
-       }\r
-\r
-// Methods\r
-       // call this one to handle keyboard message for ActiveX controls\r
-       BOOL PreTranslateMessage(LPMSG pMsg)\r
-       {\r
-               if ((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&\r
-                  (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))\r
-                       return FALSE;\r
-               // find a direct child of the dialog from the window that has focus\r
-               HWND hWndCtl = ::GetFocus();\r
-               if (IsChild(hWndCtl) && ::GetParent(hWndCtl) != m_hWnd)\r
-               {\r
-                       do\r
-                       {\r
-                               hWndCtl = ::GetParent(hWndCtl);\r
-                       }\r
-                       while (::GetParent(hWndCtl) != m_hWnd);\r
-               }\r
-               // give controls a chance to translate this message\r
-               return (BOOL)::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg);\r
-       }\r
-\r
-// Overridables\r
-#if (_WIN32_IE >= 0x0500)\r
-       // new default implementation for ActiveX hosting pages\r
-#ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-       int OnTranslateAccelerator(LPMSG lpMsg)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return (pT->PreTranslateMessage(lpMsg) != FALSE) ? PSNRET_MESSAGEHANDLED : PSNRET_NOERROR;\r
-       }\r
-#else // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-       BOOL OnTranslateAccelerator(LPMSG lpMsg)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return pT->PreTranslateMessage(lpMsg);\r
-       }\r
-#endif // !_WTL_NEW_PAGE_NOTIFY_HANDLERS\r
-#endif // (_WIN32_IE >= 0x0500)\r
-\r
-// Support for new stuff in ATL7\r
-#if (_ATL_VER >= 0x0700)\r
-       int GetIDD()\r
-       {\r
-               return( static_cast<T*>(this)->IDD );\r
-       }\r
-\r
-       virtual DLGPROC GetDialogProc()\r
-       {\r
-               return DialogProc;\r
-       }\r
-\r
-       static INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               CAxPropertyPageImpl< T, TBase >* pThis = (CAxPropertyPageImpl< T, TBase >*)hWnd;\r
-               if (uMsg == WM_INITDIALOG)\r
-               {\r
-                       HRESULT hr;\r
-                       if (FAILED(hr = pThis->CreateActiveXControls(pThis->GetIDD())))\r
-                       {\r
-                               ATLASSERT(FALSE);\r
-                               return FALSE;\r
-                       }\r
-               }\r
-               return CPropertyPageImpl< T, TBase >::DialogProc(hWnd, uMsg, wParam, lParam);\r
-       }\r
-\r
-// ActiveX controls creation\r
-       virtual HRESULT CreateActiveXControls(UINT nID)\r
-       {\r
-               // Load dialog template and InitData\r
-               HRSRC hDlgInit = ::FindResource(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(nID), (LPTSTR)_ATL_RT_DLGINIT);\r
-               BYTE* pInitData = NULL;\r
-               HGLOBAL hData = NULL;\r
-               HRESULT hr = S_OK;\r
-               if (hDlgInit != NULL)\r
-               {\r
-                       hData = ::LoadResource(ATL::_AtlBaseModule.GetResourceInstance(), hDlgInit);\r
-                       if (hData != NULL)\r
-                               pInitData = (BYTE*) ::LockResource(hData);\r
-               }\r
-\r
-               HRSRC hDlg = ::FindResource(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(nID), (LPTSTR)RT_DIALOG);\r
-               if (hDlg != NULL)\r
-               {\r
-                       HGLOBAL hResource = ::LoadResource(ATL::_AtlBaseModule.GetResourceInstance(), hDlg);\r
-                       DLGTEMPLATE* pDlg = NULL;\r
-                       if (hResource != NULL)\r
-                       {\r
-                               pDlg = (DLGTEMPLATE*) ::LockResource(hResource);\r
-                               if (pDlg != NULL)\r
-                               {\r
-                                       // Get first control on the template\r
-                                       BOOL bDialogEx = ATL::_DialogSplitHelper::IsDialogEx(pDlg);\r
-                                       WORD nItems = ATL::_DialogSplitHelper::DlgTemplateItemCount(pDlg);\r
-\r
-                                       // Get first control on the dialog\r
-                                       DLGITEMTEMPLATE* pItem = ATL::_DialogSplitHelper::FindFirstDlgItem(pDlg);\r
-                                       HWND hWndPrev = GetWindow(GW_CHILD);\r
-\r
-                                       // Create all ActiveX cotnrols in the dialog template and place them in the correct tab order (z-order)\r
-                                       for (WORD nItem = 0; nItem < nItems; nItem++)\r
-                                       {\r
-                                               DWORD wID = bDialogEx ? ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->id : pItem->id;\r
-                                               if (ATL::_DialogSplitHelper::IsActiveXControl(pItem, bDialogEx))\r
-                                               {\r
-                                                       BYTE* pData = NULL;\r
-                                                       DWORD dwLen = ATL::_DialogSplitHelper::FindCreateData(wID, pInitData, &pData);\r
-                                                       ATL::CComPtr<IStream> spStream;\r
-                                                       if (dwLen != 0)\r
-                                                       {\r
-                                                               HGLOBAL h = GlobalAlloc(GHND, dwLen);\r
-                                                               if (h != NULL)\r
-                                                               {\r
-                                                                       BYTE* pBytes = (BYTE*) GlobalLock(h);\r
-                                                                       BYTE* pSource = pData; \r
-                                                                       SecureHelper::memcpy_x(pBytes, dwLen, pSource, dwLen);\r
-                                                                       GlobalUnlock(h);\r
-                                                                       CreateStreamOnHGlobal(h, TRUE, &spStream);\r
-                                                               }\r
-                                                               else\r
-                                                               {\r
-                                                                       hr = E_OUTOFMEMORY;\r
-                                                                       break;\r
-                                                               }\r
-                                                       }\r
-\r
-                                                       ATL::CComBSTR bstrLicKey;\r
-                                                       hr = ATL::_DialogSplitHelper::ParseInitData(spStream, &bstrLicKey.m_str);\r
-                                                       if (SUCCEEDED(hr))\r
-                                                       {\r
-                                                               ATL::CAxWindow2 wnd;\r
-                                                               // Get control caption.\r
-                                                               LPWSTR pszClassName = \r
-                                                                       bDialogEx ? \r
-                                                                               (LPWSTR)(((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem) + 1) :\r
-                                                                               (LPWSTR)(pItem + 1);\r
-                                                               // Get control rect.\r
-                                                               RECT rect;\r
-                                                               rect.left = \r
-                                                                       bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->x : \r
-                                                                               pItem->x;\r
-                                                               rect.top = \r
-                                                                       bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->y : \r
-                                                                               pItem->y;\r
-                                                               rect.right = rect.left + \r
-                                                                       (bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->cx : \r
-                                                                               pItem->cx);\r
-                                                               rect.bottom = rect.top + \r
-                                                                       (bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->cy : \r
-                                                                               pItem->cy);\r
-\r
-                                                               // Convert from dialog units to screen units\r
-                                                               MapDialogRect(&rect);\r
-\r
-                                                               // Create AxWindow with a NULL caption.\r
-                                                               wnd.Create(m_hWnd, \r
-                                                                       &rect, \r
-                                                                       NULL, \r
-                                                                       (bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->style : \r
-                                                                               pItem->style) | WS_TABSTOP, \r
-                                                                       bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->exStyle : \r
-                                                                               0,\r
-                                                                       bDialogEx ? \r
-                                                                               ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->id : \r
-                                                                               pItem->id,\r
-                                                                       NULL);\r
-\r
-                                                               if (wnd != NULL)\r
-                                                               {\r
-#ifndef _WIN32_WCE\r
-                                                                       // Set the Help ID\r
-                                                                       if (bDialogEx && ((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->helpID != 0)\r
-                                                                               wnd.SetWindowContextHelpId(((ATL::_DialogSplitHelper::DLGITEMTEMPLATEEX*)pItem)->helpID);\r
-#endif // !_WIN32_WCE\r
-                                                                       // Try to create the ActiveX control.\r
-                                                                       hr = wnd.CreateControlLic(pszClassName, spStream, NULL, bstrLicKey);\r
-                                                                       if (FAILED(hr))\r
-                                                                               break;\r
-                                                                       // Set the correct tab position.\r
-                                                                       if (nItem == 0)\r
-                                                                               hWndPrev = HWND_TOP;\r
-                                                                       wnd.SetWindowPos(hWndPrev, 0,0,0,0,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);\r
-                                                                       hWndPrev = wnd;\r
-                                                               }\r
-                                                               else\r
-                                                               {\r
-                                                                       hr = ATL::AtlHresultFromLastError();\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-                                               else\r
-                                               {\r
-                                                       if (nItem != 0)\r
-                                                               hWndPrev = ::GetWindow(hWndPrev, GW_HWNDNEXT);\r
-                                               }\r
-                                               pItem = ATL::_DialogSplitHelper::FindNextDlgItem(pItem, bDialogEx);\r
-                                       }\r
-                               }\r
-                               else\r
-                                       hr = ATL::AtlHresultFromLastError();\r
-                       }\r
-                       else\r
-                               hr = ATL::AtlHresultFromLastError();\r
-               }\r
-               return hr;\r
-       }\r
-\r
-// Event handling support\r
-       HRESULT AdviseSinkMap(bool bAdvise)\r
-       {\r
-               if(!bAdvise && m_hWnd == NULL)\r
-               {\r
-                       // window is gone, controls are already unadvised\r
-                       ATLTRACE2(atlTraceUI, 0, _T("CAxPropertyPageImpl::AdviseSinkMap called after the window was destroyed\n"));\r
-                       return S_OK;\r
-               }\r
-               HRESULT hRet = E_NOTIMPL;\r
-               __if_exists(T::_GetSinkMapFinder)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       hRet = AtlAdviseSinkMap(pT, bAdvise);\r
-               }\r
-               return hRet;\r
-       }\r
-\r
-// Message map and handlers\r
-       typedef CPropertyPageImpl< T, TBase>   _baseClass;\r
-       BEGIN_MSG_MAP(CAxPropertyPageImpl)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               CHAIN_MSG_MAP(_baseClass)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               // initialize controls in dialog with DLGINIT resource section\r
-               ExecuteDlgInit(static_cast<T*>(this)->IDD);\r
-               AdviseSinkMap(true);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               AdviseSinkMap(false);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-#endif // (_ATL_VER >= 0x0700)\r
-};\r
-\r
-// for non-customized pages\r
-template <WORD t_wDlgTemplateID>\r
-class CAxPropertyPage : public CAxPropertyPageImpl<CAxPropertyPage<t_wDlgTemplateID> >\r
-{\r
-public:\r
-       enum { IDD = t_wDlgTemplateID };\r
-\r
-       CAxPropertyPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAxPropertyPageImpl<CAxPropertyPage>(title)\r
-       { }\r
-\r
-#if (_WIN32_IE >= 0x0500) || (_ATL_VER >= 0x0700)\r
-       // not empty so we handle accelerators/create controls\r
-       BEGIN_MSG_MAP(CAxPropertyPage)\r
-               CHAIN_MSG_MAP(CAxPropertyPageImpl<CAxPropertyPage<t_wDlgTemplateID> >)\r
-       END_MSG_MAP()\r
-#else // !((_WIN32_IE >= 0x0500) || (_ATL_VER >= 0x0700))\r
-       DECLARE_EMPTY_MSG_MAP()\r
-#endif // !((_WIN32_IE >= 0x0500) || (_ATL_VER >= 0x0700))\r
-};\r
-\r
-#endif // _ATL_NO_HOSTING\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Wizard97 Support\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-// Sample wizard dialog resources:\r
-//\r
-// IDD_WIZ97_INTERIOR_BLANK DIALOG  0, 0, 317, 143\r
-// STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION\r
-// CAPTION "Wizard97 Property Page - Interior"\r
-// FONT 8, "MS Shell Dlg"\r
-// BEGIN\r
-// END\r
-//\r
-// IDD_WIZ97_EXTERIOR_BLANK DIALOGEX 0, 0, 317, 193\r
-// STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION\r
-// CAPTION "Wizard97 Property Page - Welcome/Complete"\r
-// FONT 8, "MS Shell Dlg", 0, 0, 0x0\r
-// BEGIN\r
-//    LTEXT           "Welcome to the X Wizard",IDC_WIZ97_EXTERIOR_TITLE,115,8,\r
-//                    195,24\r
-//    LTEXT           "Wizard Explanation\r\n(The height of the static text should be in multiples of 8 dlus)",\r
-//                    IDC_STATIC,115,40,195,16\r
-//    LTEXT           "h",IDC_WIZ97_BULLET1,118,64,8,8\r
-//    LTEXT           "List Item 1 (the h is turned into a bullet)",IDC_STATIC,\r
-//                    127,63,122,8\r
-//    LTEXT           "h",IDC_WIZ97_BULLET2,118,79,8,8\r
-//    LTEXT           "List Item 2. Keep 7 dlus between paragraphs",IDC_STATIC,\r
-//                    127,78,33,8\r
-//    CONTROL         "&Do not show this Welcome page again",\r
-//                    IDC_WIZ97_WELCOME_NOTAGAIN,"Button",BS_AUTOCHECKBOX | \r
-//                    WS_TABSTOP,115,169,138,10\r
-// END\r
-//\r
-// GUIDELINES DESIGNINFO \r
-// BEGIN\r
-//    IDD_WIZ97_INTERIOR_BLANK, DIALOG\r
-//    BEGIN\r
-//        LEFTMARGIN, 7\r
-//        RIGHTMARGIN, 310\r
-//        VERTGUIDE, 21\r
-//        VERTGUIDE, 31\r
-//        VERTGUIDE, 286\r
-//        VERTGUIDE, 296\r
-//        TOPMARGIN, 7\r
-//        BOTTOMMARGIN, 136\r
-//        HORZGUIDE, 8\r
-//    END\r
-//\r
-//    IDD_WIZ97_EXTERIOR_BLANK, DIALOG\r
-//    BEGIN\r
-//        RIGHTMARGIN, 310\r
-//        VERTGUIDE, 115\r
-//        VERTGUIDE, 118\r
-//        VERTGUIDE, 127\r
-//        TOPMARGIN, 7\r
-//        BOTTOMMARGIN, 186\r
-//        HORZGUIDE, 8\r
-//        HORZGUIDE, 32\r
-//        HORZGUIDE, 40\r
-//        HORZGUIDE, 169\r
-//    END\r
-// END\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWizard97SheetWindow - client side for a Wizard 97 style wizard sheet\r
-\r
-class CWizard97SheetWindow : public CPropertySheetWindow\r
-{\r
-public:\r
-// Constructors\r
-       CWizard97SheetWindow(HWND hWnd = NULL) : CPropertySheetWindow(hWnd)\r
-       { }\r
-\r
-       CWizard97SheetWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Operations\r
-       HFONT GetExteriorPageTitleFont(void)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HFONT)::SendMessage(m_hWnd, GetMessage_GetExteriorPageTitleFont(), 0, 0L);\r
-       }\r
-\r
-       HFONT GetBulletFont(void)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HFONT)::SendMessage(m_hWnd, GetMessage_GetBulletFont(), 0, 0L);\r
-       }\r
-\r
-// Helpers\r
-       static UINT GetMessage_GetExteriorPageTitleFont()\r
-       {\r
-               static UINT uGetExteriorPageTitleFont = 0;\r
-               if(uGetExteriorPageTitleFont == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CWizard97SheetWindow::GetMessage_GetExteriorPageTitleFont().\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uGetExteriorPageTitleFont == 0)\r
-                               uGetExteriorPageTitleFont = ::RegisterWindowMessage(_T("GetExteriorPageTitleFont_531AF056-B8BE-4c4c-B786-AC608DF0DF12"));\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uGetExteriorPageTitleFont != 0);\r
-               return uGetExteriorPageTitleFont;\r
-       }\r
-\r
-       static UINT GetMessage_GetBulletFont()\r
-       {\r
-               static UINT uGetBulletFont = 0;\r
-               if(uGetBulletFont == 0)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CWizard97SheetWindow::GetMessage_GetBulletFont().\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(uGetBulletFont == 0)\r
-                               uGetBulletFont = ::RegisterWindowMessage(_T("GetBulletFont_AD347D08-8F65-45ef-982E-6352E8218AD5"));\r
-\r
-                       lock.Unlock();\r
-               }\r
-               ATLASSERT(uGetBulletFont != 0);\r
-               return uGetBulletFont;\r
-       }\r
-\r
-// Implementation - override to prevent usage\r
-       HWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\r
-       {\r
-               ATLASSERT(FALSE);\r
-               return NULL;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWizard97SheetImpl - implements a Wizard 97 style wizard sheet\r
-\r
-template <class T, class TBase = CWizard97SheetWindow>\r
-class ATL_NO_VTABLE CWizard97SheetImpl : public CPropertySheetImpl< T, TBase >\r
-{\r
-protected:\r
-// Typedefs\r
-       typedef CWizard97SheetImpl< T, TBase > thisClass;\r
-       typedef CPropertySheetImpl< T, TBase > baseClass;\r
-\r
-// Member variables\r
-       CFont m_fontExteriorPageTitle;   // Welcome and Completion page title font\r
-       CFont m_fontBullet;              // Bullet font (used on static text 'h' to produce a small bullet)\r
-       bool m_bReceivedFirstSizeMessage;   \r
-\r
-public:\r
-       CWizard97SheetImpl(ATL::_U_STRINGorID title, ATL::_U_STRINGorID headerBitmap, ATL::_U_STRINGorID watermarkBitmap, UINT uStartPage = 0, HWND hWndParent = NULL) :\r
-                       baseClass(title, uStartPage, hWndParent),\r
-                       m_bReceivedFirstSizeMessage(false)\r
-       {\r
-               m_psh.dwFlags &= ~(PSH_NOCONTEXTHELP);\r
-               m_psh.dwFlags &= ~(PSH_WIZARD | PSH_WIZARD_LITE);\r
-\r
-               m_psh.dwFlags |= (PSH_HASHELP | PSH_WIZARDCONTEXTHELP);\r
-               m_psh.dwFlags |= PSH_WIZARD97;\r
-\r
-               baseClass::SetHeader(headerBitmap.m_lpstr);\r
-               baseClass::SetWatermark(watermarkBitmap.m_lpstr);\r
-       }\r
-\r
-// Overrides from base class\r
-       void OnSheetInitialized()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->_InitializeFonts();\r
-\r
-               // We'd like to center the wizard here, but its too early.\r
-               // Instead, we'll do CenterWindow upon our first WM_SIZE message\r
-       }\r
-\r
-// Initialization\r
-       void _InitializeFonts()\r
-       {\r
-               // Setup the Title and Bullet Font\r
-               // (Property pages can send the "get external page title font" and "get bullet font" messages)\r
-               // The derived class needs to do the actual SetFont for the dialog items)\r
-\r
-               CFontHandle fontThisDialog = this->GetFont();\r
-               CClientDC dcScreen(NULL);\r
-\r
-               LOGFONT titleLogFont = {0};\r
-               LOGFONT bulletLogFont = {0};\r
-               fontThisDialog.GetLogFont(&titleLogFont);\r
-               fontThisDialog.GetLogFont(&bulletLogFont);\r
-\r
-               // The Wizard 97 Spec recommends to do the Title Font\r
-               // as Verdana Bold, 12pt.\r
-               titleLogFont.lfCharSet = DEFAULT_CHARSET;\r
-               titleLogFont.lfWeight = FW_BOLD;\r
-               SecureHelper::strcpy_x(titleLogFont.lfFaceName, _countof(titleLogFont.lfFaceName), _T("Verdana Bold"));\r
-               INT titleFontPointSize = 12;\r
-               titleLogFont.lfHeight = -::MulDiv(titleFontPointSize, dcScreen.GetDeviceCaps(LOGPIXELSY), 72);\r
-               m_fontExteriorPageTitle.CreateFontIndirect(&titleLogFont);\r
-\r
-               // The Wizard 97 Spec recommends to do Bullets by having\r
-               // static text of "h" in the Marlett font.\r
-               bulletLogFont.lfCharSet = DEFAULT_CHARSET;\r
-               bulletLogFont.lfWeight = FW_NORMAL;\r
-               SecureHelper::strcpy_x(bulletLogFont.lfFaceName, _countof(bulletLogFont.lfFaceName), _T("Marlett"));\r
-               INT bulletFontSize = 8;\r
-               bulletLogFont.lfHeight = -::MulDiv(bulletFontSize, dcScreen.GetDeviceCaps(LOGPIXELSY), 72);\r
-               m_fontBullet.CreateFontIndirect(&bulletLogFont);\r
-       }\r
-\r
-// Message Handling\r
-       BEGIN_MSG_MAP(thisClass)\r
-               MESSAGE_HANDLER(CWizard97SheetWindow::GetMessage_GetExteriorPageTitleFont(), OnGetExteriorPageTitleFont)\r
-               MESSAGE_HANDLER(CWizard97SheetWindow::GetMessage_GetBulletFont(), OnGetBulletFont)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               CHAIN_MSG_MAP(baseClass)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnGetExteriorPageTitleFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return (LRESULT)(HFONT)m_fontExteriorPageTitle;\r
-       }\r
-\r
-       LRESULT OnGetBulletFont(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return (LRESULT)(HFONT)m_fontBullet;\r
-       }\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(!m_bReceivedFirstSizeMessage)\r
-               {\r
-                       m_bReceivedFirstSizeMessage = true;\r
-                       this->CenterWindow();\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-};\r
-\r
-// for non-customized sheets\r
-class CWizard97Sheet : public CWizard97SheetImpl<CWizard97Sheet>\r
-{\r
-protected:\r
-// Typedefs\r
-       typedef CWizard97Sheet thisClass;\r
-       typedef CWizard97SheetImpl<CWizard97Sheet> baseClass;\r
-\r
-public:\r
-       CWizard97Sheet(ATL::_U_STRINGorID title, ATL::_U_STRINGorID headerBitmap, ATL::_U_STRINGorID watermarkBitmap, UINT uStartPage = 0, HWND hWndParent = NULL) :\r
-               baseClass(title, headerBitmap, watermarkBitmap, uStartPage, hWndParent)\r
-       { }\r
-\r
-       BEGIN_MSG_MAP(thisClass)\r
-               CHAIN_MSG_MAP(baseClass)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWizard97PageWindow - client side for a Wizard 97 style wizard page\r
-\r
-#define WIZARD97_EXTERIOR_CXDLG 317\r
-#define WIZARD97_EXTERIOR_CYDLG 193\r
-\r
-#define WIZARD97_INTERIOR_CXDLG 317\r
-#define WIZARD97_INTERIOR_CYDLG 143\r
-\r
-class CWizard97PageWindow : public CPropertyPageWindow\r
-{\r
-public:\r
-// Constructors\r
-       CWizard97PageWindow(HWND hWnd = NULL) : CPropertyPageWindow(hWnd)\r
-       { }\r
-\r
-       CWizard97PageWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       CWizard97SheetWindow GetPropertySheet() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return CWizard97SheetWindow(GetParent());\r
-       }\r
-\r
-// Operations\r
-       HFONT GetExteriorPageTitleFont(void)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return GetPropertySheet().GetExteriorPageTitleFont();\r
-       }\r
-\r
-       HFONT GetBulletFont(void)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return GetPropertySheet().GetBulletFont();\r
-       }\r
-\r
-// Implementation - overrides to prevent usage\r
-       HWND Create(LPCTSTR, HWND, ATL::_U_RECT = NULL, LPCTSTR = NULL, DWORD = 0, DWORD = 0, ATL::_U_MENUorID = 0U, LPVOID = NULL)\r
-       {\r
-               ATLASSERT(FALSE);\r
-               return NULL;\r
-       }\r
-\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWizard97PageImpl - implements a Wizard 97 style wizard page\r
-\r
-template <class T, class TBase = CWizard97PageWindow>\r
-class ATL_NO_VTABLE CWizard97PageImpl : public CPropertyPageImpl< T, TBase >\r
-{\r
-protected:\r
-// Typedefs\r
-       typedef CWizard97PageImpl< T, TBase > thisClass;\r
-       typedef CPropertyPageImpl< T, TBase > baseClass;\r
-\r
-public:\r
-       CWizard97PageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : baseClass(title)\r
-       { }\r
-\r
-// Message Handling\r
-       BEGIN_MSG_MAP(thisClass)\r
-               CHAIN_MSG_MAP(baseClass)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWizard97ExteriorPageImpl - implements a Wizard 97 style exterior wizard page\r
-\r
-template <class T, class TBase = CWizard97PageWindow>\r
-class ATL_NO_VTABLE CWizard97ExteriorPageImpl : public CPropertyPageImpl< T, TBase >\r
-{\r
-protected:\r
-// Typedefs\r
-       typedef CWizard97ExteriorPageImpl< T, TBase > thisClass;\r
-       typedef CPropertyPageImpl< T, TBase > baseClass;\r
-\r
-public:\r
-// Constructors\r
-       CWizard97ExteriorPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : baseClass(title)\r
-       {\r
-               m_psp.dwFlags |= PSP_HASHELP;\r
-               m_psp.dwFlags |= PSP_HIDEHEADER;\r
-       }\r
-\r
-// Message Handling\r
-       BEGIN_MSG_MAP(thisClass)\r
-               CHAIN_MSG_MAP(baseClass)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CWizard97InteriorPageImpl - implements a Wizard 97 style interior wizard page\r
-\r
-template <class T, class TBase = CWizard97PageWindow>\r
-class ATL_NO_VTABLE CWizard97InteriorPageImpl : public CPropertyPageImpl< T, TBase >\r
-{\r
-protected:\r
-// Typedefs\r
-       typedef CWizard97InteriorPageImpl< T, TBase > thisClass;\r
-       typedef CPropertyPageImpl< T, TBase > baseClass;\r
-\r
-public:\r
-// Constructors\r
-       CWizard97InteriorPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : baseClass(title)\r
-       {\r
-               m_psp.dwFlags |= PSP_HASHELP;\r
-               m_psp.dwFlags &= ~PSP_HIDEHEADER;\r
-               m_psp.dwFlags |= PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;\r
-\r
-               // Be sure to have the derived class define this in the constructor.\r
-               // We'll default it to something obvious in case its forgotten.\r
-               baseClass::SetHeaderTitle(_T("Call SetHeaderTitle in Derived Class"));\r
-               baseClass::SetHeaderSubTitle(_T("Call SetHeaderSubTitle in the constructor of the Derived Class."));\r
-       }\r
-\r
-// Message Handling\r
-       BEGIN_MSG_MAP(thisClass)\r
-               CHAIN_MSG_MAP(baseClass)\r
-       END_MSG_MAP()\r
-};\r
-\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Aero Wizard support\r
-\r
-#if (_WIN32_WINNT >= 0x0600) && !defined(_WIN32_WCE)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardFrameWindow - client side for an Aero Wizard frame window\r
-\r
-class CAeroWizardFrameWindow : public CPropertySheetWindow\r
-{\r
-public:\r
-// Constructors\r
-       CAeroWizardFrameWindow(HWND hWnd = NULL) : CPropertySheetWindow(hWnd)\r
-       { }\r
-\r
-       CAeroWizardFrameWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Operations - new, Aero Wizard only\r
-       void SetNextText(LPCWSTR lpszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_SETNEXTTEXT, 0, (LPARAM)lpszText);\r
-       }\r
-\r
-       void ShowWizardButtons(DWORD dwButtons, DWORD dwStates)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::PostMessage(m_hWnd, PSM_SHOWWIZBUTTONS, (WPARAM)dwStates, (LPARAM)dwButtons);\r
-       }\r
-\r
-       void EnableWizardButtons(DWORD dwButtons, DWORD dwStates)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::PostMessage(m_hWnd, PSM_ENABLEWIZBUTTONS, (WPARAM)dwStates, (LPARAM)dwButtons);\r
-       }\r
-\r
-       void SetButtonText(DWORD dwButton, LPCWSTR lpszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, PSM_SETBUTTONTEXT, (WPARAM)dwButton, (LPARAM)lpszText);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardFrameImpl - implements an Aero Wizard frame\r
-\r
-template <class T, class TBase = CAeroWizardFrameWindow>\r
-class ATL_NO_VTABLE CAeroWizardFrameImpl : public CPropertySheetImpl<T, TBase >\r
-{\r
-public:\r
-// Constructor\r
-       CAeroWizardFrameImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL) :\r
-               CPropertySheetImpl<T, TBase >(title, uStartPage, hWndParent)\r
-       {\r
-               m_psh.dwFlags |= PSH_WIZARD | PSH_AEROWIZARD;\r
-       }\r
-\r
-// Operations\r
-       void EnableResizing()\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               m_psh.dwFlags |= PSH_RESIZABLE;\r
-       }\r
-\r
-       void UseHeaderBitmap()\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               m_psh.dwFlags |= PSH_HEADERBITMAP;\r
-       }\r
-\r
-       void SetNoMargin()\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);   // can't do this after it's created\r
-               m_psh.dwFlags |= PSH_NOMARGIN;\r
-       }\r
-\r
-// Override to prevent use\r
-       HWND Create(HWND /*hWndParent*/ = NULL)\r
-       {\r
-               ATLASSERT(FALSE);   // not supported for Aero Wizard\r
-               return NULL;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardFrame - for non-customized frames\r
-\r
-class CAeroWizardFrame : public CAeroWizardFrameImpl<CAeroWizardFrame>\r
-{\r
-public:\r
-       CAeroWizardFrame(ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uStartPage = 0, HWND hWndParent = NULL)\r
-               : CAeroWizardFrameImpl<CAeroWizardFrame>(title, uStartPage, hWndParent)\r
-       { }\r
-\r
-       BEGIN_MSG_MAP(CAeroWizardFrame)\r
-               MESSAGE_HANDLER(WM_COMMAND, CAeroWizardFrameImpl<CAeroWizardFrame>::OnCommand)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardPageWindow - client side for an Aero Wizard page\r
-\r
-class CAeroWizardPageWindow : public CPropertyPageWindow\r
-{\r
-public:\r
-// Constructors\r
-       CAeroWizardPageWindow(HWND hWnd = NULL) : CPropertyPageWindow(hWnd)\r
-       { }\r
-\r
-       CAeroWizardPageWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Attributes\r
-       CAeroWizardFrameWindow GetAeroWizardFrame() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               // This is not really top-level frame window, but it processes all frame messages\r
-               return CAeroWizardFrameWindow(GetParent());\r
-       }\r
-\r
-// Operations - new, Aero Wizard only\r
-       void SetNextText(LPCWSTR lpszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetAeroWizardFrame().SetNextText(lpszText);\r
-       }\r
-\r
-       void ShowWizardButtons(DWORD dwButtons, DWORD dwStates)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetAeroWizardFrame().ShowWizardButtons(dwButtons, dwStates);\r
-       }\r
-\r
-       void EnableWizardButtons(DWORD dwButtons, DWORD dwStates)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetAeroWizardFrame().EnableWizardButtons(dwButtons, dwStates);\r
-       }\r
-\r
-       void SetButtonText(DWORD dwButton, LPCWSTR lpszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(GetParent() != NULL);\r
-               GetAeroWizardFrame().SetButtonText(dwButton, lpszText);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardPageImpl - implements an Aero Wizard page\r
-\r
-template <class T, class TBase = CAeroWizardPageWindow>\r
-class ATL_NO_VTABLE CAeroWizardPageImpl : public CPropertyPageImpl<T, TBase >\r
-{\r
-public:\r
-       CAeroWizardPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CPropertyPageImpl<T, TBase >(title)\r
-       { }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardPage - for non-customized pages\r
-\r
-template <WORD t_wDlgTemplateID>\r
-class CAeroWizardPage : public CAeroWizardPageImpl<CAeroWizardPage<t_wDlgTemplateID> >\r
-{\r
-public:\r
-       enum { IDD = t_wDlgTemplateID };\r
-\r
-       CAeroWizardPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAeroWizardPageImpl<CAeroWizardPage>(title)\r
-       { }\r
-\r
-       DECLARE_EMPTY_MSG_MAP()\r
-};\r
-\r
-\r
-#ifndef _ATL_NO_HOSTING\r
-\r
-// Note: You must #include <atlhost.h> to use these classes\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardAxPageImpl - Aero Wizard page that hosts ActiveX controls\r
-\r
-template <class T, class TBase = CAeroWizardPageWindow>\r
-class ATL_NO_VTABLE CAeroWizardAxPageImpl : public CAxPropertyPageImpl< T, TBase >\r
-{\r
-public:\r
-       CAeroWizardAxPageImpl(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAxPropertyPageImpl< T, TBase >(title)\r
-       { }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAeroWizardAxPage - for non-customized pages\r
-\r
-template <WORD t_wDlgTemplateID>\r
-class CAeroWizardAxPage : public CAeroWizardAxPageImpl<CAeroWizardAxPage<t_wDlgTemplateID> >\r
-{\r
-public:\r
-       enum { IDD = t_wDlgTemplateID };\r
-\r
-       CAeroWizardAxPage(ATL::_U_STRINGorID title = (LPCTSTR)NULL) : CAeroWizardAxPageImpl<CAeroWizardAxPage>(title)\r
-       { }\r
-\r
-#if (_WIN32_IE >= 0x0500) || (_ATL_VER >= 0x0700)\r
-       // not empty so we handle accelerators/create controls\r
-       BEGIN_MSG_MAP(CAeroWizardAxPage)\r
-               CHAIN_MSG_MAP(CAeroWizardAxPageImpl<CAeroWizardAxPage<t_wDlgTemplateID> >)\r
-       END_MSG_MAP()\r
-#else // !((_WIN32_IE >= 0x0500) || (_ATL_VER >= 0x0700))\r
-       DECLARE_EMPTY_MSG_MAP()\r
-#endif // !((_WIN32_IE >= 0x0500) || (_ATL_VER >= 0x0700))\r
-};\r
-\r
-#endif // _ATL_NO_HOSTING\r
-\r
-#endif // (_WIN32_WINNT >= 0x0600) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// TaskDialog support\r
-\r
-#if ((_WIN32_WINNT >= 0x0600) || defined(_WTL_TASKDIALOG)) && !defined(_WIN32_WCE)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// AtlTaskDialog - support for TaskDialog() function\r
-\r
-inline int AtlTaskDialog(HWND hWndParent, \r
-                         ATL::_U_STRINGorID WindowTitle, ATL::_U_STRINGorID MainInstructionText, ATL::_U_STRINGorID ContentText, \r
-                         TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons = 0U, ATL::_U_STRINGorID Icon = (LPCTSTR)NULL)\r
-{\r
-       int nRet = -1;\r
-\r
-#ifdef _WTL_TASKDIALOG_DIRECT\r
-       USES_CONVERSION;\r
-       HRESULT hRet = ::TaskDialog(hWndParent, ModuleHelper::GetResourceInstance(), T2CW(WindowTitle.m_lpstr), T2CW(MainInstructionText.m_lpstr), T2CW(ContentText.m_lpstr), dwCommonButtons, T2CW(Icon.m_lpstr), &nRet);\r
-       ATLVERIFY(SUCCEEDED(hRet));\r
-#else\r
-       // This allows apps to run on older versions of Windows\r
-       typedef HRESULT (STDAPICALLTYPE *PFN_TaskDialog)(HWND hwndParent, HINSTANCE hInstance, PCWSTR pszWindowTitle, PCWSTR pszMainInstruction, PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, PCWSTR pszIcon, int* pnButton);\r
-\r
-       HMODULE m_hCommCtrlDLL = ::LoadLibrary(_T("comctl32.dll"));\r
-       if(m_hCommCtrlDLL != NULL)\r
-       {\r
-               PFN_TaskDialog pfnTaskDialog = (PFN_TaskDialog)::GetProcAddress(m_hCommCtrlDLL, "TaskDialog");\r
-               if(pfnTaskDialog != NULL)\r
-               {\r
-                       USES_CONVERSION;\r
-                       HRESULT hRet = pfnTaskDialog(hWndParent, ModuleHelper::GetResourceInstance(), T2CW(WindowTitle.m_lpstr), T2CW(MainInstructionText.m_lpstr), T2CW(ContentText.m_lpstr), dwCommonButtons, T2CW(Icon.m_lpstr), &nRet);\r
-                       ATLVERIFY(SUCCEEDED(hRet));\r
-               }\r
-\r
-               ::FreeLibrary(m_hCommCtrlDLL);\r
-       }\r
-#endif\r
-\r
-       return nRet;\r
-}\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTaskDialogConfig - TASKDIALOGCONFIG wrapper\r
-\r
-class CTaskDialogConfig : public TASKDIALOGCONFIG\r
-{\r
-public:\r
-// Constructor\r
-       CTaskDialogConfig()\r
-       {\r
-               Init();\r
-       }\r
-\r
-       void Init()\r
-       {\r
-               memset(this, 0, sizeof(TASKDIALOGCONFIG));   // initialize structure to 0/NULL\r
-               this->cbSize = sizeof(TASKDIALOGCONFIG);\r
-               this->hInstance = ModuleHelper::GetResourceInstance();\r
-       }\r
-\r
-// Operations - setting values\r
-       // common buttons\r
-       void SetCommonButtons(TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons)\r
-       {\r
-               this->dwCommonButtons = dwCommonButtons;\r
-       }\r
-\r
-       // window title text\r
-       void SetWindowTitle(UINT nID)\r
-       {\r
-               this->pszWindowTitle = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetWindowTitle(LPCWSTR lpstrWindowTitle)\r
-       {\r
-               this->pszWindowTitle = lpstrWindowTitle;\r
-       }\r
-\r
-       // main icon\r
-       void SetMainIcon(HICON hIcon)\r
-       {\r
-               this->dwFlags |= TDF_USE_HICON_MAIN;\r
-               this->hMainIcon = hIcon;\r
-       }\r
-\r
-       void SetMainIcon(UINT nID)\r
-       {\r
-               this->dwFlags &= ~TDF_USE_HICON_MAIN;\r
-               this->pszMainIcon = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetMainIcon(LPCWSTR lpstrMainIcon)\r
-       {\r
-               this->dwFlags &= ~TDF_USE_HICON_MAIN;\r
-               this->pszMainIcon = lpstrMainIcon;\r
-       }\r
-\r
-       // main instruction text\r
-       void SetMainInstructionText(UINT nID)\r
-       {\r
-               this->pszMainInstruction = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetMainInstructionText(LPCWSTR lpstrMainInstruction)\r
-       {\r
-               this->pszMainInstruction = lpstrMainInstruction;\r
-       }\r
-\r
-       // content text\r
-       void SetContentText(UINT nID)\r
-       {\r
-               this->pszContent = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetContentText(LPCWSTR lpstrContent)\r
-       {\r
-               this->pszContent = lpstrContent;\r
-       }\r
-\r
-       // buttons\r
-       void SetButtons(const TASKDIALOG_BUTTON* pButtons, UINT cButtons, int nDefaultButton = 0)\r
-       {\r
-               this->pButtons = pButtons;\r
-               this->cButtons = cButtons;\r
-               if(nDefaultButton != 0)\r
-                       this->nDefaultButton = nDefaultButton;\r
-       }\r
-\r
-       void SetDefaultButton(int nDefaultButton)\r
-       {\r
-               this->nDefaultButton = nDefaultButton;\r
-       }\r
-\r
-       // radio buttons\r
-       void SetRadioButtons(const TASKDIALOG_BUTTON* pRadioButtons, UINT cRadioButtons, int nDefaultRadioButton = 0)\r
-       {\r
-               this->pRadioButtons = pRadioButtons;\r
-               this->cRadioButtons = cRadioButtons;\r
-               if(nDefaultRadioButton != 0)\r
-                       this->nDefaultRadioButton = nDefaultRadioButton;\r
-       }\r
-\r
-       void SetDefaultRadioButton(int nDefaultRadioButton)\r
-       {\r
-               this->nDefaultRadioButton = nDefaultRadioButton;\r
-       }\r
-\r
-       // verification text\r
-       void SetVerificationText(UINT nID)\r
-       {\r
-               this->pszVerificationText = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetVerificationText(LPCWSTR lpstrVerificationText)\r
-       {\r
-               this->pszVerificationText = lpstrVerificationText;\r
-       }\r
-\r
-       // expanded information text\r
-       void SetExpandedInformationText(UINT nID)\r
-       {\r
-               this->pszExpandedInformation = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetExpandedInformationText(LPCWSTR lpstrExpandedInformation)\r
-       {\r
-               this->pszExpandedInformation = lpstrExpandedInformation;\r
-       }\r
-\r
-       // expanded control text\r
-       void SetExpandedControlText(UINT nID)\r
-       {\r
-               this->pszExpandedControlText = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetExpandedControlText(LPCWSTR lpstrExpandedControlText)\r
-       {\r
-               this->pszExpandedControlText = lpstrExpandedControlText;\r
-       }\r
-\r
-       // collapsed control text\r
-       void SetCollapsedControlText(UINT nID)\r
-       {\r
-               this->pszCollapsedControlText = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetCollapsedControlText(LPCWSTR lpstrCollapsedControlText)\r
-       {\r
-               this->pszCollapsedControlText = lpstrCollapsedControlText;\r
-       }\r
-\r
-       // footer icon\r
-       void SetFooterIcon(HICON hIcon)\r
-       {\r
-               this->dwFlags |= TDF_USE_HICON_FOOTER;\r
-               this->hFooterIcon = hIcon;\r
-       }\r
-\r
-       void SetFooterIcon(UINT nID)\r
-       {\r
-               this->dwFlags &= ~TDF_USE_HICON_FOOTER;\r
-               this->pszFooterIcon = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetFooterIcon(LPCWSTR lpstrFooterIcon)\r
-       {\r
-               this->dwFlags &= ~TDF_USE_HICON_FOOTER;\r
-               this->pszFooterIcon = lpstrFooterIcon;\r
-       }\r
-\r
-       // footer text\r
-       void SetFooterText(UINT nID)\r
-       {\r
-               this->pszFooter = MAKEINTRESOURCEW(nID);\r
-       }\r
-\r
-       void SetFooterText(LPCWSTR lpstrFooterText)\r
-       {\r
-               this->pszFooter = lpstrFooterText;\r
-       }\r
-\r
-       // width (in DLUs)\r
-       void SetWidth(UINT cxWidth)\r
-       {\r
-               this->cxWidth = cxWidth;\r
-       }\r
-\r
-       // modify flags\r
-       void ModifyFlags(DWORD dwRemove, DWORD dwAdd)\r
-       {\r
-               this->dwFlags = (this->dwFlags & ~dwRemove) | dwAdd;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTaskDialogImpl - implements a Task Dialog\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CTaskDialogImpl\r
-{\r
-public:\r
-       CTaskDialogConfig m_tdc;\r
-       HWND m_hWnd;   // used only in callback functions\r
-\r
-// Constructor\r
-       CTaskDialogImpl(HWND hWndParent = NULL) : m_hWnd(NULL)\r
-       {\r
-               m_tdc.hwndParent = hWndParent;\r
-               m_tdc.pfCallback = T::TaskDialogCallback;\r
-               m_tdc.lpCallbackData = (LONG_PTR)static_cast<T*>(this);\r
-       }\r
-\r
-// Operations\r
-       HRESULT DoModal(HWND hWndParent = ::GetActiveWindow(), int* pnButton = NULL, int* pnRadioButton = NULL, BOOL* pfVerificationFlagChecked = NULL)\r
-       {\r
-               if(m_tdc.hwndParent == NULL)\r
-                       m_tdc.hwndParent = hWndParent;\r
-\r
-#ifdef _WTL_TASKDIALOG_DIRECT\r
-               return ::TaskDialogIndirect(&m_tdc, pnButton, pnRadioButton, pfVerificationFlagChecked);\r
-#else\r
-\r
-               // This allows apps to run on older versions of Windows\r
-               typedef HRESULT (STDAPICALLTYPE *PFN_TaskDialogIndirect)(const TASKDIALOGCONFIG* pTaskConfig, int* pnButton, int* pnRadioButton, BOOL* pfVerificationFlagChecked);\r
-\r
-               HRESULT hRet = E_UNEXPECTED;\r
-               HMODULE m_hCommCtrlDLL = ::LoadLibrary(_T("comctl32.dll"));\r
-               if(m_hCommCtrlDLL != NULL)\r
-               {\r
-                       PFN_TaskDialogIndirect pfnTaskDialogIndirect = (PFN_TaskDialogIndirect)::GetProcAddress(m_hCommCtrlDLL, "TaskDialogIndirect");\r
-                       if(pfnTaskDialogIndirect != NULL)\r
-                               hRet = pfnTaskDialogIndirect(&m_tdc, pnButton, pnRadioButton, pfVerificationFlagChecked);\r
-\r
-                       ::FreeLibrary(m_hCommCtrlDLL);\r
-               }\r
-\r
-               return hRet;\r
-#endif\r
-       }\r
-\r
-// Operations - setting values of TASKDIALOGCONFIG\r
-       // common buttons\r
-       void SetCommonButtons(TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons)\r
-       {       m_tdc.SetCommonButtons(dwCommonButtons); }\r
-       // window title text\r
-       void SetWindowTitle(UINT nID)\r
-       {       m_tdc.SetWindowTitle(nID); }\r
-       void SetWindowTitle(LPCWSTR lpstrWindowTitle)\r
-       {       m_tdc.SetWindowTitle(lpstrWindowTitle); }\r
-       // main icon\r
-       void SetMainIcon(HICON hIcon)\r
-       {       m_tdc.SetMainIcon(hIcon); }\r
-       void SetMainIcon(UINT nID)\r
-       {       m_tdc.SetMainIcon(nID); }\r
-       void SetMainIcon(LPCWSTR lpstrMainIcon)\r
-       {       m_tdc.SetMainIcon(lpstrMainIcon); }\r
-       // main instruction text\r
-       void SetMainInstructionText(UINT nID)\r
-       {       m_tdc.SetMainInstructionText(nID); }\r
-       void SetMainInstructionText(LPCWSTR lpstrMainInstruction)\r
-       {       m_tdc.SetMainInstructionText(lpstrMainInstruction); }\r
-       // content text\r
-       void SetContentText(UINT nID)\r
-       {       m_tdc.SetContentText(nID); }\r
-       void SetContentText(LPCWSTR lpstrContent)\r
-       {       m_tdc.SetContentText(lpstrContent); }\r
-       // buttons\r
-       void SetButtons(const TASKDIALOG_BUTTON* pButtons, UINT cButtons, int nDefaultButton = 0)\r
-       {       m_tdc.SetButtons(pButtons, cButtons, nDefaultButton); }\r
-       void SetDefaultButton(int nDefaultButton)\r
-       {       m_tdc.SetDefaultButton(nDefaultButton); }\r
-       // radio buttons\r
-       void SetRadioButtons(const TASKDIALOG_BUTTON* pRadioButtons, UINT cRadioButtons, int nDefaultRadioButton = 0)\r
-       {       m_tdc.SetRadioButtons(pRadioButtons, cRadioButtons, nDefaultRadioButton); }\r
-       void SetDefaultRadioButton(int nDefaultRadioButton)\r
-       {       m_tdc.SetDefaultRadioButton(nDefaultRadioButton); }\r
-       // verification text\r
-       void SetVerificationText(UINT nID)\r
-       {       m_tdc.SetVerificationText(nID); }\r
-       void SetVerificationText(LPCWSTR lpstrVerificationText)\r
-       {       m_tdc.SetVerificationText(lpstrVerificationText); }\r
-       // expanded information text\r
-       void SetExpandedInformationText(UINT nID)\r
-       {       m_tdc.SetExpandedInformationText(nID); }\r
-       void SetExpandedInformationText(LPCWSTR lpstrExpandedInformation)\r
-       {       m_tdc.SetExpandedInformationText(lpstrExpandedInformation); }\r
-       // expanded control text\r
-       void SetExpandedControlText(UINT nID)\r
-       {       m_tdc.SetExpandedControlText(nID); }\r
-       void SetExpandedControlText(LPCWSTR lpstrExpandedControlText)\r
-       {       m_tdc.SetExpandedControlText(lpstrExpandedControlText); }\r
-       // collapsed control text\r
-       void SetCollapsedControlText(UINT nID)\r
-       {       m_tdc.SetCollapsedControlText(nID); }\r
-       void SetCollapsedControlText(LPCWSTR lpstrCollapsedControlText)\r
-       {       m_tdc.SetCollapsedControlText(lpstrCollapsedControlText); }\r
-       // footer icon\r
-       void SetFooterIcon(HICON hIcon)\r
-       {       m_tdc.SetFooterIcon(hIcon); }\r
-       void SetFooterIcon(UINT nID)\r
-       {       m_tdc.SetFooterIcon(nID); }\r
-       void SetFooterIcon(LPCWSTR lpstrFooterIcon)\r
-       {       m_tdc.SetFooterIcon(lpstrFooterIcon); }\r
-       // footer text\r
-       void SetFooterText(UINT nID)\r
-       {       m_tdc.SetFooterText(nID); }\r
-       void SetFooterText(LPCWSTR lpstrFooterText)\r
-       {       m_tdc.SetFooterText(lpstrFooterText); }\r
-       // width (in DLUs)\r
-       void SetWidth(UINT cxWidth)\r
-       {       m_tdc.SetWidth(cxWidth); }\r
-       // modify flags\r
-       void ModifyFlags(DWORD dwRemove, DWORD dwAdd)\r
-       {       m_tdc.ModifyFlags(dwRemove, dwAdd); }\r
-\r
-// Implementation\r
-       static HRESULT CALLBACK TaskDialogCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LONG_PTR lpRefData)\r
-       {\r
-               T* pT = (T*)lpRefData;\r
-               ATLASSERT(pT->m_hWnd == NULL || pT->m_hWnd == hWnd);\r
-\r
-               BOOL bRet = FALSE;\r
-               switch(uMsg)\r
-               {\r
-               case TDN_DIALOG_CONSTRUCTED:\r
-                       pT->m_hWnd = hWnd;\r
-                       pT->OnDialogConstructed();\r
-                       break;\r
-               case TDN_CREATED:\r
-                       pT->OnCreated();\r
-                       break;\r
-               case TDN_BUTTON_CLICKED:\r
-                       bRet = pT->OnButtonClicked((int)wParam);\r
-                       break;\r
-               case TDN_RADIO_BUTTON_CLICKED:\r
-                       pT->OnRadioButtonClicked((int)wParam);\r
-                       break;\r
-               case TDN_HYPERLINK_CLICKED:\r
-                       pT->OnHyperlinkClicked((LPCWSTR)lParam);\r
-                       break;\r
-               case TDN_EXPANDO_BUTTON_CLICKED:\r
-                       pT->OnExpandoButtonClicked((wParam != 0));\r
-                       break;\r
-               case TDN_VERIFICATION_CLICKED:\r
-                       pT->OnVerificationClicked((wParam != 0));\r
-                       break;\r
-               case TDN_HELP:\r
-                       pT->OnHelp();\r
-                       break;\r
-               case TDN_TIMER:\r
-                       bRet = pT->OnTimer((DWORD)wParam);\r
-                       break;\r
-               case TDN_NAVIGATED:\r
-                       pT->OnNavigated();\r
-                       break;\r
-               case TDN_DESTROYED:\r
-                       pT->OnDestroyed();\r
-                       pT->m_hWnd = NULL;\r
-                       break;\r
-               default:\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Unknown notification received in CTaskDialogImpl::TaskDialogCallback\n"));\r
-                       break;\r
-               }\r
-\r
-               return (HRESULT)bRet;\r
-       }\r
-\r
-// Overrideables - notification handlers\r
-       void OnDialogConstructed()\r
-       {\r
-       }\r
-\r
-       void OnCreated()\r
-       {\r
-       }\r
-\r
-       BOOL OnButtonClicked(int /*nButton*/)\r
-       {\r
-               return FALSE;   // don't prevent dialog to close\r
-       }\r
-\r
-       void OnRadioButtonClicked(int /*nRadioButton*/)\r
-       {\r
-       }\r
-\r
-       void OnHyperlinkClicked(LPCWSTR /*pszHREF*/)\r
-       {\r
-       }\r
-\r
-       void OnExpandoButtonClicked(bool /*bExpanded*/)\r
-       {\r
-       }\r
-\r
-       void OnVerificationClicked(bool /*bChecked*/)\r
-       {\r
-       }\r
-\r
-       void OnHelp()\r
-       {\r
-       }\r
-\r
-       BOOL OnTimer(DWORD /*dwTickCount*/)\r
-       {\r
-               return FALSE;   // don't reset counter\r
-       }\r
-\r
-       void OnNavigated()\r
-       {\r
-       }\r
-\r
-       void OnDestroyed()\r
-       {\r
-       }\r
-\r
-// Commands - valid to call only from handlers\r
-       void NavigatePage(TASKDIALOGCONFIG& tdc)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-\r
-               tdc.cbSize = sizeof(TASKDIALOGCONFIG);\r
-               if(tdc.hwndParent == NULL)\r
-                       tdc.hwndParent = m_tdc.hwndParent;\r
-               tdc.pfCallback = m_tdc.pfCallback;\r
-               tdc.lpCallbackData = m_tdc.lpCallbackData;\r
-               (TASKDIALOGCONFIG)m_tdc = tdc;\r
-\r
-               ::SendMessage(m_hWnd, TDM_NAVIGATE_PAGE, 0, (LPARAM)&tdc);\r
-       }\r
-\r
-       // modify TASKDIALOGCONFIG values, then call this to update task dialog\r
-       void NavigatePage()\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_NAVIGATE_PAGE, 0, (LPARAM)&m_tdc);\r
-       }\r
-\r
-       void ClickButton(int nButton)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_CLICK_BUTTON, nButton, 0L);\r
-       }\r
-\r
-       void SetMarqueeProgressBar(BOOL bMarquee)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_SET_MARQUEE_PROGRESS_BAR, bMarquee, 0L);\r
-       }\r
-\r
-       BOOL SetProgressBarState(int nNewState)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_STATE, nNewState, 0L);\r
-       }\r
-\r
-       DWORD SetProgressBarRange(int nMinRange, int nMaxRange)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               return (DWORD)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(nMinRange, nMaxRange));\r
-       }\r
-\r
-       int SetProgressBarPos(int nNewPos)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               return (int)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_POS, nNewPos, 0L);\r
-       }\r
-\r
-       BOOL SetProgressBarMarquee(BOOL bMarquee, UINT uSpeed)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               return (BOOL)::SendMessage(m_hWnd, TDM_SET_PROGRESS_BAR_MARQUEE, bMarquee, uSpeed);\r
-       }\r
-\r
-       void SetElementText(TASKDIALOG_ELEMENTS element, LPCWSTR lpstrText)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_SET_ELEMENT_TEXT, element, (LPARAM)lpstrText);\r
-       }\r
-\r
-       void ClickRadioButton(int nRadioButton)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_CLICK_RADIO_BUTTON, nRadioButton, 0L);\r
-       }\r
-\r
-       void EnableButton(int nButton, BOOL bEnable)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_ENABLE_BUTTON, nButton, bEnable);\r
-       }\r
-\r
-       void EnableRadioButton(int nButton, BOOL bEnable)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_ENABLE_RADIO_BUTTON, nButton, bEnable);\r
-       }\r
-\r
-       void ClickVerification(BOOL bCheck, BOOL bFocus)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_CLICK_VERIFICATION, bCheck, bFocus);\r
-       }\r
-\r
-       void UpdateElementText(TASKDIALOG_ELEMENTS element, LPCWSTR lpstrText)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_UPDATE_ELEMENT_TEXT, element, (LPARAM)lpstrText);\r
-       }\r
-\r
-       void SetButtonElevationRequiredState(int nButton, BOOL bElevation)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-               ::SendMessage(m_hWnd, TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE, nButton, bElevation);\r
-       }\r
-\r
-       void UpdateIcon(TASKDIALOG_ICON_ELEMENTS element, HICON hIcon)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-#ifdef _DEBUG\r
-               if(element == TDIE_ICON_MAIN)\r
-                       ATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_MAIN) != 0);\r
-               else if(element == TDIE_ICON_FOOTER)\r
-                       ATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_FOOTER) != 0);\r
-#endif // _DEBUG\r
-               ::SendMessage(m_hWnd, TDM_UPDATE_ICON, element, (LPARAM)hIcon);\r
-       }\r
-\r
-       void UpdateIcon(TASKDIALOG_ICON_ELEMENTS element, LPCWSTR lpstrIcon)\r
-       {\r
-               ATLASSERT(m_hWnd != NULL);\r
-#ifdef _DEBUG\r
-               if(element == TDIE_ICON_MAIN)\r
-                       ATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_MAIN) == 0);\r
-               else if(element == TDIE_ICON_FOOTER)\r
-                       ATLASSERT((m_tdc.dwFlags & TDF_USE_HICON_FOOTER) == 0);\r
-#endif // _DEBUG\r
-               ::SendMessage(m_hWnd, TDM_UPDATE_ICON, element, (LPARAM)lpstrIcon);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTaskDialog - for non-customized task dialogs\r
-\r
-class CTaskDialog : public CTaskDialogImpl<CTaskDialog>\r
-{\r
-public:\r
-       CTaskDialog(HWND hWndParent = NULL) : CTaskDialogImpl<CTaskDialog>(hWndParent)\r
-       {\r
-               m_tdc.pfCallback = NULL;\r
-       }\r
-};\r
-\r
-#endif // ((_WIN32_WINNT >= 0x0600) || defined(_WTL_TASKDIALOG)) && !defined(_WIN32_WCE)\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLDLGS_H__\r
diff --git a/WTL80/include/atlfind.h b/WTL80/include/atlfind.h
deleted file mode 100644 (file)
index a1dd52d..0000000
+++ /dev/null
@@ -1,1036 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLFIND_H__\r
-#define __ATLFIND_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifdef _WIN32_WCE\r
-       #error atlfind.h is not supported on Windows CE\r
-#endif\r
-\r
-#ifndef __ATLCTRLS_H__\r
-       #error atlfind.h requires atlctrls.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLDLGS_H__\r
-       #error atlfind.h requires atldlgs.h to be included first\r
-#endif\r
-\r
-#if !((defined(__ATLMISC_H__) && defined(_WTL_USE_CSTRING)) || defined(__ATLSTR_H__))\r
-       #error atlfind.h requires CString (either from ATL's atlstr.h or WTL's atlmisc.h with _WTL_USE_CSTRING)\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CEditFindReplaceImplBase<T, TFindReplaceDialog>\r
-// CEditFindReplaceImpl<T, TFindReplaceDialog>\r
-// CRichEditFindReplaceImpl<T, TFindReplaceDialog>\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CEditFindReplaceImplBase - Base class for mixin classes that\r
-// help implement Find/Replace for CEdit or CRichEditCtrl based window classes.\r
-\r
-template <class T, class TFindReplaceDialog = CFindReplaceDialog>\r
-class CEditFindReplaceImplBase\r
-{\r
-protected:\r
-// Typedefs\r
-       typedef CEditFindReplaceImplBase<T, TFindReplaceDialog> thisClass;\r
-\r
-// Data members\r
-       TFindReplaceDialog* m_pFindReplaceDialog;\r
-       _CSTRING_NS::CString m_sFindNext, m_sReplaceWith;\r
-       BOOL m_bFindOnly, m_bFirstSearch, m_bMatchCase, m_bWholeWord, m_bFindDown;\r
-       LONG m_nInitialSearchPos;\r
-       HCURSOR m_hOldCursor;\r
-\r
-// Enumerations\r
-       enum TranslationTextItem\r
-       {\r
-               eText_OnReplaceAllMessage   = 0,\r
-               eText_OnReplaceAllTitle     = 1,\r
-               eText_OnTextNotFoundMessage = 2,\r
-               eText_OnTextNotFoundTitle   = 3\r
-       };\r
-\r
-public:\r
-// Constructors\r
-       CEditFindReplaceImplBase() :\r
-               m_pFindReplaceDialog(NULL),\r
-               m_bFindOnly(TRUE),\r
-               m_bFirstSearch(TRUE),\r
-               m_bMatchCase(FALSE),\r
-               m_bWholeWord(FALSE),\r
-               m_bFindDown(TRUE),\r
-               m_nInitialSearchPos(0),\r
-               m_hOldCursor(NULL)\r
-       {\r
-       }\r
-\r
-// Message Handlers\r
-       BEGIN_MSG_MAP(thisClass)\r
-       ALT_MSG_MAP(1)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               MESSAGE_HANDLER(TFindReplaceDialog::GetFindReplaceMsg(), OnFindReplaceCmd)\r
-               COMMAND_ID_HANDLER(ID_EDIT_FIND, OnEditFind)\r
-               COMMAND_ID_HANDLER(ID_EDIT_REPEAT, OnEditRepeat)\r
-               COMMAND_ID_HANDLER(ID_EDIT_REPLACE, OnEditReplace)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_pFindReplaceDialog != NULL)\r
-               {\r
-                       m_pFindReplaceDialog->SendMessage(WM_CLOSE);\r
-                       ATLASSERT(m_pFindReplaceDialog == NULL);\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnFindReplaceCmd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               TFindReplaceDialog* pDialog = TFindReplaceDialog::GetNotifier(lParam);\r
-               if(pDialog == NULL)\r
-               {\r
-                       ATLASSERT(FALSE);\r
-                       ::MessageBeep(MB_ICONERROR);\r
-                       return 1;\r
-               }\r
-               ATLASSERT(pDialog == m_pFindReplaceDialog);\r
-\r
-               LPFINDREPLACE findReplace = (LPFINDREPLACE)lParam;\r
-               if((m_pFindReplaceDialog != NULL) && (findReplace != NULL))\r
-               {\r
-                       if(pDialog->FindNext())\r
-                       {\r
-                               pT->OnFindNext(pDialog->GetFindString(), pDialog->SearchDown(),\r
-                                       pDialog->MatchCase(), pDialog->MatchWholeWord());\r
-                       }\r
-                       else if(pDialog->ReplaceCurrent())\r
-                       {\r
-                               pT->OnReplaceSel(pDialog->GetFindString(),\r
-                                       pDialog->SearchDown(), pDialog->MatchCase(), pDialog->MatchWholeWord(),\r
-                                       pDialog->GetReplaceString());\r
-                       }\r
-                       else if(pDialog->ReplaceAll())\r
-                       {\r
-                               pT->OnReplaceAll(pDialog->GetFindString(), pDialog->GetReplaceString(),\r
-                                       pDialog->MatchCase(), pDialog->MatchWholeWord());\r
-                       }\r
-                       else if(pDialog->IsTerminating())\r
-                       {\r
-                               // Dialog is going away (but hasn't gone away yet)\r
-                               // OnFinalMessage will "delete this"\r
-                               pT->OnTerminatingFindReplaceDialog(m_pFindReplaceDialog);\r
-                               m_pFindReplaceDialog = NULL;\r
-                       }\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditFind(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->FindReplace(TRUE);\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditRepeat(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               // If the user is holding down SHIFT when hitting F3, we'll\r
-               // search in reverse. Otherwise, we'll search forward.\r
-               // (be sure to have an accelerator mapped to ID_EDIT_REPEAT\r
-               // for both F3 and Shift+F3)\r
-               m_bFindDown = !((::GetKeyState(VK_SHIFT) & 0x8000) == 0x8000);\r
-\r
-               if(m_sFindNext.IsEmpty())\r
-               {\r
-                       pT->FindReplace(TRUE);\r
-               }\r
-               else\r
-               {\r
-                       if(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\r
-                               pT->TextNotFound(m_sFindNext);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEditReplace(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               DWORD style = pT->GetStyle();\r
-               if((style & ES_READONLY) != ES_READONLY)\r
-               {\r
-                       pT->FindReplace(FALSE);\r
-               }\r
-               else\r
-               {\r
-                       // Don't allow replace when the edit control is read only\r
-                       bHandled = FALSE;\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-// Operations (overrideable)\r
-       TFindReplaceDialog* CreateFindReplaceDialog(BOOL bFindOnly, // TRUE for Find, FALSE for FindReplace\r
-                       LPCTSTR lpszFindWhat,\r
-                       LPCTSTR lpszReplaceWith = NULL,\r
-                       DWORD dwFlags = FR_DOWN,\r
-                       HWND hWndParent = NULL)\r
-       {\r
-               // You can override all of this in a derived class\r
-\r
-               TFindReplaceDialog* findReplaceDialog = new TFindReplaceDialog();\r
-               if(findReplaceDialog == NULL)\r
-               {\r
-                       ::MessageBeep(MB_ICONHAND);\r
-               }\r
-               else\r
-               {\r
-                       HWND hWndFindReplace = findReplaceDialog->Create(bFindOnly,\r
-                               lpszFindWhat, lpszReplaceWith, dwFlags, hWndParent);\r
-                       if(hWndFindReplace == NULL)\r
-                       {\r
-                               delete findReplaceDialog;\r
-                               findReplaceDialog = NULL;\r
-                       }\r
-                       else\r
-                       {\r
-                               findReplaceDialog->SetActiveWindow();\r
-                               findReplaceDialog->ShowWindow(SW_SHOW);\r
-                       }\r
-               }\r
-\r
-               return findReplaceDialog;\r
-       }\r
-\r
-       void AdjustDialogPosition(HWND hWndDialog)\r
-       {\r
-               ATLASSERT((hWndDialog != NULL) && ::IsWindow(hWndDialog));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               LONG nStartChar = 0, nEndChar = 0;\r
-               // Send EM_GETSEL so we can use both Edit and RichEdit\r
-               // (CEdit::GetSel uses int&, and CRichEditCtrlT::GetSel uses LONG&)\r
-               ::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\r
-               POINT point = pT->PosFromChar(nStartChar);\r
-               ::ClientToScreen(pT->GetParent(), &point);\r
-               CRect rect;\r
-               ::GetWindowRect(hWndDialog, &rect);\r
-               if(rect.PtInRect(point))\r
-               {\r
-                       if(point.y > rect.Height())\r
-                       {\r
-                               rect.OffsetRect(0, point.y - rect.bottom - 20);\r
-                       }\r
-                       else\r
-                       {\r
-                               int nVertExt = GetSystemMetrics(SM_CYSCREEN);\r
-                               if(point.y + rect.Height() < nVertExt)\r
-                                       rect.OffsetRect(0, 40 + point.y - rect.top);\r
-                       }\r
-\r
-                       ::MoveWindow(hWndDialog, rect.left, rect.top, rect.Width(), rect.Height(), TRUE);\r
-               }\r
-       }\r
-\r
-       DWORD GetFindReplaceDialogFlags(void) const\r
-       {\r
-               DWORD dwFlags = 0;\r
-\r
-               if(m_bFindDown)\r
-                       dwFlags |= FR_DOWN;\r
-               if(m_bMatchCase)\r
-                       dwFlags |= FR_MATCHCASE;\r
-               if(m_bWholeWord)\r
-                       dwFlags |= FR_WHOLEWORD;\r
-\r
-               return dwFlags;\r
-       }\r
-\r
-       void FindReplace(BOOL bFindOnly)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               m_bFirstSearch = TRUE;\r
-               if(m_pFindReplaceDialog != NULL)\r
-               {\r
-                       if(m_bFindOnly == bFindOnly)\r
-                       {\r
-                               m_pFindReplaceDialog->SetActiveWindow();\r
-                               m_pFindReplaceDialog->ShowWindow(SW_SHOW);\r
-                               return;\r
-                       }\r
-                       else\r
-                       {\r
-                               m_pFindReplaceDialog->SendMessage(WM_CLOSE);\r
-                               ATLASSERT(m_pFindReplaceDialog == NULL);\r
-                       }\r
-               }\r
-\r
-               ATLASSERT(m_pFindReplaceDialog == NULL);\r
-\r
-               _CSTRING_NS::CString findNext;\r
-               pT->GetSelText(findNext);\r
-               // if selection is empty or spans multiple lines use old find text\r
-               if(findNext.IsEmpty() || (findNext.FindOneOf(_T("\n\r")) != -1))\r
-                       findNext = m_sFindNext;\r
-               _CSTRING_NS::CString replaceWith = m_sReplaceWith;\r
-               DWORD dwFlags = pT->GetFindReplaceDialogFlags();\r
-\r
-               m_pFindReplaceDialog = pT->CreateFindReplaceDialog(bFindOnly,\r
-                       findNext, replaceWith, dwFlags, pT->operator HWND());\r
-               ATLASSERT(m_pFindReplaceDialog != NULL);\r
-               if(m_pFindReplaceDialog != NULL)\r
-                       m_bFindOnly = bFindOnly;\r
-       }\r
-\r
-       BOOL SameAsSelected(LPCTSTR lpszCompare, BOOL bMatchCase, BOOL /*bWholeWord*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               // check length first\r
-               size_t nLen = lstrlen(lpszCompare);\r
-               LONG nStartChar = 0, nEndChar = 0;\r
-               // Send EM_GETSEL so we can use both Edit and RichEdit\r
-               // (CEdit::GetSel uses int&, and CRichEditCtrlT::GetSel uses LONG&)\r
-               ::SendMessage(pT->m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\r
-               if(nLen != (size_t)(nEndChar - nStartChar))\r
-                       return FALSE;\r
-\r
-               // length is the same, check contents\r
-               _CSTRING_NS::CString selectedText;\r
-               pT->GetSelText(selectedText);\r
-\r
-               return (bMatchCase && selectedText.Compare(lpszCompare) == 0) ||\r
-                       (!bMatchCase && selectedText.CompareNoCase(lpszCompare) == 0);\r
-       }\r
-\r
-       void TextNotFound(LPCTSTR lpszFind)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               m_bFirstSearch = TRUE;\r
-               pT->OnTextNotFound(lpszFind);\r
-       }\r
-\r
-       _CSTRING_NS::CString GetTranslationText(enum TranslationTextItem eItem) const\r
-       {\r
-               _CSTRING_NS::CString text;\r
-               switch(eItem)\r
-               {\r
-               case eText_OnReplaceAllMessage:\r
-                       text = _T("Replaced %d occurances of \"%s\" with \"%s\"");\r
-                       break;\r
-               case eText_OnReplaceAllTitle:\r
-                       text = _T("Replace All");\r
-                       break;\r
-               case eText_OnTextNotFoundMessage:\r
-                       text = _T("Unable to find the text \"%s\"");\r
-                       break;\r
-               case eText_OnTextNotFoundTitle:\r
-                       text = _T("Text not found");\r
-                       break;\r
-               }\r
-\r
-               return text;\r
-       }\r
-\r
-// Overrideable Handlers\r
-       void OnFindNext(LPCTSTR lpszFind, BOOL bFindDown, BOOL bMatchCase, BOOL bWholeWord)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               m_sFindNext = lpszFind;\r
-               m_bMatchCase = bMatchCase;\r
-               m_bWholeWord = bWholeWord;\r
-               m_bFindDown = bFindDown;\r
-\r
-               if(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\r
-                       pT->TextNotFound(m_sFindNext);\r
-               else\r
-                       pT->AdjustDialogPosition(m_pFindReplaceDialog->operator HWND());\r
-       }\r
-\r
-       void OnReplaceSel(LPCTSTR lpszFind, BOOL bFindDown, BOOL bMatchCase, BOOL bWholeWord, LPCTSTR lpszReplace)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               m_sFindNext = lpszFind;\r
-               m_sReplaceWith = lpszReplace;\r
-               m_bMatchCase = bMatchCase;\r
-               m_bWholeWord = bWholeWord;\r
-               m_bFindDown = bFindDown;\r
-\r
-               if(pT->SameAsSelected(m_sFindNext, m_bMatchCase, m_bWholeWord))\r
-                       pT->ReplaceSel(m_sReplaceWith);\r
-\r
-               if(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\r
-                       pT->TextNotFound(m_sFindNext);\r
-               else\r
-                       pT->AdjustDialogPosition(m_pFindReplaceDialog->operator HWND());\r
-       }\r
-\r
-       void OnReplaceAll(LPCTSTR lpszFind, LPCTSTR lpszReplace, BOOL bMatchCase, BOOL bWholeWord)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               m_sFindNext = lpszFind;\r
-               m_sReplaceWith = lpszReplace;\r
-               m_bMatchCase = bMatchCase;\r
-               m_bWholeWord = bWholeWord;\r
-               m_bFindDown = TRUE;\r
-\r
-               // no selection or different than what looking for\r
-               if(!pT->SameAsSelected(m_sFindNext, m_bMatchCase, m_bWholeWord))\r
-               {\r
-                       if(!pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown))\r
-                       {\r
-                               pT->TextNotFound(m_sFindNext);\r
-                               return;\r
-                       }\r
-               }\r
-\r
-               pT->OnReplaceAllCoreBegin();\r
-\r
-               int replaceCount=0;\r
-               do\r
-               {\r
-                       ++replaceCount;\r
-                       pT->ReplaceSel(m_sReplaceWith);\r
-               } while(pT->FindTextSimple(m_sFindNext, m_bMatchCase, m_bWholeWord, m_bFindDown));\r
-\r
-               pT->OnReplaceAllCoreEnd(replaceCount);\r
-       }\r
-\r
-       void OnReplaceAllCoreBegin()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               m_hOldCursor = ::SetCursor(::LoadCursor(NULL, IDC_WAIT));\r
-\r
-               pT->HideSelection(TRUE, FALSE);\r
-\r
-       }\r
-\r
-       void OnReplaceAllCoreEnd(int replaceCount)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->HideSelection(FALSE, FALSE);\r
-\r
-               ::SetCursor(m_hOldCursor);\r
-\r
-               _CSTRING_NS::CString message = pT->GetTranslationText(eText_OnReplaceAllMessage);\r
-               if(message.GetLength() > 0)\r
-               {\r
-                       _CSTRING_NS::CString formattedMessage;\r
-                       formattedMessage.Format(message,\r
-                               replaceCount, m_sFindNext, m_sReplaceWith);\r
-                       if(m_pFindReplaceDialog != NULL)\r
-                       {\r
-                               m_pFindReplaceDialog->MessageBox(formattedMessage,\r
-                                       pT->GetTranslationText(eText_OnReplaceAllTitle),\r
-                                       MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\r
-                       }\r
-                       else\r
-                       {\r
-                               pT->MessageBox(formattedMessage,\r
-                                       pT->GetTranslationText(eText_OnReplaceAllTitle),\r
-                                       MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\r
-                       }\r
-               }\r
-       }\r
-\r
-       void OnTextNotFound(LPCTSTR lpszFind)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               _CSTRING_NS::CString message = pT->GetTranslationText(eText_OnTextNotFoundMessage);\r
-               if(message.GetLength() > 0)\r
-               {\r
-                       _CSTRING_NS::CString formattedMessage;\r
-                       formattedMessage.Format(message, lpszFind);\r
-                       if(m_pFindReplaceDialog != NULL)\r
-                       {\r
-                               m_pFindReplaceDialog->MessageBox(formattedMessage,\r
-                                       pT->GetTranslationText(eText_OnTextNotFoundTitle),\r
-                                       MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\r
-                       }\r
-                       else\r
-                       {\r
-                               pT->MessageBox(formattedMessage,\r
-                                       pT->GetTranslationText(eText_OnTextNotFoundTitle),\r
-                                       MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       ::MessageBeep(MB_ICONHAND);\r
-               }\r
-       }\r
-\r
-       void OnTerminatingFindReplaceDialog(TFindReplaceDialog*& /*findReplaceDialog*/)\r
-       {\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CEditFindReplaceImpl - Mixin class for implementing Find/Replace for CEdit\r
-// based window classes.\r
-\r
-// Chain to CEditFindReplaceImpl message map. Your class must also derive from CEdit.\r
-// Example:\r
-// class CMyEdit : public CWindowImpl<CMyEdit, CEdit>,\r
-//                 public CEditFindReplaceImpl<CMyEdit>\r
-// {\r
-// public:\r
-//      BEGIN_MSG_MAP(CMyEdit)\r
-//              // your handlers...\r
-//              CHAIN_MSG_MAP_ALT(CEditFindReplaceImpl<CMyEdit>, 1)\r
-//      END_MSG_MAP()\r
-//      // other stuff...\r
-// };\r
-\r
-template <class T, class TFindReplaceDialog = CFindReplaceDialog>\r
-class CEditFindReplaceImpl : public CEditFindReplaceImplBase<T, TFindReplaceDialog>\r
-{\r
-protected:\r
-       typedef CEditFindReplaceImpl<T, TFindReplaceDialog> thisClass;\r
-       typedef CEditFindReplaceImplBase<T, TFindReplaceDialog> baseClass;\r
-\r
-// Data members\r
-       LPTSTR m_pShadowBuffer;     // Special shadow buffer only used in some cases.\r
-       UINT m_nShadowSize;\r
-       int m_bShadowBufferNeeded;  // TRUE, FALSE, < 0 => Need to check\r
-\r
-public:\r
-// Constructors\r
-       CEditFindReplaceImpl() :\r
-               m_pShadowBuffer(NULL),\r
-               m_nShadowSize(0),\r
-               m_bShadowBufferNeeded(-1)\r
-       {\r
-       }\r
-\r
-       virtual ~CEditFindReplaceImpl()\r
-       {\r
-               if(m_pShadowBuffer != NULL)\r
-               {\r
-                       delete [] m_pShadowBuffer;\r
-                       m_pShadowBuffer = NULL;\r
-               }\r
-       }\r
-\r
-// Message Handlers\r
-       BEGIN_MSG_MAP(thisClass)\r
-       ALT_MSG_MAP(1)\r
-               CHAIN_MSG_MAP_ALT(baseClass, 1)\r
-       END_MSG_MAP()\r
-\r
-// Operations\r
-       // Supported only for RichEdit, so this does nothing for Edit\r
-       void HideSelection(BOOL /*bHide*/ = TRUE, BOOL /*bChangeStyle*/ = FALSE)\r
-       {\r
-       }\r
-\r
-// Operations (overrideable)\r
-       BOOL FindTextSimple(LPCTSTR lpszFind, BOOL bMatchCase, BOOL bWholeWord, BOOL bFindDown = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               ATLASSERT(lpszFind != NULL);\r
-               ATLASSERT(*lpszFind != _T('\0'));\r
-\r
-               UINT nLen = pT->GetBufferLength();\r
-               int nStartChar = 0, nEndChar = 0;\r
-               pT->GetSel(nStartChar, nEndChar);\r
-               UINT nStart = nStartChar;\r
-               int iDir = bFindDown ? +1 : -1;\r
-\r
-               // can't find a match before the first character\r
-               if(nStart == 0 && iDir < 0)\r
-                       return FALSE;\r
-\r
-               LPCTSTR lpszText = pT->LockBuffer();\r
-\r
-               bool isDBCS = false;\r
-#ifdef _MBCS\r
-               CPINFO info = { 0 };\r
-               ::GetCPInfo(::GetOEMCP(), &info);\r
-               isDBCS = (info.MaxCharSize > 1);\r
-#endif\r
-\r
-               if(iDir < 0)\r
-               {\r
-                       // always go back one for search backwards\r
-                       nStart -= int((lpszText + nStart) - ::CharPrev(lpszText, lpszText + nStart));\r
-               }\r
-               else if(nStartChar != nEndChar && pT->SameAsSelected(lpszFind, bMatchCase, bWholeWord))\r
-               {\r
-                       // easy to go backward/forward with SBCS\r
-#ifndef _UNICODE\r
-                       if(::IsDBCSLeadByte(lpszText[nStart]))\r
-                               nStart++;\r
-#endif\r
-                       nStart += iDir;\r
-               }\r
-\r
-               // handle search with nStart past end of buffer\r
-               UINT nLenFind = ::lstrlen(lpszFind);\r
-               if(nStart + nLenFind - 1 >= nLen)\r
-               {\r
-                       if(iDir < 0 && nLen >= nLenFind)\r
-                       {\r
-                               if(isDBCS)\r
-                               {\r
-                                       // walk back to previous character n times\r
-                                       nStart = nLen;\r
-                                       int n = nLenFind;\r
-                                       while(n--)\r
-                                       {\r
-                                               nStart -= int((lpszText + nStart) - ::CharPrev(lpszText, lpszText + nStart));\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       // single-byte character set is easy and fast\r
-                                       nStart = nLen - nLenFind;\r
-                               }\r
-                               ATLASSERT(nStart + nLenFind - 1 <= nLen);\r
-                       }\r
-                       else\r
-                       {\r
-                               pT->UnlockBuffer();\r
-                               return FALSE;\r
-                       }\r
-               }\r
-\r
-               // start the search at nStart\r
-               LPCTSTR lpsz = lpszText + nStart;\r
-               typedef int (WINAPI* CompareProc)(LPCTSTR str1, LPCTSTR str2);\r
-               CompareProc pfnCompare = bMatchCase ? lstrcmp : lstrcmpi;\r
-\r
-               if(isDBCS)\r
-               {\r
-                       // double-byte string search\r
-                       LPCTSTR lpszStop = NULL;\r
-                       if(iDir > 0)\r
-                       {\r
-                               // start at current and find _first_ occurrance\r
-                               lpszStop = lpszText + nLen - nLenFind + 1;\r
-                       }\r
-                       else\r
-                       {\r
-                               // start at top and find _last_ occurrance\r
-                               lpszStop = lpsz;\r
-                               lpsz = lpszText;\r
-                       }\r
-\r
-                       LPCTSTR lpszFound = NULL;\r
-                       while(lpsz <= lpszStop)\r
-                       {\r
-#ifndef _UNICODE\r
-                               if(!bMatchCase || (*lpsz == *lpszFind && (!::IsDBCSLeadByte(*lpsz) || lpsz[1] == lpszFind[1])))\r
-#else\r
-                               if(!bMatchCase || (*lpsz == *lpszFind && lpsz[1] == lpszFind[1]))\r
-#endif\r
-                               {\r
-                                       LPTSTR lpch = (LPTSTR)(lpsz + nLenFind);\r
-                                       TCHAR chSave = *lpch;\r
-                                       *lpch = _T('\0');\r
-                                       int nResult = (*pfnCompare)(lpsz, lpszFind);\r
-                                       *lpch = chSave;\r
-                                       if(nResult == 0)\r
-                                       {\r
-                                               lpszFound = lpsz;\r
-                                               if(iDir > 0)\r
-                                                       break;\r
-                                       }\r
-                               }\r
-                               lpsz = ::CharNext(lpsz);\r
-                       }\r
-                       pT->UnlockBuffer();\r
-\r
-                       if(lpszFound != NULL)\r
-                       {\r
-                               int n = (int)(lpszFound - lpszText);\r
-                               pT->SetSel(n, n + nLenFind);\r
-                               return TRUE;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       // single-byte string search\r
-                       UINT nCompare;\r
-                       if(iDir < 0)\r
-                               nCompare = (UINT)(lpsz - lpszText) + 1;\r
-                       else\r
-                               nCompare = nLen - (UINT)(lpsz - lpszText) - nLenFind + 1;\r
-\r
-                       while(nCompare > 0)\r
-                       {\r
-                               ATLASSERT(lpsz >= lpszText);\r
-                               ATLASSERT(lpsz + nLenFind - 1 <= lpszText + nLen - 1);\r
-\r
-                               LPSTR lpch = (LPSTR)(lpsz + nLenFind);\r
-                               char chSave = *lpch;\r
-                               *lpch = '\0';\r
-                               int nResult = (*pfnCompare)(lpsz, lpszFind);\r
-                               *lpch = chSave;\r
-                               if(nResult == 0)\r
-                               {\r
-                                       pT->UnlockBuffer();\r
-                                       int n = (int)(lpsz - lpszText);\r
-                                       pT->SetSel(n, n + nLenFind);\r
-                                       return TRUE;\r
-                               }\r
-\r
-                               // restore character at end of search\r
-                               *lpch = chSave;\r
-\r
-                               // move on to next substring\r
-                               nCompare--;\r
-                               lpsz += iDir;\r
-                       }\r
-                       pT->UnlockBuffer();\r
-               }\r
-\r
-               return FALSE;\r
-       }\r
-\r
-       LPCTSTR LockBuffer() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-\r
-               ATLASSERT(pT->m_hWnd != NULL);\r
-\r
-               BOOL useShadowBuffer = pT->UseShadowBuffer();\r
-               if(useShadowBuffer)\r
-               {\r
-                       if(m_pShadowBuffer == NULL || pT->GetModify())\r
-                       {\r
-                               ATLASSERT(m_pShadowBuffer != NULL || m_nShadowSize == 0);\r
-                               UINT nSize = pT->GetWindowTextLength() + 1;\r
-                               if(nSize > m_nShadowSize)\r
-                               {\r
-                                       // need more room for shadow buffer\r
-                                       T* pThisNoConst = const_cast<T*>(pT);\r
-                                       delete[] m_pShadowBuffer;\r
-                                       pThisNoConst->m_pShadowBuffer = NULL;\r
-                                       pThisNoConst->m_nShadowSize = 0;\r
-                                       pThisNoConst->m_pShadowBuffer = new TCHAR[nSize];\r
-                                       pThisNoConst->m_nShadowSize = nSize;\r
-                               }\r
-\r
-                               // update the shadow buffer with GetWindowText\r
-                               ATLASSERT(m_nShadowSize >= nSize);\r
-                               ATLASSERT(m_pShadowBuffer != NULL);\r
-                               pT->GetWindowText(m_pShadowBuffer, nSize);\r
-                       }\r
-\r
-                       return m_pShadowBuffer;\r
-               }\r
-\r
-               HLOCAL hLocal = pT->GetHandle();\r
-               ATLASSERT(hLocal != NULL);\r
-               LPCTSTR lpszText = (LPCTSTR)::LocalLock(hLocal);\r
-               ATLASSERT(lpszText != NULL);\r
-\r
-               return lpszText;\r
-       }\r
-\r
-       void UnlockBuffer() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-\r
-               ATLASSERT(pT->m_hWnd != NULL);\r
-\r
-               BOOL useShadowBuffer = pT->UseShadowBuffer();\r
-               if(!useShadowBuffer)\r
-               {\r
-                       HLOCAL hLocal = pT->GetHandle();\r
-                       ATLASSERT(hLocal != NULL);\r
-                       ::LocalUnlock(hLocal);\r
-               }\r
-       }\r
-\r
-       UINT GetBufferLength() const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-\r
-               ATLASSERT(pT->m_hWnd != NULL);\r
-               UINT nLen = 0;\r
-               LPCTSTR lpszText = pT->LockBuffer();\r
-               if(lpszText != NULL)\r
-                       nLen = ::lstrlen(lpszText);\r
-               pT->UnlockBuffer();\r
-\r
-               return nLen;\r
-       }\r
-\r
-       LONG EndOfLine(LPCTSTR lpszText, UINT nLen, UINT nIndex) const\r
-       {\r
-               LPCTSTR lpsz = lpszText + nIndex;\r
-               LPCTSTR lpszStop = lpszText + nLen;\r
-               while(lpsz < lpszStop && *lpsz != _T('\r'))\r
-                       ++lpsz;\r
-               return LONG(lpsz - lpszText);\r
-       }\r
-\r
-       LONG GetSelText(_CSTRING_NS::CString& strText) const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-\r
-               int nStartChar = 0, nEndChar = 0;\r
-               pT->GetSel(nStartChar, nEndChar);\r
-               ATLASSERT((UINT)nEndChar <= pT->GetBufferLength());\r
-               LPCTSTR lpszText = pT->LockBuffer();\r
-               LONG nLen = pT->EndOfLine(lpszText, nEndChar, nStartChar) - nStartChar;\r
-               SecureHelper::memcpy_x(strText.GetBuffer(nLen), nLen * sizeof(TCHAR), lpszText + nStartChar, nLen * sizeof(TCHAR));\r
-               strText.ReleaseBuffer(nLen);\r
-               pT->UnlockBuffer();\r
-\r
-               return nLen;\r
-       }\r
-\r
-       BOOL UseShadowBuffer(void) const\r
-       {\r
-               const T* pT = static_cast<const T*>(this);\r
-\r
-               if(pT->m_bShadowBufferNeeded < 0)\r
-               {\r
-                       T* pThisNoConst = const_cast<T*>(pT);\r
-\r
-                       OSVERSIONINFO ovi = { 0 };\r
-                       ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\r
-                       ::GetVersionEx(&ovi);\r
-\r
-                       bool bWin9x = (ovi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);\r
-                       if(bWin9x)\r
-                       {\r
-                               // Windows 95, 98, ME\r
-                               // Under Win9x, it is necessary to maintain a shadow buffer.\r
-                               // It is only updated when the control contents have been changed.\r
-                               pThisNoConst->m_bShadowBufferNeeded = TRUE;\r
-                       }\r
-                       else\r
-                       {\r
-                               // Windows NT, 2000, XP, etc.\r
-                               pThisNoConst->m_bShadowBufferNeeded = FALSE;\r
-\r
-#ifndef _UNICODE\r
-                               // On Windows XP (or later), if common controls version 6 is in use\r
-                               // (such as via theming), then EM_GETHANDLE will always return a UNICODE string.\r
-                               // If theming is enabled and Common Controls version 6 is in use,\r
-                               // you're really not suppose to superclass or subclass common controls\r
-                               // with an ANSI windows procedure (so its best to only theme if you use UNICODE).\r
-                               // Using a shadow buffer uses GetWindowText instead, so it solves\r
-                               // this problem for us (although it makes it a little less efficient).\r
-\r
-                               if((ovi.dwMajorVersion == 5 && ovi.dwMinorVersion >= 1) || (ovi.dwMajorVersion > 5))\r
-                               {\r
-                                       // We use DLLVERSIONINFO_private so we don't have to depend on shlwapi.h\r
-                                       typedef struct _DLLVERSIONINFO_private\r
-                                       {\r
-                                               DWORD cbSize;\r
-                                               DWORD dwMajorVersion;\r
-                                               DWORD dwMinorVersion;\r
-                                               DWORD dwBuildNumber;\r
-                                               DWORD dwPlatformID;\r
-                                       } DLLVERSIONINFO_private;\r
-\r
-                                       HMODULE hModule = ::LoadLibrary("comctl32.dll");\r
-                                       if(hModule != NULL)\r
-                                       {\r
-                                               typedef HRESULT (CALLBACK *LPFN_DllGetVersion)(DLLVERSIONINFO_private *);\r
-                                               LPFN_DllGetVersion fnDllGetVersion = (LPFN_DllGetVersion)::GetProcAddress(hModule, "DllGetVersion");\r
-                                               if(fnDllGetVersion != NULL)\r
-                                               {\r
-                                                       DLLVERSIONINFO_private version = { 0 };\r
-                                                       version.cbSize = sizeof(DLLVERSIONINFO_private);\r
-                                                       if(SUCCEEDED(fnDllGetVersion(&version)))\r
-                                                       {\r
-                                                               if(version.dwMajorVersion >= 6)\r
-                                                               {\r
-                                                                       pThisNoConst->m_bShadowBufferNeeded = TRUE;\r
-\r
-                                                                       ATLTRACE2(atlTraceUI, 0, _T("Warning: You have compiled for MBCS/ANSI but are using common controls version 6 or later (likely through a manifest file).\r\n"));\r
-                                                                       ATLTRACE2(atlTraceUI, 0, _T("If you use common controls version 6 or later, you should only do so for UNICODE builds.\r\n"));\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-\r
-                                               ::FreeLibrary(hModule);\r
-                                               hModule = NULL;\r
-                                       }\r
-                               }\r
-#endif // !_UNICODE\r
-                       }\r
-               }\r
-\r
-               return (pT->m_bShadowBufferNeeded == TRUE);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRichEditFindReplaceImpl - Mixin class for implementing Find/Replace for CRichEditCtrl\r
-// based window classes.\r
-\r
-// Chain to CRichEditFindReplaceImpl message map. Your class must also derive from CRichEditCtrl.\r
-// Example:\r
-// class CMyRichEdit : public CWindowImpl<CMyRichEdit, CRichEditCtrl>,\r
-//                     public CRichEditFindReplaceImpl<CMyRichEdit>\r
-// {\r
-// public:\r
-//      BEGIN_MSG_MAP(CMyRichEdit)\r
-//              // your handlers...\r
-//              CHAIN_MSG_MAP_ALT(CRichEditFindReplaceImpl<CMyRichEdit>, 1)\r
-//      END_MSG_MAP()\r
-//      // other stuff...\r
-// };\r
-\r
-template <class T, class TFindReplaceDialog = CFindReplaceDialog>\r
-class CRichEditFindReplaceImpl : public CEditFindReplaceImplBase<T, TFindReplaceDialog>\r
-{\r
-protected:\r
-       typedef CRichEditFindReplaceImpl<T, TFindReplaceDialog> thisClass;\r
-       typedef CEditFindReplaceImplBase<T, TFindReplaceDialog> baseClass;\r
-\r
-public:\r
-       BEGIN_MSG_MAP(thisClass)\r
-       ALT_MSG_MAP(1)\r
-               CHAIN_MSG_MAP_ALT(baseClass, 1)\r
-       END_MSG_MAP()\r
-\r
-// Operations (overrideable)\r
-       BOOL FindTextSimple(LPCTSTR lpszFind, BOOL bMatchCase, BOOL bWholeWord, BOOL bFindDown = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-\r
-               ATLASSERT(lpszFind != NULL);\r
-               FINDTEXTEX ft = { 0 };\r
-\r
-               pT->GetSel(ft.chrg);\r
-               if(m_bFirstSearch)\r
-               {\r
-                       if(bFindDown)\r
-                               m_nInitialSearchPos = ft.chrg.cpMin;\r
-                       else\r
-                               m_nInitialSearchPos = ft.chrg.cpMax;\r
-                       m_bFirstSearch = FALSE;\r
-               }\r
-\r
-#if (_RICHEDIT_VER >= 0x0200)\r
-               ft.lpstrText = (LPTSTR)lpszFind;\r
-#else // !(_RICHEDIT_VER >= 0x0200)\r
-               USES_CONVERSION;\r
-               ft.lpstrText = T2A((LPTSTR)lpszFind);\r
-#endif // !(_RICHEDIT_VER >= 0x0200)\r
-\r
-               if(ft.chrg.cpMin != ft.chrg.cpMax) // i.e. there is a selection\r
-               {\r
-                       if(bFindDown)\r
-                       {\r
-                               ft.chrg.cpMin++;\r
-                       }\r
-                       else\r
-                       {\r
-                               // won't wraparound backwards\r
-                               ft.chrg.cpMin = max(ft.chrg.cpMin, 0);\r
-                       }\r
-               }\r
-\r
-               DWORD dwFlags = bMatchCase ? FR_MATCHCASE : 0;\r
-               dwFlags |= bWholeWord ? FR_WHOLEWORD : 0;\r
-\r
-               ft.chrg.cpMax = pT->GetTextLength() + m_nInitialSearchPos;\r
-\r
-               if(bFindDown)\r
-               {\r
-                       if(m_nInitialSearchPos >= 0)\r
-                               ft.chrg.cpMax = pT->GetTextLength();\r
-\r
-                       dwFlags |= FR_DOWN;\r
-                       ATLASSERT(ft.chrg.cpMax >= ft.chrg.cpMin);\r
-               }\r
-               else\r
-               {\r
-                       if(m_nInitialSearchPos >= 0)\r
-                               ft.chrg.cpMax = 0;\r
-\r
-                       dwFlags &= ~FR_DOWN;\r
-                       ATLASSERT(ft.chrg.cpMax <= ft.chrg.cpMin);\r
-               }\r
-\r
-               BOOL bRet = FALSE;\r
-\r
-               if(pT->FindAndSelect(dwFlags, ft) != -1)\r
-               {\r
-                       bRet = TRUE;   // we found the text\r
-               }\r
-               else if(m_nInitialSearchPos > 0)\r
-               {\r
-                       // if the original starting point was not the beginning\r
-                       // of the buffer and we haven't already been here\r
-                       if(bFindDown)\r
-                       {\r
-                               ft.chrg.cpMin = 0;\r
-                               ft.chrg.cpMax = m_nInitialSearchPos;\r
-                       }\r
-                       else\r
-                       {\r
-                               ft.chrg.cpMin = pT->GetTextLength();\r
-                               ft.chrg.cpMax = m_nInitialSearchPos;\r
-                       }\r
-                       m_nInitialSearchPos = m_nInitialSearchPos - pT->GetTextLength();\r
-\r
-                       bRet = (pT->FindAndSelect(dwFlags, ft) != -1) ? TRUE : FALSE;\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-       long FindAndSelect(DWORD dwFlags, FINDTEXTEX& ft)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               LONG index = pT->FindText(dwFlags, ft);\r
-               if(index != -1) // i.e. we found something\r
-                       pT->SetSel(ft.chrgText);\r
-\r
-               return index;\r
-       }\r
-};\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLFIND_H__\r
diff --git a/WTL80/include/atlframe.h b/WTL80/include/atlframe.h
deleted file mode 100644 (file)
index 7eb102f..0000000
+++ /dev/null
@@ -1,3465 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLFRAME_H__\r
-#define __ATLFRAME_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlframe.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atlframe.h requires atlwin.h to be included first\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CFrameWindowImpl<T, TBase, TWinTraits>\r
-// CMDIWindow\r
-// CMDIFrameWindowImpl<T, TBase, TWinTraits>\r
-// CMDIChildWindowImpl<T, TBase, TWinTraits>\r
-// COwnerDraw<T>\r
-// CUpdateUIBase\r
-// CUpdateUI<T>\r
-// CDynamicUpdateUI<T>\r
-// CDialogResize<T>\r
-// CDoubleBufferImpl<T>\r
-// CDoubleBufferWindowImpl<T, TBase, TWinTraits>\r
-//\r
-// Global functions:\r
-//   AtlCreateSimpleToolBar()\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFrameWndClassInfo - Manages frame window Windows class information\r
-\r
-class CFrameWndClassInfo\r
-{\r
-public:\r
-#ifndef _WIN32_WCE\r
-       enum { cchAutoName = 5 + sizeof(void*) * 2 };   // sizeof(void*) * 2 is the number of digits %p outputs\r
-       WNDCLASSEX m_wc;\r
-#else // CE specific\r
-       enum { cchAutoName = MAX_PATH };   // MAX_PATH because this can be set in the wizard generated CMainFrame::ActivatePreviousInstance to a user defined string.\r
-       WNDCLASS m_wc;\r
-#endif // !_WIN32_WCE\r
-       LPCTSTR m_lpszOrigName;\r
-       WNDPROC pWndProc;\r
-       LPCTSTR m_lpszCursorID;\r
-       BOOL m_bSystemCursor;\r
-       ATOM m_atom;\r
-       TCHAR m_szAutoName[cchAutoName];\r
-       UINT m_uCommonResourceID;\r
-\r
-#ifndef _WIN32_WCE\r
-       ATOM Register(WNDPROC* pProc)\r
-       {\r
-               if (m_atom == 0)\r
-               {\r
-                       CWindowCreateCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CFrameWndClassInfo::Register.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(m_atom == 0)\r
-                       {\r
-                               HINSTANCE hInst = ModuleHelper::GetModuleInstance();\r
-\r
-                               if (m_lpszOrigName != NULL)\r
-                               {\r
-                                       ATLASSERT(pProc != NULL);\r
-                                       LPCTSTR lpsz = m_wc.lpszClassName;\r
-                                       WNDPROC proc = m_wc.lpfnWndProc;\r
-\r
-                                       WNDCLASSEX wc = { 0 };\r
-                                       wc.cbSize = sizeof(WNDCLASSEX);\r
-                                       // try process local class first\r
-                                       if(!::GetClassInfoEx(ModuleHelper::GetModuleInstance(), m_lpszOrigName, &wc))\r
-                                       {\r
-                                               // try global class\r
-                                               if(!::GetClassInfoEx(NULL, m_lpszOrigName, &wc))\r
-                                               {\r
-                                                       lock.Unlock();\r
-                                                       return 0;\r
-                                               }\r
-                                       }\r
-                                       m_wc = wc;\r
-                                       pWndProc = m_wc.lpfnWndProc;\r
-                                       m_wc.lpszClassName = lpsz;\r
-                                       m_wc.lpfnWndProc = proc;\r
-                               }\r
-                               else\r
-                               {\r
-                                       m_wc.hCursor = ::LoadCursor(m_bSystemCursor ? NULL : hInst, m_lpszCursorID);\r
-                               }\r
-\r
-                               m_wc.hInstance = hInst;\r
-                               m_wc.style &= ~CS_GLOBALCLASS;   // we don't register global classes\r
-                               if (m_wc.lpszClassName == NULL)\r
-                               {\r
-#if (_WIN32_WINNT >= 0x0500) || defined(_WIN64)\r
-                                       SecureHelper::wsprintf_x(m_szAutoName, cchAutoName, _T("ATL:%p"), &m_wc);\r
-#else // !((_WIN32_WINNT >= 0x0500) || defined(_WIN64))\r
-                                       SecureHelper::wsprintf_x(m_szAutoName, cchAutoName, _T("ATL:%8.8X"), (DWORD_PTR)&m_wc);\r
-#endif // !((_WIN32_WINNT >= 0x0500) || defined(_WIN64))\r
-                                       m_wc.lpszClassName = m_szAutoName;\r
-                               }\r
-\r
-                               WNDCLASSEX wcTemp = m_wc;\r
-                               m_atom = (ATOM)::GetClassInfoEx(m_wc.hInstance, m_wc.lpszClassName, &wcTemp);\r
-                               if (m_atom == 0)\r
-                               {\r
-                                       if(m_uCommonResourceID != 0)   // use it if not zero\r
-                                       {\r
-                                               m_wc.hIcon = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(m_uCommonResourceID), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);\r
-                                               m_wc.hIconSm = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(m_uCommonResourceID), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);\r
-                                       }\r
-                                       m_atom = ::RegisterClassEx(&m_wc);\r
-                               }\r
-                       }\r
-\r
-                       lock.Unlock();\r
-               }\r
-\r
-               if (m_lpszOrigName != NULL)\r
-               {\r
-                       ATLASSERT(pProc != NULL);\r
-                       ATLASSERT(pWndProc != NULL);\r
-                       *pProc = pWndProc;\r
-               }\r
-\r
-               return m_atom;\r
-       }\r
-#else // CE specific\r
-       ATOM Register(WNDPROC* pProc)\r
-       {\r
-               if (m_atom == 0)\r
-               {\r
-                       CWindowCreateCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CFrameWndClassInfo::Register.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-\r
-                       if(m_atom == 0)\r
-                       {\r
-                               HINSTANCE hInst = ModuleHelper::GetModuleInstance();\r
-\r
-                               if (m_lpszOrigName != NULL)\r
-                               {\r
-                                       ATLASSERT(pProc != NULL);\r
-                                       LPCTSTR lpsz = m_wc.lpszClassName;\r
-                                       WNDPROC proc = m_wc.lpfnWndProc;\r
-\r
-                                       WNDCLASS wc = { 0 };\r
-                                       // try process local class first\r
-                                       if(!::GetClassInfo(ModuleHelper::GetModuleInstance(), m_lpszOrigName, &wc))\r
-                                       {\r
-                                               // try global class\r
-                                               if(!::GetClassInfo(NULL, m_lpszOrigName, &wc))\r
-                                               {\r
-                                                       lock.Unlock();\r
-                                                       return 0;\r
-                                               }\r
-                                       }\r
-                                       m_wc = wc;\r
-                                       pWndProc = m_wc.lpfnWndProc;\r
-                                       m_wc.lpszClassName = lpsz;\r
-                                       m_wc.lpfnWndProc = proc;\r
-                               }\r
-                               else\r
-                               {\r
-#if defined(GWES_CURSOR) || defined(GWES_MCURSOR)\r
-                                       m_wc.hCursor = ::LoadCursor(m_bSystemCursor ? NULL : hInst, m_lpszCursorID);\r
-#else // !(defined(GWES_CURSOR) || defined(GWES_MCURSOR))\r
-                                       m_wc.hCursor = NULL;\r
-#endif // !(defined(GWES_CURSOR) || defined(GWES_MCURSOR))\r
-                               }\r
-\r
-                               m_wc.hInstance = hInst;\r
-                               m_wc.style &= ~CS_GLOBALCLASS;   // we don't register global classes\r
-                               if (m_wc.lpszClassName == NULL)\r
-                               {\r
-                                       wsprintf(m_szAutoName, _T("ATL:%8.8X"), (DWORD_PTR)&m_wc);\r
-                                       m_wc.lpszClassName = m_szAutoName;\r
-                               }\r
-\r
-                               WNDCLASS wcTemp = m_wc;\r
-                               m_atom = (ATOM)::GetClassInfo(m_wc.hInstance, m_wc.lpszClassName, &wcTemp);\r
-                               if (m_atom == 0)\r
-                               {\r
-                                       if(m_uCommonResourceID != 0)   // use it if not zero\r
-                                               m_wc.hIcon = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(m_uCommonResourceID), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);\r
-                                       m_atom = ::RegisterClass(&m_wc);\r
-                               }\r
-                       }\r
-\r
-                       lock.Unlock();\r
-               }\r
-\r
-               if (m_lpszOrigName != NULL)\r
-               {\r
-                       ATLASSERT(pProc != NULL);\r
-                       ATLASSERT(pWndProc != NULL);\r
-                       *pProc = pWndProc;\r
-               }\r
-\r
-               return m_atom;\r
-       }\r
-#endif // _WIN32_WCE\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Macros for declaring frame window WNDCLASS\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-#define DECLARE_FRAME_WND_CLASS(WndClassName, uCommonResourceID) \\r
-static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static WTL::CFrameWndClassInfo wc = \\r
-       { \\r
-               { sizeof(WNDCLASSEX), 0, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, WndClassName, NULL }, \\r
-               NULL, NULL, IDC_ARROW, TRUE, 0, _T(""), uCommonResourceID \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#define DECLARE_FRAME_WND_CLASS_EX(WndClassName, uCommonResourceID, style, bkgnd) \\r
-static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static WTL::CFrameWndClassInfo wc = \\r
-       { \\r
-               { sizeof(WNDCLASSEX), style, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName, NULL }, \\r
-               NULL, NULL, IDC_ARROW, TRUE, 0, _T(""), uCommonResourceID \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#define DECLARE_FRAME_WND_SUPERCLASS(WndClassName, OrigWndClassName, uCommonResourceID) \\r
-static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static WTL::CFrameWndClassInfo wc = \\r
-       { \\r
-               { sizeof(WNDCLASSEX), 0, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, NULL, NULL, WndClassName, NULL }, \\r
-               OrigWndClassName, NULL, NULL, TRUE, 0, _T(""), uCommonResourceID \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#else // CE specific\r
-\r
-#define DECLARE_FRAME_WND_CLASS(WndClassName, uCommonResourceID) \\r
-static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static WTL::CFrameWndClassInfo wc = \\r
-       { \\r
-               { 0, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, WndClassName }, \\r
-               NULL, NULL, IDC_ARROW, TRUE, 0, _T(""), uCommonResourceID \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#define DECLARE_FRAME_WND_CLASS_EX(WndClassName, uCommonResourceID, style, bkgnd) \\r
-static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static WTL::CFrameWndClassInfo wc = \\r
-       { \\r
-               { style, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName }, \\r
-               NULL, NULL, IDC_ARROW, TRUE, 0, _T(""), uCommonResourceID \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#define DECLARE_FRAME_WND_SUPERCLASS(WndClassName, OrigWndClassName, uCommonResourceID) \\r
-static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-{ \\r
-       static WTL::CFrameWndClassInfo wc = \\r
-       { \\r
-               { NULL, StartWindowProc, \\r
-                 0, 0, NULL, NULL, NULL, NULL, NULL, WndClassName }, \\r
-               OrigWndClassName, NULL, IDC_ARROW, TRUE, 0, _T(""), uCommonResourceID \\r
-       }; \\r
-       return wc; \\r
-}\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFrameWindowImpl\r
-\r
-// Client window command chaining macro (only for frame windows)\r
-#define CHAIN_CLIENT_COMMANDS() \\r
-       if(uMsg == WM_COMMAND && m_hWndClient != NULL) \\r
-               ::SendMessage(m_hWndClient, uMsg, wParam, lParam);\r
-\r
-// standard toolbar styles\r
-#define ATL_SIMPLE_TOOLBAR_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS)\r
-// toolbar in a rebar pane\r
-#define ATL_SIMPLE_TOOLBAR_PANE_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NORESIZE | CCS_NOPARENTALIGN | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT)\r
-// standard rebar styles\r
-#if (_WIN32_IE >= 0x0400)\r
-  #define ATL_SIMPLE_REBAR_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | RBS_AUTOSIZE)\r
-#else\r
-  #define ATL_SIMPLE_REBAR_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS)\r
-#endif // !(_WIN32_IE >= 0x0400)\r
-// rebar without borders\r
-#if (_WIN32_IE >= 0x0400)\r
-  #define ATL_SIMPLE_REBAR_NOBORDER_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | RBS_AUTOSIZE | CCS_NODIVIDER)\r
-#else\r
-  #define ATL_SIMPLE_REBAR_NOBORDER_STYLE \\r
-       (WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | CCS_NODIVIDER)\r
-#endif // !(_WIN32_IE >= 0x0400)\r
-\r
-// command bar support\r
-#if !defined(__ATLCTRLW_H__) && !defined(_WIN32_WCE)\r
-\r
-#define CBRM_GETCMDBAR                 (WM_USER + 301) // returns command bar HWND\r
-#define CBRM_GETMENU                   (WM_USER + 302) // returns loaded or attached menu\r
-#define CBRM_TRACKPOPUPMENU            (WM_USER + 303) // displays a popup menu\r
-\r
-struct _AtlFrameWnd_CmdBarPopupMenu\r
-{\r
-       int cbSize;\r
-       HMENU hMenu;\r
-       UINT uFlags;\r
-       int x;\r
-       int y;\r
-       LPTPMPARAMS lptpm;\r
-};\r
-\r
-#define CBRPOPUPMENU _AtlFrameWnd_CmdBarPopupMenu\r
-\r
-#endif // !defined(__ATLCTRLW_H__) && !defined(_WIN32_WCE)\r
-\r
-\r
-template <class TBase = ATL::CWindow, class TWinTraits = ATL::CFrameWinTraits>\r
-class ATL_NO_VTABLE CFrameWindowImplBase : public ATL::CWindowImplBaseT< TBase, TWinTraits >\r
-{\r
-public:\r
-       DECLARE_FRAME_WND_CLASS(NULL, 0)\r
-\r
-// Data members\r
-       HWND m_hWndToolBar;\r
-       HWND m_hWndStatusBar;\r
-       HWND m_hWndClient;\r
-\r
-       HACCEL m_hAccel;\r
-\r
-#ifdef _WIN32_WCE\r
-       HWND m_hWndCECommandBar;\r
-#endif // _WIN32_WCE\r
-\r
-       struct _AtlToolBarData\r
-       {\r
-               WORD wVersion;\r
-               WORD wWidth;\r
-               WORD wHeight;\r
-               WORD wItemCount;\r
-               //WORD aItems[wItemCount]\r
-\r
-               WORD* items()\r
-                       { return (WORD*)(this+1); }\r
-       };\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       struct _ChevronMenuInfo\r
-       {\r
-               HMENU hMenu;\r
-               LPNMREBARCHEVRON lpnm;\r
-               bool bCmdBar;\r
-       };\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-// Constructor\r
-       CFrameWindowImplBase() : \r
-#ifdef _WIN32_WCE\r
-               m_hWndCECommandBar(NULL),\r
-#endif // _WIN32_WCE\r
-               m_hWndToolBar(NULL), \r
-               m_hWndStatusBar(NULL), \r
-               m_hWndClient(NULL), \r
-               m_hAccel(NULL)\r
-       { }\r
-\r
-// Methods\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, ATL::_U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)\r
-       {\r
-               ATLASSERT(m_hWnd == NULL);\r
-\r
-               if(atom == 0)\r
-                       return NULL;\r
-\r
-               ModuleHelper::AddCreateWndData(&m_thunk.cd, this);\r
-\r
-               if(MenuOrID.m_hMenu == NULL && (dwStyle & WS_CHILD))\r
-                       MenuOrID.m_hMenu = (HMENU)(UINT_PTR)this;\r
-               if(rect.m_lpRect == NULL)\r
-                       rect.m_lpRect = &TBase::rcDefault;\r
-\r
-               HWND hWnd = ::CreateWindowEx(dwExStyle, MAKEINTATOM(atom), szWindowName,\r
-                       dwStyle, rect.m_lpRect->left, rect.m_lpRect->top, rect.m_lpRect->right - rect.m_lpRect->left,\r
-                       rect.m_lpRect->bottom - rect.m_lpRect->top, hWndParent, MenuOrID.m_hMenu,\r
-                       ModuleHelper::GetModuleInstance(), lpCreateParam);\r
-\r
-               ATLASSERT(hWnd == NULL || m_hWnd == hWnd);\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       static HWND CreateSimpleToolBarCtrl(HWND hWndParent, UINT nResourceID, BOOL bInitialSeparator = FALSE, \r
-                       DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               HINSTANCE hInst = ModuleHelper::GetResourceInstance();\r
-               HRSRC hRsrc = ::FindResource(hInst, MAKEINTRESOURCE(nResourceID), RT_TOOLBAR);\r
-               if (hRsrc == NULL)\r
-                       return NULL;\r
-\r
-               HGLOBAL hGlobal = ::LoadResource(hInst, hRsrc);\r
-               if (hGlobal == NULL)\r
-                       return NULL;\r
-\r
-               _AtlToolBarData* pData = (_AtlToolBarData*)::LockResource(hGlobal);\r
-               if (pData == NULL)\r
-                       return NULL;\r
-               ATLASSERT(pData->wVersion == 1);\r
-\r
-               WORD* pItems = pData->items();\r
-               int nItems = pData->wItemCount + (bInitialSeparator ? 1 : 0);\r
-               CTempBuffer<TBBUTTON, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               TBBUTTON* pTBBtn = buff.Allocate(nItems);\r
-               ATLASSERT(pTBBtn != NULL);\r
-               if(pTBBtn == NULL)\r
-                       return NULL;\r
-\r
-               const int cxSeparator = 8;\r
-\r
-               // set initial separator (half width)\r
-               if(bInitialSeparator)\r
-               {\r
-                       pTBBtn[0].iBitmap = cxSeparator / 2;\r
-                       pTBBtn[0].idCommand = 0;\r
-                       pTBBtn[0].fsState = 0;\r
-                       pTBBtn[0].fsStyle = TBSTYLE_SEP;\r
-                       pTBBtn[0].dwData = 0;\r
-                       pTBBtn[0].iString = 0;\r
-               }\r
-\r
-               int nBmp = 0;\r
-               for(int i = 0, j = bInitialSeparator ? 1 : 0; i < pData->wItemCount; i++, j++)\r
-               {\r
-                       if(pItems[i] != 0)\r
-                       {\r
-                               pTBBtn[j].iBitmap = nBmp++;\r
-                               pTBBtn[j].idCommand = pItems[i];\r
-                               pTBBtn[j].fsState = TBSTATE_ENABLED;\r
-                               pTBBtn[j].fsStyle = TBSTYLE_BUTTON;\r
-                               pTBBtn[j].dwData = 0;\r
-                               pTBBtn[j].iString = 0;\r
-                       }\r
-                       else\r
-                       {\r
-                               pTBBtn[j].iBitmap = cxSeparator;\r
-                               pTBBtn[j].idCommand = 0;\r
-                               pTBBtn[j].fsState = 0;\r
-                               pTBBtn[j].fsStyle = TBSTYLE_SEP;\r
-                               pTBBtn[j].dwData = 0;\r
-                               pTBBtn[j].iString = 0;\r
-                       }\r
-               }\r
-\r
-#ifndef _WIN32_WCE\r
-               HWND hWnd = ::CreateWindowEx(0, TOOLBARCLASSNAME, NULL, dwStyle, 0, 0, 100, 100, hWndParent, (HMENU)LongToHandle(nID), ModuleHelper::GetModuleInstance(), NULL);\r
-               if(hWnd == NULL)\r
-               {\r
-                       ATLASSERT(FALSE);\r
-                       return NULL;\r
-               }\r
-#else // CE specific\r
-               dwStyle;\r
-               nID;\r
-               // The toolbar must go onto the existing CommandBar or MenuBar\r
-               HWND hWnd = hWndParent;\r
-#endif // _WIN32_WCE\r
-\r
-               ::SendMessage(hWnd, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0L);\r
-\r
-               // check if font is taller than our bitmaps\r
-               CFontHandle font = (HFONT)::SendMessage(hWnd, WM_GETFONT, 0, 0L);\r
-               if(font.IsNull())\r
-                       font = AtlGetDefaultGuiFont();\r
-               LOGFONT lf = { 0 };\r
-               font.GetLogFont(lf);\r
-               WORD cyFontHeight = (WORD)abs(lf.lfHeight);\r
-\r
-#ifndef _WIN32_WCE\r
-               WORD bitsPerPixel = AtlGetBitmapResourceBitsPerPixel(nResourceID);\r
-               if(bitsPerPixel > 4)\r
-               {\r
-                       COLORREF crMask = CLR_DEFAULT;\r
-                       if(bitsPerPixel == 32)\r
-                       {\r
-                               // 32-bit color bitmap with alpha channel (valid for Windows XP and later)\r
-                               crMask = CLR_NONE;\r
-                       }\r
-                       HIMAGELIST hImageList = ImageList_LoadImage(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(nResourceID), pData->wWidth, 1, crMask, IMAGE_BITMAP, LR_CREATEDIBSECTION | LR_DEFAULTSIZE);\r
-                       ATLASSERT(hImageList != NULL);\r
-                       ::SendMessage(hWnd, TB_SETIMAGELIST, 0, (LPARAM)hImageList);\r
-               }\r
-               else\r
-#endif // !_WIN32_WCE\r
-               {\r
-                       TBADDBITMAP tbab = { 0 };\r
-                       tbab.hInst = hInst;\r
-                       tbab.nID = nResourceID;\r
-                       ::SendMessage(hWnd, TB_ADDBITMAP, nBmp, (LPARAM)&tbab);\r
-               }\r
-\r
-               ::SendMessage(hWnd, TB_ADDBUTTONS, nItems, (LPARAM)pTBBtn);\r
-               ::SendMessage(hWnd, TB_SETBITMAPSIZE, 0, MAKELONG(pData->wWidth, max(pData->wHeight, cyFontHeight)));\r
-               const int cxyButtonMargin = 7;\r
-               ::SendMessage(hWnd, TB_SETBUTTONSIZE, 0, MAKELONG(pData->wWidth + cxyButtonMargin, max(pData->wHeight, cyFontHeight) + cxyButtonMargin));\r
-\r
-               return hWnd;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       static HWND CreateSimpleReBarCtrl(HWND hWndParent, DWORD dwStyle = ATL_SIMPLE_REBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               // Ensure style combinations for proper rebar painting\r
-               if(dwStyle & CCS_NODIVIDER && dwStyle & WS_BORDER)\r
-                       dwStyle &= ~WS_BORDER;\r
-               else if(!(dwStyle & WS_BORDER) && !(dwStyle & CCS_NODIVIDER))\r
-                       dwStyle |= CCS_NODIVIDER;\r
-\r
-               // Create rebar window\r
-               HWND hWndReBar = ::CreateWindowEx(0, REBARCLASSNAME, NULL, dwStyle, 0, 0, 100, 100, hWndParent, (HMENU)LongToHandle(nID), ModuleHelper::GetModuleInstance(), NULL);\r
-               if(hWndReBar == NULL)\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Failed to create rebar.\n"));\r
-                       return NULL;\r
-               }\r
-\r
-               // Initialize and send the REBARINFO structure\r
-               REBARINFO rbi = { 0 };\r
-               rbi.cbSize = sizeof(REBARINFO);\r
-               rbi.fMask  = 0;\r
-               if(!::SendMessage(hWndReBar, RB_SETBARINFO, 0, (LPARAM)&rbi))\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Failed to initialize rebar.\n"));\r
-                       ::DestroyWindow(hWndReBar);\r
-                       return NULL;\r
-               }\r
-\r
-               return hWndReBar;\r
-       }\r
-\r
-       BOOL CreateSimpleReBar(DWORD dwStyle = ATL_SIMPLE_REBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               ATLASSERT(!::IsWindow(m_hWndToolBar));\r
-               m_hWndToolBar = CreateSimpleReBarCtrl(m_hWnd, dwStyle, nID);\r
-               return (m_hWndToolBar != NULL);\r
-       }\r
-\r
-       static BOOL AddSimpleReBarBandCtrl(HWND hWndReBar, HWND hWndBand, int nID = 0, LPCTSTR lpstrTitle = NULL, BOOL bNewRow = FALSE, int cxWidth = 0, BOOL bFullWidthAlways = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(hWndReBar));   // must be already created\r
-#ifdef _DEBUG\r
-               // block - check if this is really a rebar\r
-               {\r
-                       TCHAR lpszClassName[sizeof(REBARCLASSNAME)] = { 0 };\r
-                       ::GetClassName(hWndReBar, lpszClassName, sizeof(REBARCLASSNAME));\r
-                       ATLASSERT(lstrcmp(lpszClassName, REBARCLASSNAME) == 0);\r
-               }\r
-#endif // _DEBUG\r
-               ATLASSERT(::IsWindow(hWndBand));   // must be already created\r
-\r
-               // Get number of buttons on the toolbar\r
-               int nBtnCount = (int)::SendMessage(hWndBand, TB_BUTTONCOUNT, 0, 0L);\r
-\r
-               // Set band info structure\r
-               REBARBANDINFO rbBand = { RunTimeHelper::SizeOf_REBARBANDINFO() };\r
-#if (_WIN32_IE >= 0x0400)\r
-               rbBand.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_ID | RBBIM_SIZE | RBBIM_IDEALSIZE;\r
-#else\r
-               rbBand.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_ID | RBBIM_SIZE;\r
-#endif // !(_WIN32_IE >= 0x0400)\r
-               if(lpstrTitle != NULL)\r
-                       rbBand.fMask |= RBBIM_TEXT;\r
-               rbBand.fStyle = RBBS_CHILDEDGE;\r
-#if (_WIN32_IE >= 0x0500)\r
-               if(nBtnCount > 0)   // add chevron style for toolbar with buttons\r
-                       rbBand.fStyle |= RBBS_USECHEVRON;\r
-#endif // (_WIN32_IE >= 0x0500)\r
-               if(bNewRow)\r
-                       rbBand.fStyle |= RBBS_BREAK;\r
-\r
-               rbBand.lpText = (LPTSTR)lpstrTitle;\r
-               rbBand.hwndChild = hWndBand;\r
-               if(nID == 0)   // calc band ID\r
-                       nID = ATL_IDW_BAND_FIRST + (int)::SendMessage(hWndReBar, RB_GETBANDCOUNT, 0, 0L);\r
-               rbBand.wID = nID;\r
-\r
-               // Calculate the size of the band\r
-               BOOL bRet = FALSE;\r
-               RECT rcTmp = { 0 };\r
-               if(nBtnCount > 0)\r
-               {\r
-                       bRet = (BOOL)::SendMessage(hWndBand, TB_GETITEMRECT, nBtnCount - 1, (LPARAM)&rcTmp);\r
-                       ATLASSERT(bRet);\r
-                       rbBand.cx = (cxWidth != 0) ? cxWidth : rcTmp.right;\r
-                       rbBand.cyMinChild = rcTmp.bottom - rcTmp.top;\r
-                       if(bFullWidthAlways)\r
-                       {\r
-                               rbBand.cxMinChild = rbBand.cx;\r
-                       }\r
-                       else if(lpstrTitle == NULL)\r
-                       {\r
-                               bRet = (BOOL)::SendMessage(hWndBand, TB_GETITEMRECT, 0, (LPARAM)&rcTmp);\r
-                               ATLASSERT(bRet);\r
-                               rbBand.cxMinChild = rcTmp.right;\r
-                       }\r
-                       else\r
-                       {\r
-                               rbBand.cxMinChild = 0;\r
-                       }\r
-               }\r
-               else    // no buttons, either not a toolbar or really has no buttons\r
-               {\r
-                       bRet = ::GetWindowRect(hWndBand, &rcTmp);\r
-                       ATLASSERT(bRet);\r
-                       rbBand.cx = (cxWidth != 0) ? cxWidth : (rcTmp.right - rcTmp.left);\r
-                       rbBand.cxMinChild = bFullWidthAlways ? rbBand.cx : 0;\r
-                       rbBand.cyMinChild = rcTmp.bottom - rcTmp.top;\r
-               }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-               rbBand.cxIdeal = rbBand.cx;\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-               // Add the band\r
-               LRESULT lRes = ::SendMessage(hWndReBar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);\r
-               if(lRes == 0)\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Failed to add a band to the rebar.\n"));\r
-                       return FALSE;\r
-               }\r
-\r
-#if (_WIN32_IE >= 0x0501)\r
-               DWORD dwExStyle = (DWORD)::SendMessage(hWndBand, TB_GETEXTENDEDSTYLE, 0, 0L);\r
-               ::SendMessage(hWndBand, TB_SETEXTENDEDSTYLE, 0, dwExStyle | TBSTYLE_EX_HIDECLIPPEDBUTTONS);\r
-#endif // (_WIN32_IE >= 0x0501)\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL AddSimpleReBarBand(HWND hWndBand, LPCTSTR lpstrTitle = NULL, BOOL bNewRow = FALSE, int cxWidth = 0, BOOL bFullWidthAlways = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndToolBar));   // must be an existing rebar\r
-               ATLASSERT(::IsWindow(hWndBand));        // must be created\r
-               return AddSimpleReBarBandCtrl(m_hWndToolBar, hWndBand, 0, lpstrTitle, bNewRow, cxWidth, bFullWidthAlways);\r
-       }\r
-\r
-#if (_WIN32_IE >= 0x0400)\r
-       void SizeSimpleReBarBands()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndToolBar));   // must be an existing rebar\r
-\r
-               int nCount = (int)::SendMessage(m_hWndToolBar, RB_GETBANDCOUNT, 0, 0L);\r
-\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       REBARBANDINFO rbBand = { RunTimeHelper::SizeOf_REBARBANDINFO() };\r
-                       rbBand.fMask = RBBIM_SIZE;\r
-                       BOOL bRet = (BOOL)::SendMessage(m_hWndToolBar, RB_GETBANDINFO, i, (LPARAM)&rbBand);\r
-                       ATLASSERT(bRet);\r
-                       RECT rect = { 0, 0, 0, 0 };\r
-                       ::SendMessage(m_hWndToolBar, RB_GETBANDBORDERS, i, (LPARAM)&rect);\r
-                       rbBand.cx += rect.left + rect.right;\r
-                       bRet = (BOOL)::SendMessage(m_hWndToolBar, RB_SETBANDINFO, i, (LPARAM)&rbBand);\r
-                       ATLASSERT(bRet);\r
-               }\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-#endif // _WIN32_WCE\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL CreateSimpleStatusBar(LPCTSTR lpstrText, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\r
-#else // CE specific\r
-       BOOL CreateSimpleStatusBar(LPCTSTR lpstrText, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, UINT nID = ATL_IDW_STATUS_BAR)\r
-#endif // _WIN32_WCE\r
-       {\r
-               ATLASSERT(!::IsWindow(m_hWndStatusBar));\r
-               m_hWndStatusBar = ::CreateStatusWindow(dwStyle, lpstrText, m_hWnd, nID);\r
-               return (m_hWndStatusBar != NULL);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL CreateSimpleStatusBar(UINT nTextID = ATL_IDS_IDLEMESSAGE, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP, UINT nID = ATL_IDW_STATUS_BAR)\r
-#else // CE specific\r
-       BOOL CreateSimpleStatusBar(UINT nTextID = ATL_IDS_IDLEMESSAGE, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, UINT nID = ATL_IDW_STATUS_BAR)\r
-#endif // _WIN32_WCE\r
-       {\r
-               const int cchMax = 128;   // max text length is 127 for status bars (+1 for null)\r
-               TCHAR szText[cchMax];\r
-               szText[0] = 0;\r
-               ::LoadString(ModuleHelper::GetResourceInstance(), nTextID, szText, cchMax);\r
-               return CreateSimpleStatusBar(szText, dwStyle, nID);\r
-       }\r
-\r
-#ifdef _WIN32_WCE\r
-       BOOL CreateSimpleCECommandBar(LPTSTR pszMenu = NULL, WORD iButton = 0, DWORD dwFlags = 0, int nCmdBarID = 1)\r
-       {\r
-               ATLASSERT(m_hWndCECommandBar == NULL);\r
-               ATLASSERT(m_hWndToolBar == NULL);\r
-\r
-               m_hWndCECommandBar = ::CommandBar_Create(ModuleHelper::GetModuleInstance(), m_hWnd, nCmdBarID);\r
-               if(m_hWndCECommandBar == NULL)\r
-                       return FALSE;\r
-\r
-               m_hWndToolBar = m_hWndCECommandBar;\r
-\r
-               BOOL bRet = TRUE;\r
-\r
-               if(pszMenu != NULL)\r
-                       bRet &= ::CommandBar_InsertMenubarEx(m_hWndCECommandBar, IS_INTRESOURCE(pszMenu) ? ModuleHelper::GetResourceInstance() : NULL, pszMenu, iButton);\r
-\r
-               bRet &= ::CommandBar_AddAdornments(m_hWndCECommandBar, dwFlags, 0);\r
-\r
-               return bRet;\r
-       }\r
-\r
-#if defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__)\r
-       BOOL CreateSimpleCEMenuBar(UINT nToolBarId = ATL_IDW_MENU_BAR, DWORD dwFlags = 0, int nBmpId = 0, int cBmpImages = 0)\r
-       {\r
-               ATLASSERT(m_hWndCECommandBar == NULL);\r
-\r
-               SHMENUBARINFO mbi = { 0 };\r
-               mbi.cbSize = sizeof(mbi);\r
-               mbi.hwndParent = m_hWnd;\r
-               mbi.dwFlags = dwFlags;\r
-               mbi.nToolBarId = nToolBarId;\r
-               mbi.hInstRes  = ModuleHelper::GetResourceInstance();\r
-               mbi.nBmpId = nBmpId;\r
-               mbi.cBmpImages = cBmpImages;\r
-               mbi.hwndMB = NULL;   // This gets set by SHCreateMenuBar\r
-\r
-               BOOL bRet = ::SHCreateMenuBar(&mbi);\r
-               if(bRet != FALSE)\r
-               {\r
-                       m_hWndCECommandBar = mbi.hwndMB;\r
-                       SizeToMenuBar();\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-       void SizeToMenuBar()   // for menu bar only\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(::IsWindow(m_hWndCECommandBar));\r
-\r
-               RECT rect = { 0 };\r
-               GetWindowRect(&rect);\r
-               RECT rectMB = { 0 };\r
-               ::GetWindowRect(m_hWndCECommandBar, &rectMB);\r
-               int cy = ::IsWindowVisible(m_hWndCECommandBar) ? rectMB.top - rect.top : rectMB.bottom - rect.top;\r
-               SetWindowPos(NULL, 0, 0, rect.right - rect.left, cy, SWP_NOZORDER | SWP_NOMOVE);\r
-       }\r
-#endif // defined(_AYGSHELL_H_) || defined(__AYGSHELL_H__)\r
-#endif // _WIN32_WCE\r
-\r
-       void UpdateLayout(BOOL bResizeBars = TRUE)\r
-       {\r
-               RECT rect = { 0 };\r
-               GetClientRect(&rect);\r
-\r
-               // position bars and offset their dimensions\r
-               UpdateBarsPosition(rect, bResizeBars);\r
-\r
-               // resize client window\r
-               if(m_hWndClient != NULL)\r
-                       ::SetWindowPos(m_hWndClient, NULL, rect.left, rect.top,\r
-                               rect.right - rect.left, rect.bottom - rect.top,\r
-                               SWP_NOZORDER | SWP_NOACTIVATE);\r
-       }\r
-\r
-       void UpdateBarsPosition(RECT& rect, BOOL bResizeBars = TRUE)\r
-       {\r
-               // resize toolbar\r
-               if(m_hWndToolBar != NULL && ((DWORD)::GetWindowLong(m_hWndToolBar, GWL_STYLE) & WS_VISIBLE))\r
-               {\r
-                       if(bResizeBars)\r
-                       {\r
-                               ::SendMessage(m_hWndToolBar, WM_SIZE, 0, 0);\r
-                               ::InvalidateRect(m_hWndToolBar, NULL, FALSE);\r
-                       }\r
-                       RECT rectTB = { 0 };\r
-                       ::GetWindowRect(m_hWndToolBar, &rectTB);\r
-                       rect.top += rectTB.bottom - rectTB.top;\r
-               }\r
-\r
-               // resize status bar\r
-               if(m_hWndStatusBar != NULL && ((DWORD)::GetWindowLong(m_hWndStatusBar, GWL_STYLE) & WS_VISIBLE))\r
-               {\r
-                       if(bResizeBars)\r
-                               ::SendMessage(m_hWndStatusBar, WM_SIZE, 0, 0);\r
-                       RECT rectSB = { 0 };\r
-                       ::GetWindowRect(m_hWndStatusBar, &rectSB);\r
-                       rect.bottom -= rectSB.bottom - rectSB.top;\r
-               }\r
-       }\r
-\r
-       BOOL PreTranslateMessage(MSG* pMsg)\r
-       {\r
-               if(m_hAccel != NULL && ::TranslateAccelerator(m_hWnd, m_hAccel, pMsg))\r
-                       return TRUE;\r
-               return FALSE;\r
-       }\r
-\r
-       BEGIN_MSG_MAP(CFrameWindowImplBase)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)\r
-#endif // !_WIN32_WCE\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-#ifndef _WIN32_WCE\r
-               NOTIFY_CODE_HANDLER(TTN_GETDISPINFOA, OnToolTipTextA)\r
-               NOTIFY_CODE_HANDLER(TTN_GETDISPINFOW, OnToolTipTextW)\r
-#endif // !_WIN32_WCE\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_hWndClient != NULL)   // view will paint itself instead\r
-                       return 1;\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnMenuSelect(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-\r
-               if(m_hWndStatusBar == NULL)\r
-                       return 1;\r
-\r
-               WORD wFlags = HIWORD(wParam);\r
-               if(wFlags == 0xFFFF && lParam == NULL)   // menu closing\r
-               {\r
-                       ::SendMessage(m_hWndStatusBar, SB_SIMPLE, FALSE, 0L);\r
-               }\r
-               else\r
-               {\r
-                       const int cchBuff = 256;\r
-                       TCHAR szBuff[cchBuff];\r
-                       szBuff[0] = 0;\r
-                       if(!(wFlags & MF_POPUP))\r
-                       {\r
-                               WORD wID = LOWORD(wParam);\r
-                               // check for special cases\r
-                               if(wID >= 0xF000 && wID < 0xF1F0)   // system menu IDs\r
-                                       wID = (WORD)(((wID - 0xF000) >> 4) + ATL_IDS_SCFIRST);\r
-                               else if(wID >= ID_FILE_MRU_FIRST && wID <= ID_FILE_MRU_LAST)   // MRU items\r
-                                       wID = ATL_IDS_MRU_FILE;\r
-                               else if(wID >= ATL_IDM_FIRST_MDICHILD && wID <= ATL_IDM_LAST_MDICHILD)   // MDI child windows\r
-                                       wID = ATL_IDS_MDICHILD;\r
-\r
-                               int nRet = ::LoadString(ModuleHelper::GetResourceInstance(), wID, szBuff, cchBuff);\r
-                               for(int i = 0; i < nRet; i++)\r
-                               {\r
-                                       if(szBuff[i] == _T('\n'))\r
-                                       {\r
-                                               szBuff[i] = 0;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       }\r
-                       ::SendMessage(m_hWndStatusBar, SB_SIMPLE, TRUE, 0L);\r
-                       ::SendMessage(m_hWndStatusBar, SB_SETTEXT, (255 | SBT_NOBORDERS), (LPARAM)szBuff);\r
-               }\r
-\r
-               return 1;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       LRESULT OnSetFocus(UINT, WPARAM, LPARAM, BOOL& bHandled)\r
-       {\r
-               if(m_hWndClient != NULL)\r
-                       ::SetFocus(m_hWndClient);\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT, WPARAM, LPARAM, BOOL& bHandled)\r
-       {\r
-               if((GetStyle() & (WS_CHILD | WS_POPUP)) == 0)\r
-                       ::PostQuitMessage(1);\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnToolTipTextA(int idCtrl, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               LPNMTTDISPINFOA pDispInfo = (LPNMTTDISPINFOA)pnmh;\r
-               pDispInfo->szText[0] = 0;\r
-\r
-               if((idCtrl != 0) && !(pDispInfo->uFlags & TTF_IDISHWND))\r
-               {\r
-                       const int cchBuff = 256;\r
-                       char szBuff[cchBuff];\r
-                       szBuff[0] = 0;\r
-                       int nRet = ::LoadStringA(ModuleHelper::GetResourceInstance(), idCtrl, szBuff, cchBuff);\r
-                       for(int i = 0; i < nRet; i++)\r
-                       {\r
-                               if(szBuff[i] == '\n')\r
-                               {\r
-                                       SecureHelper::strncpyA_x(pDispInfo->szText, _countof(pDispInfo->szText), &szBuff[i + 1], _TRUNCATE);\r
-                                       break;\r
-                               }\r
-                       }\r
-#if (_WIN32_IE >= 0x0300)\r
-                       if(nRet > 0)   // string was loaded, save it\r
-                               pDispInfo->uFlags |= TTF_DI_SETITEM;\r
-#endif // (_WIN32_IE >= 0x0300)\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnToolTipTextW(int idCtrl, LPNMHDR pnmh, BOOL& /*bHandled*/)\r
-       {\r
-               LPNMTTDISPINFOW pDispInfo = (LPNMTTDISPINFOW)pnmh;\r
-               pDispInfo->szText[0] = 0;\r
-\r
-               if((idCtrl != 0) && !(pDispInfo->uFlags & TTF_IDISHWND))\r
-               {\r
-                       const int cchBuff = 256;\r
-                       wchar_t szBuff[cchBuff];\r
-                       szBuff[0] = 0;\r
-                       int nRet = ::LoadStringW(ModuleHelper::GetResourceInstance(), idCtrl, szBuff, cchBuff);\r
-                       for(int i = 0; i < nRet; i++)\r
-                       {\r
-                               if(szBuff[i] == L'\n')\r
-                               {\r
-                                       SecureHelper::strncpyW_x(pDispInfo->szText, _countof(pDispInfo->szText), &szBuff[i + 1], _TRUNCATE);\r
-                                       break;\r
-                               }\r
-                       }\r
-#if (_WIN32_IE >= 0x0300)\r
-                       if(nRet > 0)   // string was loaded, save it\r
-                               pDispInfo->uFlags |= TTF_DI_SETITEM;\r
-#endif // (_WIN32_IE >= 0x0300)\r
-               }\r
-\r
-               return 0;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Implementation - chevron menu support\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       bool PrepareChevronMenu(_ChevronMenuInfo& cmi)\r
-       {\r
-               // get rebar and toolbar\r
-               REBARBANDINFO rbbi = { RunTimeHelper::SizeOf_REBARBANDINFO() };\r
-               rbbi.fMask = RBBIM_CHILD;\r
-               BOOL bRet = (BOOL)::SendMessage(cmi.lpnm->hdr.hwndFrom, RB_GETBANDINFO, cmi.lpnm->uBand, (LPARAM)&rbbi);\r
-               ATLASSERT(bRet);\r
-\r
-               // assume the band is a toolbar\r
-               ATL::CWindow wnd = rbbi.hwndChild;\r
-               int nCount = (int)wnd.SendMessage(TB_BUTTONCOUNT);\r
-               if(nCount <= 0)   // probably not a toolbar\r
-                       return false;\r
-\r
-               // check if it's a command bar\r
-               CMenuHandle menuCmdBar = (HMENU)wnd.SendMessage(CBRM_GETMENU);\r
-               cmi.bCmdBar = (menuCmdBar.m_hMenu != NULL);\r
-\r
-               // build a menu from hidden items\r
-               CMenuHandle menu;\r
-               bRet = menu.CreatePopupMenu();\r
-               ATLASSERT(bRet);\r
-               RECT rcClient = { 0 };\r
-               bRet = wnd.GetClientRect(&rcClient);\r
-               ATLASSERT(bRet);\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       TBBUTTON tbb = { 0 };\r
-                       bRet = (BOOL)wnd.SendMessage(TB_GETBUTTON, i, (LPARAM)&tbb);\r
-                       ATLASSERT(bRet);\r
-                       // skip hidden buttons\r
-                       if((tbb.fsState & TBSTATE_HIDDEN) != 0)\r
-                               continue;\r
-                       RECT rcButton = { 0 };\r
-                       bRet = (BOOL)wnd.SendMessage(TB_GETITEMRECT, i, (LPARAM)&rcButton);\r
-                       ATLASSERT(bRet);\r
-                       bool bEnabled = ((tbb.fsState & TBSTATE_ENABLED) != 0);\r
-                       if(rcButton.right > rcClient.right)\r
-                       {\r
-                               if(tbb.fsStyle & BTNS_SEP)\r
-                               {\r
-                                       if(menu.GetMenuItemCount() > 0)\r
-                                               menu.AppendMenu(MF_SEPARATOR);\r
-                               }\r
-                               else if(cmi.bCmdBar)\r
-                               {\r
-                                       const int cchBuff = 200;\r
-                                       TCHAR szBuff[cchBuff] = { 0 };\r
-                                       CMenuItemInfo mii;\r
-                                       mii.fMask = MIIM_TYPE | MIIM_SUBMENU;\r
-                                       mii.dwTypeData = szBuff;\r
-                                       mii.cch = cchBuff;\r
-                                       bRet = menuCmdBar.GetMenuItemInfo(i, TRUE, &mii);\r
-                                       ATLASSERT(bRet);\r
-                                       // Note: CmdBar currently supports only drop-down items\r
-                                       ATLASSERT(::IsMenu(mii.hSubMenu));\r
-                                       bRet = menu.AppendMenu(MF_STRING | MF_POPUP | (bEnabled ? MF_ENABLED : MF_GRAYED), (UINT_PTR)mii.hSubMenu, mii.dwTypeData);\r
-                                       ATLASSERT(bRet);\r
-                               }\r
-                               else\r
-                               {\r
-                                       // get button's text\r
-                                       const int cchBuff = 200;\r
-                                       TCHAR szBuff[cchBuff] = { 0 };\r
-                                       LPTSTR lpstrText = szBuff;\r
-                                       TBBUTTONINFO tbbi = { 0 };\r
-                                       tbbi.cbSize = sizeof(TBBUTTONINFO);\r
-                                       tbbi.dwMask = TBIF_TEXT;\r
-                                       tbbi.pszText = szBuff;\r
-                                       tbbi.cchText = cchBuff;\r
-                                       if(wnd.SendMessage(TB_GETBUTTONINFO, tbb.idCommand, (LPARAM)&tbbi) == -1 || lstrlen(szBuff) == 0)\r
-                                       {\r
-                                               // no text for this button, try a resource string\r
-                                               lpstrText = _T("");\r
-                                               int nRet = ::LoadString(ModuleHelper::GetResourceInstance(), tbb.idCommand, szBuff, cchBuff);\r
-                                               for(int n = 0; n < nRet; n++)\r
-                                               {\r
-                                                       if(szBuff[n] == _T('\n'))\r
-                                                       {\r
-                                                               lpstrText = &szBuff[n + 1];\r
-                                                               break;\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                                       bRet = menu.AppendMenu(MF_STRING | (bEnabled ? MF_ENABLED : MF_GRAYED), tbb.idCommand, lpstrText);\r
-                                       ATLASSERT(bRet);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               if(menu.GetMenuItemCount() == 0)   // no hidden buttons after all\r
-               {\r
-                       menu.DestroyMenu();\r
-                       ::MessageBeep((UINT)-1);\r
-                       return false;\r
-               }\r
-\r
-               cmi.hMenu = menu;\r
-               return true;\r
-       }\r
-\r
-       void DisplayChevronMenu(_ChevronMenuInfo& cmi)\r
-       {\r
-#ifndef TPM_VERPOSANIMATION\r
-               const UINT TPM_VERPOSANIMATION = 0x1000L;   // Menu animation flag\r
-#endif\r
-               // convert chevron rect to screen coordinates\r
-               ATL::CWindow wndFrom = cmi.lpnm->hdr.hwndFrom;\r
-               POINT pt = { cmi.lpnm->rc.left, cmi.lpnm->rc.bottom };\r
-               wndFrom.MapWindowPoints(NULL, &pt, 1);\r
-               RECT rc = cmi.lpnm->rc;\r
-               wndFrom.MapWindowPoints(NULL, &rc);\r
-               // set up flags and rect\r
-               UINT uMenuFlags = TPM_LEFTBUTTON | TPM_VERTICAL | TPM_LEFTALIGN | TPM_TOPALIGN | (!AtlIsOldWindows() ? TPM_VERPOSANIMATION : 0);\r
-               TPMPARAMS TPMParams = { 0 };\r
-               TPMParams.cbSize = sizeof(TPMPARAMS);\r
-               TPMParams.rcExclude = rc;\r
-               // check if this window has a command bar\r
-               HWND hWndCmdBar = (HWND)::SendMessage(m_hWnd, CBRM_GETCMDBAR, 0, 0L);\r
-               if(::IsWindow(hWndCmdBar))\r
-               {\r
-                       CBRPOPUPMENU CBRPopupMenu = { sizeof(CBRPOPUPMENU), cmi.hMenu, uMenuFlags, pt.x, pt.y, &TPMParams };\r
-                       ::SendMessage(hWndCmdBar, CBRM_TRACKPOPUPMENU, 0, (LPARAM)&CBRPopupMenu);\r
-               }\r
-               else\r
-               {\r
-                       CMenuHandle menu = cmi.hMenu;\r
-                       menu.TrackPopupMenuEx(uMenuFlags, pt.x, pt.y, m_hWnd, &TPMParams);\r
-               }\r
-       }\r
-\r
-       void CleanupChevronMenu(_ChevronMenuInfo& cmi)\r
-       {\r
-               CMenuHandle menu = cmi.hMenu;\r
-               // if menu is from a command bar, detach submenus so they are not destroyed\r
-               if(cmi.bCmdBar)\r
-               {\r
-                       for(int i = menu.GetMenuItemCount() - 1; i >=0; i--)\r
-                               menu.RemoveMenu(i, MF_BYPOSITION);\r
-               }\r
-               // destroy menu\r
-               menu.DestroyMenu();\r
-               // convert chevron rect to screen coordinates\r
-               ATL::CWindow wndFrom = cmi.lpnm->hdr.hwndFrom;\r
-               RECT rc = cmi.lpnm->rc;\r
-               wndFrom.MapWindowPoints(NULL, &rc);\r
-               // eat next message if click is on the same button\r
-               MSG msg = { 0 };\r
-               if(::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE) && ::PtInRect(&rc, msg.pt))\r
-                       ::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-};\r
-\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CFrameWinTraits>\r
-class ATL_NO_VTABLE CFrameWindowImpl : public CFrameWindowImplBase< TBase, TWinTraits >\r
-{\r
-public:\r
-       HWND Create(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       HMENU hMenu = NULL, LPVOID lpCreateParam = NULL)\r
-       {\r
-               ATOM atom = T::GetWndClassInfo().Register(&m_pfnSuperWindowProc);\r
-\r
-               dwStyle = T::GetWndStyle(dwStyle);\r
-               dwExStyle = T::GetWndExStyle(dwExStyle);\r
-\r
-               if(rect.m_lpRect == NULL)\r
-                       rect.m_lpRect = &TBase::rcDefault;\r
-\r
-               return CFrameWindowImplBase< TBase, TWinTraits >::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, hMenu, atom, lpCreateParam);\r
-       }\r
-\r
-       HWND CreateEx(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               const int cchName = 256;\r
-               TCHAR szWindowName[cchName];\r
-               szWindowName[0] = 0;\r
-#ifndef _WIN32_WCE\r
-               ::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\r
-               HMENU hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\r
-#else // CE specific\r
-               ::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\r
-\r
-               // This always needs to be NULL for Windows CE.\r
-               // Frame Window menus have to go onto the CommandBar.\r
-               // Use CreateSimpleCECommandBar\r
-               HMENU hMenu = NULL;\r
-#endif // _WIN32_WCE\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               HWND hWnd = pT->Create(hWndParent, rect, szWindowName, dwStyle, dwExStyle, hMenu, lpCreateParam);\r
-\r
-               if(hWnd != NULL)\r
-                       m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       BOOL CreateSimpleToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               if(nResourceID == 0)\r
-                       nResourceID = T::GetWndClassInfo().m_uCommonResourceID;\r
-#ifndef _WIN32_WCE\r
-               ATLASSERT(!::IsWindow(m_hWndToolBar));\r
-               m_hWndToolBar = T::CreateSimpleToolBarCtrl(m_hWnd, nResourceID, TRUE, dwStyle, nID);\r
-               return (m_hWndToolBar != NULL);\r
-#else // CE specific\r
-               HWND hWnd= T::CreateSimpleToolBarCtrl(m_hWndCECommandBar, nResourceID, TRUE, dwStyle, nID);\r
-               return (hWnd != NULL);\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-#ifdef _WIN32_WCE\r
-       // CE specific variant that returns the handle of the toolbar\r
-       HWND CreateSimpleCEToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               if(nResourceID == 0)\r
-                       nResourceID = T::GetWndClassInfo().m_uCommonResourceID;\r
-\r
-               return T::CreateSimpleToolBarCtrl(m_hWndCECommandBar, nResourceID, TRUE, dwStyle, nID);\r
-       }\r
-#endif // _WIN32_WCE\r
-\r
-// message map and handlers\r
-       typedef CFrameWindowImplBase< TBase, TWinTraits >   _baseClass;\r
-\r
-       BEGIN_MSG_MAP(CFrameWindowImpl)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-#ifndef _ATL_NO_REBAR_SUPPORT\r
-#if (_WIN32_IE >= 0x0400)\r
-               NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnReBarAutoSize)\r
-#endif // (_WIN32_IE >= 0x0400)\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-               NOTIFY_CODE_HANDLER(RBN_CHEVRONPUSHED, OnChevronPushed)\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-#endif // !_ATL_NO_REBAR_SUPPORT\r
-               CHAIN_MSG_MAP(_baseClass)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(wParam != SIZE_MINIMIZED)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateLayout();\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-#ifndef _ATL_NO_REBAR_SUPPORT\r
-#if (_WIN32_IE >= 0x0400)\r
-       LRESULT OnReBarAutoSize(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout(FALSE);\r
-               return 0;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-       LRESULT OnChevronPushed(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               _ChevronMenuInfo cmi = { NULL, (LPNMREBARCHEVRON)pnmh, false };\r
-               if(!pT->PrepareChevronMenu(cmi))\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-               // display a popup menu with hidden items\r
-               pT->DisplayChevronMenu(cmi);\r
-               // cleanup\r
-               pT->CleanupChevronMenu(cmi);\r
-               return 0;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500) && !defined(_WIN32_WCE)\r
-#endif // !_ATL_NO_REBAR_SUPPORT\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// AtlCreateSimpleToolBar - helper for creating simple toolbars\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-inline HWND AtlCreateSimpleToolBar(HWND hWndParent, UINT nResourceID, BOOL bInitialSeparator = FALSE, \r
-               DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-{\r
-       return CFrameWindowImplBase<>::CreateSimpleToolBarCtrl(hWndParent, nResourceID, bInitialSeparator, dwStyle, nID);\r
-}\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMDIWindow\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-#ifndef _WTL_MDIWINDOWMENU_TEXT\r
-#define _WTL_MDIWINDOWMENU_TEXT        _T("&Window")\r
-#endif\r
-\r
-class CMDIWindow : public ATL::CWindow\r
-{\r
-public:\r
-// Data members\r
-       HWND m_hWndMDIClient;\r
-       HMENU m_hMenu;\r
-\r
-// Constructors\r
-       CMDIWindow(HWND hWnd = NULL) : ATL::CWindow(hWnd), m_hWndMDIClient(NULL), m_hMenu(NULL)\r
-       { }\r
-\r
-       CMDIWindow& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// Operations\r
-       HWND MDIGetActive(BOOL* lpbMaximized = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               return (HWND)::SendMessage(m_hWndMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)lpbMaximized);\r
-       }\r
-\r
-       void MDIActivate(HWND hWndChildToActivate)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               ATLASSERT(::IsWindow(hWndChildToActivate));\r
-               ::SendMessage(m_hWndMDIClient, WM_MDIACTIVATE, (WPARAM)hWndChildToActivate, 0);\r
-       }\r
-\r
-       void MDINext(HWND hWndChild, BOOL bPrevious = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               ATLASSERT(hWndChild == NULL || ::IsWindow(hWndChild));\r
-               ::SendMessage(m_hWndMDIClient, WM_MDINEXT, (WPARAM)hWndChild, (LPARAM)bPrevious);\r
-       }\r
-\r
-       void MDIMaximize(HWND hWndChildToMaximize)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               ATLASSERT(::IsWindow(hWndChildToMaximize));\r
-               ::SendMessage(m_hWndMDIClient, WM_MDIMAXIMIZE, (WPARAM)hWndChildToMaximize, 0);\r
-       }\r
-\r
-       void MDIRestore(HWND hWndChildToRestore)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               ATLASSERT(::IsWindow(hWndChildToRestore));\r
-               ::SendMessage(m_hWndMDIClient, WM_MDIRESTORE, (WPARAM)hWndChildToRestore, 0);\r
-       }\r
-\r
-       void MDIDestroy(HWND hWndChildToDestroy)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               ATLASSERT(::IsWindow(hWndChildToDestroy));\r
-               ::SendMessage(m_hWndMDIClient, WM_MDIDESTROY, (WPARAM)hWndChildToDestroy, 0);\r
-       }\r
-\r
-       BOOL MDICascade(UINT uFlags = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               return (BOOL)::SendMessage(m_hWndMDIClient, WM_MDICASCADE, (WPARAM)uFlags, 0);\r
-       }\r
-\r
-       BOOL MDITile(UINT uFlags = MDITILE_HORIZONTAL)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               return (BOOL)::SendMessage(m_hWndMDIClient, WM_MDITILE, (WPARAM)uFlags, 0);\r
-       }\r
-\r
-       void MDIIconArrange()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               ::SendMessage(m_hWndMDIClient, WM_MDIICONARRANGE, 0, 0);\r
-       }\r
-\r
-       HMENU MDISetMenu(HMENU hMenuFrame, HMENU hMenuWindow)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               return (HMENU)::SendMessage(m_hWndMDIClient, WM_MDISETMENU, (WPARAM)hMenuFrame, (LPARAM)hMenuWindow);\r
-       }\r
-\r
-       HMENU MDIRefreshMenu()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-               return (HMENU)::SendMessage(m_hWndMDIClient, WM_MDIREFRESHMENU, 0, 0);\r
-       }\r
-\r
-// Additional operations\r
-       static HMENU GetStandardWindowMenu(HMENU hMenu)\r
-       {\r
-               int nCount = ::GetMenuItemCount(hMenu);\r
-               if(nCount == -1)\r
-                       return NULL;\r
-               int nLen = ::GetMenuString(hMenu, nCount - 2, NULL, 0, MF_BYPOSITION);\r
-               if(nLen == 0)\r
-                       return NULL;\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpszText = buff.Allocate(nLen + 1);\r
-               if(lpszText == NULL)\r
-                       return NULL;\r
-               if(::GetMenuString(hMenu, nCount - 2, lpszText, nLen + 1, MF_BYPOSITION) != nLen)\r
-                       return NULL;\r
-               if(lstrcmp(lpszText, _WTL_MDIWINDOWMENU_TEXT) != 0)\r
-                       return NULL;\r
-               return ::GetSubMenu(hMenu, nCount - 2);\r
-       }\r
-\r
-       void SetMDIFrameMenu()\r
-       {\r
-               HMENU hWindowMenu = GetStandardWindowMenu(m_hMenu);\r
-               MDISetMenu(m_hMenu, hWindowMenu);\r
-               MDIRefreshMenu();\r
-               ::DrawMenuBar(GetMDIFrame());\r
-       }\r
-\r
-       HWND GetMDIFrame() const\r
-       {\r
-               return ::GetParent(m_hWndMDIClient);\r
-       }\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMDIFrameWindowImpl\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-// MDI child command chaining macro (only for MDI frame windows)\r
-#define CHAIN_MDI_CHILD_COMMANDS() \\r
-       if(uMsg == WM_COMMAND) \\r
-       { \\r
-               HWND hWndChild = MDIGetActive(); \\r
-               if(hWndChild != NULL) \\r
-                       ::SendMessage(hWndChild, uMsg, wParam, lParam); \\r
-       }\r
-\r
-template <class T, class TBase = CMDIWindow, class TWinTraits = ATL::CFrameWinTraits>\r
-class ATL_NO_VTABLE CMDIFrameWindowImpl : public CFrameWindowImplBase<TBase, TWinTraits >\r
-{\r
-public:\r
-       HWND Create(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       HMENU hMenu = NULL, LPVOID lpCreateParam = NULL)\r
-       {\r
-               m_hMenu = hMenu;\r
-               ATOM atom = T::GetWndClassInfo().Register(&m_pfnSuperWindowProc);\r
-\r
-               dwStyle = T::GetWndStyle(dwStyle);\r
-               dwExStyle = T::GetWndExStyle(dwExStyle);\r
-\r
-               if(rect.m_lpRect == NULL)\r
-                       rect.m_lpRect = &TBase::rcDefault;\r
-\r
-               return CFrameWindowImplBase<TBase, TWinTraits >::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, hMenu, atom, lpCreateParam);\r
-       }\r
-\r
-       HWND CreateEx(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               const int cchName = 256;\r
-               TCHAR szWindowName[cchName];\r
-               szWindowName[0] = 0;\r
-               ::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\r
-               HMENU hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               HWND hWnd = pT->Create(hWndParent, rect, szWindowName, dwStyle, dwExStyle, hMenu, lpCreateParam);\r
-\r
-               if(hWnd != NULL)\r
-                       m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       BOOL CreateSimpleToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               ATLASSERT(!::IsWindow(m_hWndToolBar));\r
-               if(nResourceID == 0)\r
-                       nResourceID = T::GetWndClassInfo().m_uCommonResourceID;\r
-               m_hWndToolBar = T::CreateSimpleToolBarCtrl(m_hWnd, nResourceID, TRUE, dwStyle, nID);\r
-               return (m_hWndToolBar != NULL);\r
-       }\r
-\r
-       virtual WNDPROC GetWindowProc()\r
-       {\r
-               return MDIFrameWindowProc;\r
-       }\r
-\r
-       static LRESULT CALLBACK MDIFrameWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               CMDIFrameWindowImpl< T, TBase, TWinTraits >* pThis = (CMDIFrameWindowImpl< T, TBase, TWinTraits >*)hWnd;\r
-               // set a ptr to this message and save the old value\r
-#if (_ATL_VER >= 0x0700)\r
-               ATL::_ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);\r
-               const ATL::_ATL_MSG* pOldMsg = pThis->m_pCurrentMsg;\r
-#else // !(_ATL_VER >= 0x0700)\r
-               MSG msg = { pThis->m_hWnd, uMsg, wParam, lParam, 0, { 0, 0 } };\r
-               const MSG* pOldMsg = pThis->m_pCurrentMsg;\r
-#endif // !(_ATL_VER >= 0x0700)\r
-               pThis->m_pCurrentMsg = &msg;\r
-               // pass to the message map to process\r
-               LRESULT lRes = 0;\r
-               BOOL bRet = pThis->ProcessWindowMessage(pThis->m_hWnd, uMsg, wParam, lParam, lRes, 0);\r
-               // restore saved value for the current message\r
-               ATLASSERT(pThis->m_pCurrentMsg == &msg);\r
-               pThis->m_pCurrentMsg = pOldMsg;\r
-               // do the default processing if message was not handled\r
-               if(!bRet)\r
-               {\r
-                       if(uMsg != WM_NCDESTROY)\r
-                               lRes = pThis->DefWindowProc(uMsg, wParam, lParam);\r
-                       else\r
-                       {\r
-                               // unsubclass, if needed\r
-                               LONG_PTR pfnWndProc = ::GetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC);\r
-                               lRes = pThis->DefWindowProc(uMsg, wParam, lParam);\r
-                               if(pThis->m_pfnSuperWindowProc != ::DefWindowProc && ::GetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC) == pfnWndProc)\r
-                                       ::SetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);\r
-#if (_ATL_VER >= 0x0700)\r
-                               // mark window as destryed\r
-                               pThis->m_dwState |= WINSTATE_DESTROYED;\r
-#else // !(_ATL_VER >= 0x0700)\r
-                               // clear out window handle\r
-                               HWND hWnd = pThis->m_hWnd;\r
-                               pThis->m_hWnd = NULL;\r
-                               // clean up after window is destroyed\r
-                               pThis->OnFinalMessage(hWnd);\r
-#endif // !(_ATL_VER >= 0x0700)\r
-                       }\r
-               }\r
-#if (_ATL_VER >= 0x0700)\r
-               if(pThis->m_dwState & WINSTATE_DESTROYED && pThis->m_pCurrentMsg == NULL)\r
-               {\r
-                       // clear out window handle\r
-                       HWND hWnd = pThis->m_hWnd;\r
-                       pThis->m_hWnd = NULL;\r
-                       pThis->m_dwState &= ~WINSTATE_DESTROYED;\r
-                       // clean up after window is destroyed\r
-                       pThis->OnFinalMessage(hWnd);\r
-               }\r
-#endif // (_ATL_VER >= 0x0700)\r
-               return lRes;\r
-       }\r
-\r
-       // Overriden to call DefWindowProc which uses DefFrameProc\r
-       LRESULT DefWindowProc()\r
-       {\r
-               const MSG* pMsg = m_pCurrentMsg;\r
-               LRESULT lRes = 0;\r
-               if (pMsg != NULL)\r
-                       lRes = DefWindowProc(pMsg->message, pMsg->wParam, pMsg->lParam);\r
-               return lRes;\r
-       }\r
-\r
-       LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-       {\r
-               return ::DefFrameProc(m_hWnd, m_hWndMDIClient, uMsg, wParam, lParam);\r
-       }\r
-\r
-       BOOL PreTranslateMessage(MSG* pMsg)\r
-       {\r
-               if(CFrameWindowImplBase<TBase, TWinTraits>::PreTranslateMessage(pMsg))\r
-                       return TRUE;\r
-               return ::TranslateMDISysAccel(m_hWndMDIClient, pMsg);\r
-       }\r
-\r
-       HWND CreateMDIClient(HMENU hWindowMenu = NULL, UINT nID = ATL_IDW_CLIENT, UINT nFirstChildID = ATL_IDM_FIRST_MDICHILD)\r
-       {\r
-               DWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | MDIS_ALLCHILDSTYLES;\r
-               DWORD dwExStyle = WS_EX_CLIENTEDGE;\r
-\r
-               CLIENTCREATESTRUCT ccs = { 0 };\r
-               ccs.hWindowMenu = hWindowMenu;\r
-               ccs.idFirstChild = nFirstChildID;\r
-\r
-               if((GetStyle() & (WS_HSCROLL | WS_VSCROLL)) != 0)\r
-               {\r
-                       // parent MDI frame's scroll styles move to the MDICLIENT\r
-                       dwStyle |= (GetStyle() & (WS_HSCROLL | WS_VSCROLL));\r
-\r
-                       // fast way to turn off the scrollbar bits (without a resize)\r
-                       ModifyStyle(WS_HSCROLL | WS_VSCROLL, 0, SWP_NOREDRAW | SWP_FRAMECHANGED);\r
-               }\r
-\r
-               // Create MDICLIENT window\r
-               m_hWndClient = ::CreateWindowEx(dwExStyle, _T("MDIClient"), NULL,\r
-                       dwStyle, 0, 0, 1, 1, m_hWnd, (HMENU)LongToHandle(nID),\r
-                       ModuleHelper::GetModuleInstance(), (LPVOID)&ccs);\r
-               if (m_hWndClient == NULL)\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("MDI Frame failed to create MDICLIENT.\n"));\r
-                       return NULL;\r
-               }\r
-\r
-               // Move it to the top of z-order\r
-               ::BringWindowToTop(m_hWndClient);\r
-\r
-               // set as MDI client window\r
-               m_hWndMDIClient = m_hWndClient;\r
-\r
-               // update to proper size\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout();\r
-\r
-               return m_hWndClient;\r
-       }\r
-\r
-       typedef CFrameWindowImplBase<TBase, TWinTraits >   _baseClass;\r
-\r
-       BEGIN_MSG_MAP(CMDIFrameWindowImpl)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\r
-               MESSAGE_HANDLER(WM_MDISETMENU, OnMDISetMenu)\r
-#ifndef _ATL_NO_REBAR_SUPPORT\r
-#if (_WIN32_IE >= 0x0400)\r
-               NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnReBarAutoSize)\r
-#endif // (_WIN32_IE >= 0x0400)\r
-#if (_WIN32_IE >= 0x0500)\r
-               NOTIFY_CODE_HANDLER(RBN_CHEVRONPUSHED, OnChevronPushed)\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_ATL_NO_REBAR_SUPPORT\r
-               CHAIN_MSG_MAP(_baseClass)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(wParam != SIZE_MINIMIZED)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateLayout();\r
-               }\r
-               // message must be handled, otherwise DefFrameProc would resize the client again\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               // don't allow CFrameWindowImplBase to handle this one\r
-               return DefWindowProc(uMsg, wParam, lParam);\r
-       }\r
-\r
-       LRESULT OnMDISetMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               SetMDIFrameMenu();\r
-               return 0;\r
-       }\r
-\r
-#ifndef _ATL_NO_REBAR_SUPPORT\r
-#if (_WIN32_IE >= 0x0400)\r
-       LRESULT OnReBarAutoSize(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout(FALSE);\r
-               return 0;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       LRESULT OnChevronPushed(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               _ChevronMenuInfo cmi = { NULL, (LPNMREBARCHEVRON)pnmh, false };\r
-               if(!pT->PrepareChevronMenu(cmi))\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-               // display a popup menu with hidden items\r
-               pT->DisplayChevronMenu(cmi);\r
-               // cleanup\r
-               pT->CleanupChevronMenu(cmi);\r
-               return 0;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_ATL_NO_REBAR_SUPPORT\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMDIChildWindowImpl\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T, class TBase = CMDIWindow, class TWinTraits = ATL::CMDIChildWinTraits>\r
-class ATL_NO_VTABLE CMDIChildWindowImpl : public CFrameWindowImplBase<TBase, TWinTraits >\r
-{\r
-public:\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       UINT nMenuID = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               ATOM atom = T::GetWndClassInfo().Register(&m_pfnSuperWindowProc);\r
-\r
-               if(nMenuID != 0)\r
-                       m_hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(nMenuID));\r
-\r
-               dwStyle = T::GetWndStyle(dwStyle);\r
-               dwExStyle = T::GetWndExStyle(dwExStyle);\r
-\r
-               dwExStyle |= WS_EX_MDICHILD;   // force this one\r
-               m_pfnSuperWindowProc = ::DefMDIChildProc;\r
-               m_hWndMDIClient = hWndParent;\r
-               ATLASSERT(::IsWindow(m_hWndMDIClient));\r
-\r
-               if(rect.m_lpRect == NULL)\r
-                       rect.m_lpRect = &TBase::rcDefault;\r
-\r
-               // If the currently active MDI child is maximized, we want to create this one maximized too\r
-               ATL::CWindow wndParent = hWndParent;\r
-               BOOL bMaximized = FALSE;\r
-               wndParent.SendMessage(WM_MDIGETACTIVE, 0, (LPARAM)&bMaximized);\r
-               if(bMaximized)\r
-                       wndParent.SetRedraw(FALSE);\r
-\r
-               HWND hWnd = CFrameWindowImplBase<TBase, TWinTraits >::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, (UINT)0U, atom, lpCreateParam);\r
-\r
-               if(bMaximized)\r
-               {\r
-                       // Maximize and redraw everything\r
-                       if(hWnd != NULL)\r
-                               MDIMaximize(hWnd);\r
-                       wndParent.SetRedraw(TRUE);\r
-                       wndParent.RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);\r
-                       ::SetFocus(GetMDIFrame());   // focus will be set back to this window\r
-               }\r
-               else if(hWnd != NULL && ::IsWindowVisible(m_hWnd) && !::IsChild(hWnd, ::GetFocus()))\r
-               {\r
-                       ::SetFocus(hWnd);\r
-               }\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       HWND CreateEx(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR lpcstrWindowName = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)\r
-       {\r
-               const int cchName = 256;\r
-               TCHAR szWindowName[cchName];\r
-               szWindowName[0] = 0;\r
-               if(lpcstrWindowName == NULL)\r
-               {\r
-                       ::LoadString(ModuleHelper::GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);\r
-                       lpcstrWindowName = szWindowName;\r
-               }\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               HWND hWnd = pT->Create(hWndParent, rect, lpcstrWindowName, dwStyle, dwExStyle, T::GetWndClassInfo().m_uCommonResourceID, lpCreateParam);\r
-\r
-               if(hWnd != NULL)\r
-                       m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));\r
-\r
-               return hWnd;\r
-       }\r
-\r
-       BOOL CreateSimpleToolBar(UINT nResourceID = 0, DWORD dwStyle = ATL_SIMPLE_TOOLBAR_STYLE, UINT nID = ATL_IDW_TOOLBAR)\r
-       {\r
-               ATLASSERT(!::IsWindow(m_hWndToolBar));\r
-               if(nResourceID == 0)\r
-                       nResourceID = T::GetWndClassInfo().m_uCommonResourceID;\r
-               m_hWndToolBar = T::CreateSimpleToolBarCtrl(m_hWnd, nResourceID, TRUE, dwStyle, nID);\r
-               return (m_hWndToolBar != NULL);\r
-       }\r
-\r
-       BOOL UpdateClientEdge(LPRECT lpRect = NULL)\r
-       {\r
-               // only adjust for active MDI child window\r
-               HWND hWndChild = MDIGetActive();\r
-               if(hWndChild != NULL && hWndChild != m_hWnd)\r
-                       return FALSE;\r
-\r
-               // need to adjust the client edge style as max/restore happens\r
-               DWORD dwStyle = ::GetWindowLong(m_hWndMDIClient, GWL_EXSTYLE);\r
-               DWORD dwNewStyle = dwStyle;\r
-               if(hWndChild != NULL && ((GetExStyle() & WS_EX_CLIENTEDGE) == 0) && ((GetStyle() & WS_MAXIMIZE) != 0))\r
-                       dwNewStyle &= ~(WS_EX_CLIENTEDGE);\r
-               else\r
-                       dwNewStyle |= WS_EX_CLIENTEDGE;\r
-\r
-               if(dwStyle != dwNewStyle)\r
-               {\r
-                       // SetWindowPos will not move invalid bits\r
-                       ::RedrawWindow(m_hWndMDIClient, NULL, NULL,\r
-                               RDW_INVALIDATE | RDW_ALLCHILDREN);\r
-                       // remove/add WS_EX_CLIENTEDGE to MDI client area\r
-                       ::SetWindowLong(m_hWndMDIClient, GWL_EXSTYLE, dwNewStyle);\r
-                       ::SetWindowPos(m_hWndMDIClient, NULL, 0, 0, 0, 0,\r
-                               SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE |\r
-                               SWP_NOZORDER | SWP_NOCOPYBITS);\r
-\r
-                       // return new client area\r
-                       if (lpRect != NULL)\r
-                               ::GetClientRect(m_hWndMDIClient, lpRect);\r
-\r
-                       return TRUE;\r
-               }\r
-\r
-               return FALSE;\r
-       }\r
-\r
-       typedef CFrameWindowImplBase<TBase, TWinTraits >   _baseClass;\r
-       BEGIN_MSG_MAP(CMDIChildWindowImpl)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)\r
-               MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)\r
-               MESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)\r
-               MESSAGE_HANDLER(WM_MDIACTIVATE, OnMDIActivate)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-#ifndef _ATL_NO_REBAR_SUPPORT\r
-#if (_WIN32_IE >= 0x0400)\r
-               NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnReBarAutoSize)\r
-#endif // (_WIN32_IE >= 0x0400)\r
-#if (_WIN32_IE >= 0x0500)\r
-               NOTIFY_CODE_HANDLER(RBN_CHEVRONPUSHED, OnChevronPushed)\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_ATL_NO_REBAR_SUPPORT\r
-               CHAIN_MSG_MAP(_baseClass)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               DefWindowProc(uMsg, wParam, lParam);   // needed for MDI children\r
-               if(wParam != SIZE_MINIMIZED)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateLayout();\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnWindowPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               // update MDI client edge and adjust MDI child rect\r
-               LPWINDOWPOS lpWndPos = (LPWINDOWPOS)lParam;\r
-\r
-               if(!(lpWndPos->flags & SWP_NOSIZE))\r
-               {\r
-                       RECT rectClient;\r
-                       if(UpdateClientEdge(&rectClient) && ((GetStyle() & WS_MAXIMIZE) != 0))\r
-                       {\r
-                               ::AdjustWindowRectEx(&rectClient, GetStyle(), FALSE, GetExStyle());\r
-                               lpWndPos->x = rectClient.left;\r
-                               lpWndPos->y = rectClient.top;\r
-                               lpWndPos->cx = rectClient.right - rectClient.left;\r
-                               lpWndPos->cy = rectClient.bottom - rectClient.top;\r
-                       }\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               LRESULT lRes = DefWindowProc(uMsg, wParam, lParam);\r
-\r
-               // Activate this MDI window if needed\r
-               if(lRes == MA_ACTIVATE || lRes == MA_ACTIVATEANDEAT)\r
-               {\r
-                       if(MDIGetActive() != m_hWnd)\r
-                               MDIActivate(m_hWnd);\r
-               }\r
-\r
-               return lRes;\r
-       }\r
-\r
-       LRESULT OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               return ::SendMessage(GetMDIFrame(), uMsg, wParam, lParam);\r
-       }\r
-\r
-       LRESULT OnMDIActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if((HWND)lParam == m_hWnd && m_hMenu != NULL)\r
-                       SetMDIFrameMenu();\r
-               else if((HWND)lParam == NULL)\r
-                       ::SendMessage(GetMDIFrame(), WM_MDISETMENU, 0, 0);\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_hMenu != NULL)\r
-               {\r
-                       ::DestroyMenu(m_hMenu);\r
-                       m_hMenu = NULL;\r
-               }\r
-               UpdateClientEdge();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-#ifndef _ATL_NO_REBAR_SUPPORT\r
-#if (_WIN32_IE >= 0x0400)\r
-       LRESULT OnReBarAutoSize(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout(FALSE);\r
-               return 0;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0400)\r
-\r
-#if (_WIN32_IE >= 0x0500)\r
-       LRESULT OnChevronPushed(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               _ChevronMenuInfo cmi = { NULL, (LPNMREBARCHEVRON)pnmh, false };\r
-               if(!pT->PrepareChevronMenu(cmi))\r
-               {\r
-                       bHandled = FALSE;\r
-                       return 1;\r
-               }\r
-               // display a popup menu with hidden items\r
-               pT->DisplayChevronMenu(cmi);\r
-               // cleanup\r
-               pT->CleanupChevronMenu(cmi);\r
-               return 0;\r
-       }\r
-#endif // (_WIN32_IE >= 0x0500)\r
-#endif // !_ATL_NO_REBAR_SUPPORT\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// COwnerDraw - MI class for owner-draw support\r
-\r
-template <class T>\r
-class COwnerDraw\r
-{\r
-public:\r
-#if (_ATL_VER < 0x0700)\r
-       BOOL m_bHandledOD;\r
-\r
-       BOOL IsMsgHandled() const\r
-       {\r
-               return m_bHandledOD;\r
-       }\r
-       void SetMsgHandled(BOOL bHandled)\r
-       {\r
-               m_bHandledOD = bHandled;\r
-       }\r
-#endif // (_ATL_VER < 0x0700)\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(COwnerDraw< T >)\r
-               MESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)\r
-               MESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)\r
-               MESSAGE_HANDLER(WM_COMPAREITEM, OnCompareItem)\r
-               MESSAGE_HANDLER(WM_DELETEITEM, OnDeleteItem)\r
-       ALT_MSG_MAP(1)\r
-               MESSAGE_HANDLER(OCM_DRAWITEM, OnDrawItem)\r
-               MESSAGE_HANDLER(OCM_MEASUREITEM, OnMeasureItem)\r
-               MESSAGE_HANDLER(OCM_COMPAREITEM, OnCompareItem)\r
-               MESSAGE_HANDLER(OCM_DELETEITEM, OnDeleteItem)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnDrawItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetMsgHandled(TRUE);\r
-               pT->DrawItem((LPDRAWITEMSTRUCT)lParam);\r
-               bHandled = pT->IsMsgHandled();\r
-               return (LRESULT)TRUE;\r
-       }\r
-\r
-       LRESULT OnMeasureItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetMsgHandled(TRUE);\r
-               pT->MeasureItem((LPMEASUREITEMSTRUCT)lParam);\r
-               bHandled = pT->IsMsgHandled();\r
-               return (LRESULT)TRUE;\r
-       }\r
-\r
-       LRESULT OnCompareItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetMsgHandled(TRUE);\r
-               bHandled = pT->IsMsgHandled();\r
-               return (LRESULT)pT->CompareItem((LPCOMPAREITEMSTRUCT)lParam);\r
-       }\r
-\r
-       LRESULT OnDeleteItem(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetMsgHandled(TRUE);\r
-               pT->DeleteItem((LPDELETEITEMSTRUCT)lParam);\r
-               bHandled = pT->IsMsgHandled();\r
-               return (LRESULT)TRUE;\r
-       }\r
-\r
-// Overrideables\r
-       void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/)\r
-       {\r
-               // must be implemented\r
-               ATLASSERT(FALSE);\r
-       }\r
-\r
-       void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)\r
-       {\r
-               if(lpMeasureItemStruct->CtlType != ODT_MENU)\r
-               {\r
-                       // return default height for a system font\r
-                       T* pT = static_cast<T*>(this);\r
-                       HWND hWnd = pT->GetDlgItem(lpMeasureItemStruct->CtlID);\r
-                       CClientDC dc(hWnd);\r
-                       TEXTMETRIC tm = { 0 };\r
-                       dc.GetTextMetrics(&tm);\r
-\r
-                       lpMeasureItemStruct->itemHeight = tm.tmHeight;\r
-               }\r
-               else\r
-                       lpMeasureItemStruct->itemHeight = ::GetSystemMetrics(SM_CYMENU);\r
-       }\r
-\r
-       int CompareItem(LPCOMPAREITEMSTRUCT /*lpCompareItemStruct*/)\r
-       {\r
-               // all items are equal\r
-               return 0;\r
-       }\r
-\r
-       void DeleteItem(LPDELETEITEMSTRUCT /*lpDeleteItemStruct*/)\r
-       {\r
-               // default - nothing\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Update UI macros\r
-\r
-// these build the Update UI map inside a class definition\r
-#define BEGIN_UPDATE_UI_MAP(thisClass) \\r
-       static const CUpdateUIBase::_AtlUpdateUIMap* GetUpdateUIMap() \\r
-       { \\r
-               static const _AtlUpdateUIMap theMap[] = \\r
-               {\r
-\r
-#define UPDATE_ELEMENT(nID, wType) \\r
-                       { nID,  wType },\r
-\r
-#define END_UPDATE_UI_MAP() \\r
-                       { (WORD)-1, 0 } \\r
-               }; \\r
-               return theMap; \\r
-       }\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CUpdateUI - manages UI elements updating\r
-\r
-class CUpdateUIBase\r
-{\r
-public:\r
-       // constants\r
-       enum\r
-       {\r
-               // UI element type\r
-               UPDUI_MENUPOPUP         = 0x0001,\r
-               UPDUI_MENUBAR           = 0x0002,\r
-               UPDUI_CHILDWINDOW       = 0x0004,\r
-               UPDUI_TOOLBAR           = 0x0008,\r
-               UPDUI_STATUSBAR         = 0x0010,\r
-               // state\r
-               UPDUI_ENABLED           = 0x0000,\r
-               UPDUI_DISABLED          = 0x0100,\r
-               UPDUI_CHECKED           = 0x0200,\r
-               UPDUI_CHECKED2          = 0x0400,\r
-               UPDUI_RADIO             = 0x0800,\r
-               UPDUI_DEFAULT           = 0x1000,\r
-               UPDUI_TEXT              = 0x2000,\r
-               // internal state\r
-               UPDUI_CLEARDEFAULT      = 0x4000,\r
-       };\r
-\r
-       // element data\r
-       struct _AtlUpdateUIElement\r
-       {\r
-               HWND m_hWnd;\r
-               WORD m_wType;\r
-\r
-               bool operator ==(const _AtlUpdateUIElement& e) const\r
-               { return (m_hWnd == e.m_hWnd && m_wType == e.m_wType); }\r
-       };\r
-\r
-       // map data\r
-       struct _AtlUpdateUIMap\r
-       {\r
-               WORD m_nID;\r
-               WORD m_wType;\r
-\r
-               bool operator ==(const _AtlUpdateUIMap& e) const\r
-               { return (m_nID == e.m_nID && m_wType == e.m_wType); }\r
-       };\r
-\r
-       // instance data\r
-       struct _AtlUpdateUIData\r
-       {\r
-               WORD m_wState;\r
-               union\r
-               {\r
-                       void* m_lpData;\r
-                       LPTSTR m_lpstrText;\r
-               };\r
-\r
-               bool operator ==(const _AtlUpdateUIData& e) const\r
-               { return (m_wState == e.m_wState && m_lpData == e.m_lpData); }\r
-       };\r
-\r
-       ATL::CSimpleArray<_AtlUpdateUIElement> m_UIElements;   // elements data\r
-       const _AtlUpdateUIMap* m_pUIMap;                       // static UI data\r
-       _AtlUpdateUIData* m_pUIData;                           // instance UI data\r
-       WORD m_wDirtyType;                                     // global dirty flag\r
-\r
-       bool m_bBlockAccelerators;\r
-\r
-\r
-// Constructor, destructor\r
-       CUpdateUIBase() : m_pUIMap(NULL), m_pUIData(NULL), m_wDirtyType(0), m_bBlockAccelerators(false)\r
-       { }\r
-\r
-       ~CUpdateUIBase()\r
-       {\r
-               if(m_pUIMap != NULL && m_pUIData != NULL)\r
-               {\r
-                       const _AtlUpdateUIMap* pUIMap = m_pUIMap;\r
-                       _AtlUpdateUIData* pUIData = m_pUIData;\r
-                       while(pUIMap->m_nID != (WORD)-1)\r
-                       {\r
-                               if(pUIData->m_wState & UPDUI_TEXT)\r
-                                       delete [] pUIData->m_lpstrText;\r
-                               pUIMap++;\r
-                               pUIData++;\r
-                       }\r
-                       delete [] m_pUIData;\r
-               }\r
-       }\r
-\r
-// Check for disabled commands\r
-       bool UIGetBlockAccelerators() const\r
-       {\r
-               return m_bBlockAccelerators;\r
-       }\r
-\r
-       bool UISetBlockAccelerators(bool bBlock)\r
-       {\r
-               bool bOld = m_bBlockAccelerators;\r
-               m_bBlockAccelerators = bBlock;\r
-               return bOld;\r
-       }\r
-\r
-// Add elements\r
-       BOOL UIAddMenuBar(HWND hWnd)                // menu bar (main menu)\r
-       {\r
-               if(hWnd == NULL)\r
-                       return FALSE;\r
-               _AtlUpdateUIElement e;\r
-               e.m_hWnd = hWnd;\r
-               e.m_wType = UPDUI_MENUBAR;\r
-               return m_UIElements.Add(e);\r
-       }\r
-\r
-       BOOL UIAddToolBar(HWND hWnd)                // toolbar\r
-       {\r
-               if(hWnd == NULL)\r
-                       return FALSE;\r
-               _AtlUpdateUIElement e;\r
-               e.m_hWnd = hWnd;\r
-               e.m_wType = UPDUI_TOOLBAR;\r
-               return m_UIElements.Add(e);\r
-       }\r
-\r
-       BOOL UIAddStatusBar(HWND hWnd)              // status bar\r
-       {\r
-               if(hWnd == NULL)\r
-                       return FALSE;\r
-               _AtlUpdateUIElement e;\r
-               e.m_hWnd = hWnd;\r
-               e.m_wType = UPDUI_STATUSBAR;\r
-               return m_UIElements.Add(e);\r
-       }\r
-\r
-       BOOL UIAddChildWindowContainer(HWND hWnd)   // child window\r
-       {\r
-               if(hWnd == NULL)\r
-                       return FALSE;\r
-               _AtlUpdateUIElement e;\r
-               e.m_hWnd = hWnd;\r
-               e.m_wType = UPDUI_CHILDWINDOW;\r
-               return m_UIElements.Add(e);\r
-       }\r
-\r
-// Message map for popup menu updates and accelerator blocking\r
-       BEGIN_MSG_MAP(CUpdateUIBase)\r
-               MESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)\r
-               MESSAGE_HANDLER(WM_COMMAND, OnCommand)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInitMenuPopup(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-               HMENU hMenu = (HMENU)wParam;\r
-               if(hMenu == NULL)\r
-                       return 1;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return 1;\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               while(pMap->m_nID != (WORD)-1)\r
-               {\r
-                       if(pMap->m_wType & UPDUI_MENUPOPUP)\r
-                               UIUpdateMenuBarElement(pMap->m_nID, pUIData, hMenu);\r
-                       pMap++;\r
-                       pUIData++;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               bHandled = FALSE;\r
-               if(m_bBlockAccelerators && HIWORD(wParam) == 1)   // accelerators only\r
-               {\r
-                       int nID = LOWORD(wParam);\r
-                       if((UIGetState(nID) & UPDUI_DISABLED) == UPDUI_DISABLED)\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("CUpdateUIBase::OnCommand - blocked disabled command 0x%4.4X\n"), nID);\r
-                               bHandled = TRUE;   // eat the command, UI item is disabled\r
-                       }\r
-               }\r
-               return 0;\r
-       }\r
-\r
-// methods for setting UI element state\r
-       BOOL UIEnable(int nID, BOOL bEnable, BOOL bForceUpdate = FALSE)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                       {\r
-                               if(bEnable)\r
-                               {\r
-                                       if(pUIData->m_wState & UPDUI_DISABLED)\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState &= ~UPDUI_DISABLED;\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       if(!(pUIData->m_wState & UPDUI_DISABLED))\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState |= UPDUI_DISABLED;\r
-                                       }\r
-                               }\r
-\r
-                               if(bForceUpdate)\r
-                                       pUIData->m_wState |= pMap->m_wType;\r
-                               if(pUIData->m_wState & pMap->m_wType)\r
-                                       m_wDirtyType |= pMap->m_wType;\r
-\r
-                               break;   // found\r
-                       }\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL UISetCheck(int nID, int nCheck, BOOL bForceUpdate = FALSE)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                       {\r
-                               switch(nCheck)\r
-                               {\r
-                               case 0:\r
-                                       if((pUIData->m_wState & UPDUI_CHECKED) || (pUIData->m_wState & UPDUI_CHECKED2))\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState &= ~(UPDUI_CHECKED | UPDUI_CHECKED2);\r
-                                       }\r
-                                       break;\r
-                               case 1:\r
-                                       if(!(pUIData->m_wState & UPDUI_CHECKED))\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState &= ~UPDUI_CHECKED2;\r
-                                               pUIData->m_wState |= UPDUI_CHECKED;\r
-                                       }\r
-                                       break;\r
-                               case 2:\r
-                                       if(!(pUIData->m_wState & UPDUI_CHECKED2))\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState &= ~UPDUI_CHECKED;\r
-                                               pUIData->m_wState |= UPDUI_CHECKED2;\r
-                                       }\r
-                                       break;\r
-                               }\r
-\r
-                               if(bForceUpdate)\r
-                                       pUIData->m_wState |= pMap->m_wType;\r
-                               if(pUIData->m_wState & pMap->m_wType)\r
-                                       m_wDirtyType |= pMap->m_wType;\r
-\r
-                               break;   // found\r
-                       }\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       // variant that supports bool (checked/not-checked, no intermediate state)\r
-       BOOL UISetCheck(int nID, bool bCheck, BOOL bForceUpdate = FALSE)\r
-       {\r
-               return UISetCheck(nID, bCheck ? 1 : 0, bForceUpdate);\r
-       }\r
-\r
-       BOOL UISetRadio(int nID, BOOL bRadio, BOOL bForceUpdate = FALSE)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                       {\r
-                               if(bRadio)\r
-                               {\r
-                                       if(!(pUIData->m_wState & UPDUI_RADIO))\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState |= UPDUI_RADIO;\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       if(pUIData->m_wState & UPDUI_RADIO)\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState &= ~UPDUI_RADIO;\r
-                                       }\r
-                               }\r
-\r
-                               if(bForceUpdate)\r
-                                       pUIData->m_wState |= pMap->m_wType;\r
-                               if(pUIData->m_wState & pMap->m_wType)\r
-                                       m_wDirtyType |= pMap->m_wType;\r
-\r
-                               break;   // found\r
-                       }\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL UISetText(int nID, LPCTSTR lpstrText, BOOL bForceUpdate = FALSE)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-               if(lpstrText == NULL)\r
-                       lpstrText = _T("");\r
-\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                       {\r
-                               if(pUIData->m_lpstrText == NULL || lstrcmp(pUIData->m_lpstrText, lpstrText))\r
-                               {\r
-                                       delete [] pUIData->m_lpstrText;\r
-                                       pUIData->m_lpstrText = NULL;\r
-                                       int nStrLen = lstrlen(lpstrText);\r
-                                       ATLTRY(pUIData->m_lpstrText = new TCHAR[nStrLen + 1]);\r
-                                       if(pUIData->m_lpstrText == NULL)\r
-                                       {\r
-                                               ATLTRACE2(atlTraceUI, 0, _T("UISetText - memory allocation failed\n"));\r
-                                               break;\r
-                                       }\r
-                                       SecureHelper::strcpy_x(pUIData->m_lpstrText, nStrLen + 1, lpstrText);\r
-                                       pUIData->m_wState |= (UPDUI_TEXT | pMap->m_wType);\r
-                               }\r
-\r
-                               if(bForceUpdate)\r
-                                       pUIData->m_wState |= (UPDUI_TEXT | pMap->m_wType);\r
-                               if(pUIData->m_wState & pMap->m_wType)\r
-                                       m_wDirtyType |= pMap->m_wType;\r
-\r
-                               break;   // found\r
-                       }\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL UISetDefault(int nID, BOOL bDefault, BOOL bForceUpdate = FALSE)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                       {\r
-                               if(bDefault)\r
-                               {\r
-                                       if((pUIData->m_wState & UPDUI_DEFAULT) == 0)\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState |= UPDUI_DEFAULT;\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       if((pUIData->m_wState & UPDUI_DEFAULT) != 0)\r
-                                       {\r
-                                               pUIData->m_wState |= pMap->m_wType;\r
-                                               pUIData->m_wState &= ~UPDUI_DEFAULT;\r
-                                               pUIData->m_wState |= UPDUI_CLEARDEFAULT;\r
-                                       }\r
-                               }\r
-\r
-                               if(bForceUpdate)\r
-                                       pUIData->m_wState |= pMap->m_wType;\r
-                               if(pUIData->m_wState & pMap->m_wType)\r
-                                       m_wDirtyType |= pMap->m_wType;\r
-\r
-                               break;   // found\r
-                       }\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-// methods for complete state set/get\r
-       BOOL UISetState(int nID, DWORD dwState)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                       {               \r
-                               pUIData->m_wState = (WORD)(dwState | pMap->m_wType);\r
-                               m_wDirtyType |= pMap->m_wType;\r
-                               break;   // found\r
-                       }\r
-               }\r
-               return TRUE;\r
-       }\r
-\r
-       DWORD UIGetState(int nID)\r
-       {\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return 0;\r
-               for( ; pMap->m_nID != (WORD)-1; pMap++, pUIData++)\r
-               {\r
-                       if(nID == (int)pMap->m_nID)\r
-                               return pUIData->m_wState;\r
-               }\r
-               return 0;\r
-       }\r
-\r
-// methods for updating UI\r
-#ifndef _WIN32_WCE\r
-       BOOL UIUpdateMenuBar(BOOL bForceUpdate = FALSE, BOOL bMainMenu = FALSE)\r
-       {\r
-               if(!(m_wDirtyType & UPDUI_MENUBAR) && !bForceUpdate)\r
-                       return TRUE;\r
-\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               while(pMap->m_nID != (WORD)-1)\r
-               {\r
-                       for(int i = 0; i < m_UIElements.GetSize(); i++)\r
-                       {\r
-                               if(m_UIElements[i].m_wType == UPDUI_MENUBAR)\r
-                               {\r
-                                       HMENU hMenu = ::GetMenu(m_UIElements[i].m_hWnd);\r
-                                       if(hMenu != NULL && (pUIData->m_wState & UPDUI_MENUBAR) && (pMap->m_wType & UPDUI_MENUBAR))\r
-                                               UIUpdateMenuBarElement(pMap->m_nID, pUIData, hMenu);\r
-                               }\r
-                               if(bMainMenu)\r
-                                       ::DrawMenuBar(m_UIElements[i].m_hWnd);\r
-                       }\r
-                       pMap++;\r
-                       pUIData->m_wState &= ~UPDUI_MENUBAR;\r
-                       if(pUIData->m_wState & UPDUI_TEXT)\r
-                       {\r
-                               delete [] pUIData->m_lpstrText;\r
-                               pUIData->m_lpstrText = NULL;\r
-                               pUIData->m_wState &= ~UPDUI_TEXT;\r
-                       }\r
-                       pUIData++;\r
-               }\r
-\r
-               m_wDirtyType &= ~UPDUI_MENUBAR;\r
-               return TRUE;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL UIUpdateToolBar(BOOL bForceUpdate = FALSE)\r
-       {\r
-               if(!(m_wDirtyType & UPDUI_TOOLBAR) && !bForceUpdate)\r
-                       return TRUE;\r
-\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               while(pMap->m_nID != (WORD)-1)\r
-               {\r
-                       for(int i = 0; i < m_UIElements.GetSize(); i++)\r
-                       {\r
-                               if(m_UIElements[i].m_wType == UPDUI_TOOLBAR)\r
-                               {\r
-                                       if((pUIData->m_wState & UPDUI_TOOLBAR) && (pMap->m_wType & UPDUI_TOOLBAR))\r
-                                               UIUpdateToolBarElement(pMap->m_nID, pUIData, m_UIElements[i].m_hWnd);\r
-                               }\r
-                       }\r
-                       pMap++;\r
-                       pUIData->m_wState &= ~UPDUI_TOOLBAR;\r
-                       pUIData++;\r
-               }\r
-\r
-               m_wDirtyType &= ~UPDUI_TOOLBAR;\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL UIUpdateStatusBar(BOOL bForceUpdate = FALSE)\r
-       {\r
-               if(!(m_wDirtyType & UPDUI_STATUSBAR) && !bForceUpdate)\r
-                       return TRUE;\r
-\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               while(pMap->m_nID != (WORD)-1)\r
-               {\r
-                       for(int i = 0; i < m_UIElements.GetSize(); i++)\r
-                       {\r
-                               if(m_UIElements[i].m_wType == UPDUI_STATUSBAR)\r
-                               {\r
-                                       if((pUIData->m_wState & UPDUI_STATUSBAR) && (pMap->m_wType & UPDUI_STATUSBAR))\r
-                                               UIUpdateStatusBarElement(pMap->m_nID, pUIData, m_UIElements[i].m_hWnd);\r
-                               }\r
-                       }\r
-                       pMap++;\r
-                       pUIData->m_wState &= ~UPDUI_STATUSBAR;\r
-                       if(pUIData->m_wState & UPDUI_TEXT)\r
-                       {\r
-                               delete [] pUIData->m_lpstrText;\r
-                               pUIData->m_lpstrText = NULL;\r
-                               pUIData->m_wState &= ~UPDUI_TEXT;\r
-                       }\r
-                       pUIData++;\r
-               }\r
-\r
-               m_wDirtyType &= ~UPDUI_STATUSBAR;\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL UIUpdateChildWindows(BOOL bForceUpdate = FALSE)\r
-       {\r
-               if(!(m_wDirtyType & UPDUI_CHILDWINDOW) && !bForceUpdate)\r
-                       return TRUE;\r
-\r
-               const _AtlUpdateUIMap* pMap = m_pUIMap;\r
-               _AtlUpdateUIData* pUIData = m_pUIData;\r
-               if(pUIData == NULL)\r
-                       return FALSE;\r
-\r
-               while(pMap->m_nID != (WORD)-1)\r
-               {\r
-                       for(int i = 0; i < m_UIElements.GetSize(); i++)\r
-                       {\r
-                               if(m_UIElements[i].m_wType == UPDUI_CHILDWINDOW)\r
-                               {\r
-                                       if((pUIData->m_wState & UPDUI_CHILDWINDOW) && (pMap->m_wType & UPDUI_CHILDWINDOW))\r
-                                               UIUpdateChildWindow(pMap->m_nID, pUIData, m_UIElements[i].m_hWnd);\r
-                               }\r
-                       }\r
-                       pMap++;\r
-                       pUIData->m_wState &= ~UPDUI_CHILDWINDOW;\r
-                       if(pUIData->m_wState & UPDUI_TEXT)\r
-                       {\r
-                               delete [] pUIData->m_lpstrText;\r
-                               pUIData->m_lpstrText = NULL;\r
-                               pUIData->m_wState &= ~UPDUI_TEXT;\r
-                       }\r
-                       pUIData++;\r
-               }\r
-\r
-               m_wDirtyType &= ~UPDUI_CHILDWINDOW;\r
-               return TRUE;\r
-       }\r
-\r
-// internal element specific methods\r
-       static void UIUpdateMenuBarElement(int nID, _AtlUpdateUIData* pUIData, HMENU hMenu)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               if((pUIData->m_wState & UPDUI_CLEARDEFAULT) != 0)\r
-               {\r
-                       ::SetMenuDefaultItem(hMenu, (UINT)-1, 0);\r
-                       pUIData->m_wState &= ~UPDUI_CLEARDEFAULT;\r
-               }\r
-#endif // !_WIN32_WCE\r
-\r
-               CMenuItemInfo mii;\r
-               mii.fMask = MIIM_STATE;\r
-               mii.wID = nID;\r
-\r
-#ifndef _WIN32_WCE\r
-               if((pUIData->m_wState & UPDUI_DISABLED) != 0)\r
-                       mii.fState |= MFS_DISABLED | MFS_GRAYED;\r
-               else\r
-                       mii.fState |= MFS_ENABLED;\r
-\r
-               if((pUIData->m_wState & UPDUI_CHECKED) != 0)\r
-                       mii.fState |= MFS_CHECKED;\r
-               else\r
-                       mii.fState |= MFS_UNCHECKED;\r
-\r
-               if((pUIData->m_wState & UPDUI_DEFAULT) != 0)\r
-                       mii.fState |= MFS_DEFAULT;\r
-#else // CE specific\r
-               // ::SetMenuItemInfo() can't disable or check menu items\r
-               // on Windows CE, so we have to do that directly\r
-               UINT uEnable = MF_BYCOMMAND;\r
-               if((pUIData->m_wState & UPDUI_DISABLED) != 0)\r
-                       uEnable |= MF_GRAYED;\r
-               else\r
-                       uEnable |= MF_ENABLED;\r
-               ::EnableMenuItem(hMenu, nID, uEnable);\r
-\r
-               UINT uCheck = MF_BYCOMMAND;\r
-               if((pUIData->m_wState & UPDUI_CHECKED) != 0)\r
-                       uCheck |= MF_CHECKED;\r
-               else\r
-                       uCheck |= MF_UNCHECKED;\r
-               ::CheckMenuItem(hMenu, nID, uCheck);\r
-#endif // _WIN32_WCE\r
-\r
-               if((pUIData->m_wState & UPDUI_TEXT) != 0)\r
-               {\r
-                       CMenuItemInfo miiNow;\r
-                       miiNow.fMask = MIIM_TYPE;\r
-                       miiNow.wID = nID;\r
-                       if(::GetMenuItemInfo(hMenu, nID, FALSE, &miiNow))\r
-                       {\r
-                               mii.fMask |= MIIM_TYPE;\r
-                               // MFT_BITMAP and MFT_SEPARATOR don't go together with MFT_STRING\r
-#ifndef _WIN32_WCE\r
-                               mii.fType |= (miiNow.fType & ~(MFT_BITMAP | MFT_SEPARATOR)) | MFT_STRING;\r
-#else // CE specific\r
-                               mii.fType |= (miiNow.fType & ~(MFT_SEPARATOR)) | MFT_STRING;\r
-#endif // _WIN32_WCE\r
-                               mii.dwTypeData = pUIData->m_lpstrText;\r
-                       }\r
-               }\r
-\r
-               ::SetMenuItemInfo(hMenu, nID, FALSE, &mii);\r
-       }\r
-\r
-       static void UIUpdateToolBarElement(int nID, _AtlUpdateUIData* pUIData, HWND hWndToolBar)\r
-       {\r
-               // Note: only handles enabled/disabled, checked state, and radio (press)\r
-               ::SendMessage(hWndToolBar, TB_ENABLEBUTTON, nID, (LPARAM)(pUIData->m_wState & UPDUI_DISABLED) ? FALSE : TRUE);\r
-               ::SendMessage(hWndToolBar, TB_CHECKBUTTON, nID, (LPARAM)(pUIData->m_wState & UPDUI_CHECKED) ? TRUE : FALSE);\r
-               ::SendMessage(hWndToolBar, TB_INDETERMINATE, nID, (LPARAM)(pUIData->m_wState & UPDUI_CHECKED2) ? TRUE : FALSE);\r
-               ::SendMessage(hWndToolBar, TB_PRESSBUTTON, nID, (LPARAM)(pUIData->m_wState & UPDUI_RADIO) ? TRUE : FALSE);\r
-       }\r
-\r
-       static void UIUpdateStatusBarElement(int nID, _AtlUpdateUIData* pUIData, HWND hWndStatusBar)\r
-       {\r
-               // Note: only handles text\r
-               if(pUIData->m_wState & UPDUI_TEXT)\r
-                       ::SendMessage(hWndStatusBar, SB_SETTEXT, nID, (LPARAM)pUIData->m_lpstrText);\r
-       }\r
-\r
-       static void UIUpdateChildWindow(int nID, _AtlUpdateUIData* pUIData, HWND hWnd)\r
-       {\r
-               HWND hChild = ::GetDlgItem(hWnd, nID);\r
-\r
-               ::EnableWindow(hChild, (pUIData->m_wState & UPDUI_DISABLED) ? FALSE : TRUE);\r
-               // for check and radio, assume that window is a button\r
-               int nCheck = BST_UNCHECKED;\r
-               if(pUIData->m_wState & UPDUI_CHECKED || pUIData->m_wState & UPDUI_RADIO)\r
-                       nCheck = BST_CHECKED;\r
-               else if(pUIData->m_wState & UPDUI_CHECKED2)\r
-                       nCheck = BST_INDETERMINATE;\r
-               ::SendMessage(hChild, BM_SETCHECK, nCheck, 0L);\r
-               if(pUIData->m_wState & UPDUI_DEFAULT)\r
-               {\r
-                       DWORD dwRet = (DWORD)::SendMessage(hWnd, DM_GETDEFID, 0, 0L);\r
-                       if(HIWORD(dwRet) == DC_HASDEFID)\r
-                       {\r
-                               HWND hOldDef = ::GetDlgItem(hWnd, (int)(short)LOWORD(dwRet));\r
-                               // remove BS_DEFPUSHBUTTON\r
-                               ::SendMessage(hOldDef, BM_SETSTYLE, BS_PUSHBUTTON, MAKELPARAM(TRUE, 0));\r
-                       }\r
-                       ::SendMessage(hWnd, DM_SETDEFID, nID, 0L);\r
-               }\r
-               if(pUIData->m_wState & UPDUI_TEXT)\r
-                       ::SetWindowText(hChild, pUIData->m_lpstrText);\r
-       }\r
-};\r
-\r
-template <class T>\r
-class CUpdateUI : public CUpdateUIBase\r
-{\r
-public:\r
-       CUpdateUI()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT;\r
-               const _AtlUpdateUIMap* pMap = pT->GetUpdateUIMap();\r
-               m_pUIMap = pMap;\r
-               ATLASSERT(m_pUIMap != NULL);\r
-               int nCount;\r
-               for(nCount = 1; pMap->m_nID != (WORD)-1; nCount++)\r
-                       pMap++;\r
-\r
-               // check for duplicates (debug only)\r
-#ifdef _DEBUG\r
-               for(int i = 0; i < nCount; i++)\r
-               {\r
-                       for(int j = 0; j < nCount; j++)\r
-                       {\r
-                               // shouldn't have duplicates in the update UI map\r
-                               if(i != j)\r
-                                       ATLASSERT(m_pUIMap[j].m_nID != m_pUIMap[i].m_nID);\r
-                       }\r
-               }\r
-#endif // _DEBUG\r
-\r
-               ATLTRY(m_pUIData = new _AtlUpdateUIData[nCount]);\r
-               ATLASSERT(m_pUIData != NULL);\r
-\r
-               if(m_pUIData != NULL)\r
-                       memset(m_pUIData, 0, sizeof(_AtlUpdateUIData) * nCount);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDynamicUpdateUI - allows update elements to dynamically added and removed\r
-//                    in addition to a static update UI map\r
-\r
-template <class T>\r
-class CDynamicUpdateUI : public CUpdateUIBase\r
-{\r
-public:\r
-// Data members\r
-       ATL::CSimpleArray<_AtlUpdateUIMap> m_arrUIMap;     // copy of the static UI data\r
-       ATL::CSimpleArray<_AtlUpdateUIData> m_arrUIData;   // instance UI data\r
-\r
-// Constructor/destructor\r
-       CDynamicUpdateUI()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT;\r
-               const _AtlUpdateUIMap* pMap = pT->GetUpdateUIMap();\r
-               ATLASSERT(pMap != NULL);\r
-\r
-               for(;;)\r
-               {\r
-                       BOOL bRet = m_arrUIMap.Add(*(_AtlUpdateUIMap*)pMap);\r
-                       ATLASSERT(bRet);\r
-\r
-                       if(bRet != FALSE)\r
-                       {\r
-                               _AtlUpdateUIData data = { 0, NULL };\r
-                               bRet = m_arrUIData.Add(data);\r
-                               ATLASSERT(bRet);\r
-                       }\r
-\r
-                       if(pMap->m_nID == (WORD)-1)\r
-                               break;\r
-\r
-                       pMap++;\r
-               }\r
-\r
-               ATLASSERT(m_arrUIMap.GetSize() == m_arrUIData.GetSize());\r
-\r
-#ifdef _DEBUG\r
-               // check for duplicates (debug only)\r
-               for(int i = 0; i < m_arrUIMap.GetSize(); i++)\r
-               {\r
-                       for(int j = 0; j < m_arrUIMap.GetSize(); j++)\r
-                       {\r
-                               // shouldn't have duplicates in the update UI map\r
-                               if(i != j)\r
-                                       ATLASSERT(m_arrUIMap[j].m_nID != m_arrUIMap[i].m_nID);\r
-                       }\r
-               }\r
-#endif // _DEBUG\r
-\r
-               // Set internal data pointers to point to the new data arrays\r
-               m_pUIMap = m_arrUIMap.m_aT;\r
-               m_pUIData = m_arrUIData.m_aT;\r
-       }\r
-\r
-       ~CDynamicUpdateUI()\r
-       {\r
-               for(int i = 0; i < m_arrUIData.GetSize(); i++)\r
-               {\r
-                       if((m_arrUIData[i].m_wState & UPDUI_TEXT) != 0)\r
-                               delete [] m_arrUIData[i].m_lpstrText;\r
-               }\r
-\r
-               // Reset internal data pointers (memory will be released by CSimpleArray d-tor)\r
-               m_pUIMap = NULL;\r
-               m_pUIData = NULL;\r
-       }\r
-\r
-// Methods for dynamically adding and removing update elements\r
-       bool UIAddUpdateElement(WORD nID, WORD wType)\r
-       {\r
-               // check for duplicates\r
-               for(int i = 0; i < m_arrUIMap.GetSize(); i++)\r
-               {\r
-                       // shouldn't have duplicates in the update UI map\r
-                       ATLASSERT(m_arrUIMap[i].m_nID != nID);\r
-                       if(m_arrUIMap[i].m_nID == nID)\r
-                               return false;\r
-               }\r
-\r
-               bool bRetVal = false;\r
-\r
-               // Add new end element\r
-               _AtlUpdateUIMap uumEnd = { (WORD)-1, 0 };\r
-               BOOL bRet = m_arrUIMap.Add(uumEnd);\r
-               ATLASSERT(bRet);\r
-\r
-               if(bRet != FALSE)\r
-               {\r
-                       _AtlUpdateUIData uud = { 0, NULL };\r
-                       bRet = m_arrUIData.Add(uud);\r
-                       ATLASSERT(bRet);\r
-\r
-                       // Set new data to the previous end element\r
-                       if(bRet != FALSE)\r
-                       {\r
-                               int nSize = m_arrUIMap.GetSize();\r
-                               _AtlUpdateUIMap uum = { nID, wType };\r
-                               m_arrUIMap.SetAtIndex(nSize - 2, uum);\r
-                               m_arrUIData.SetAtIndex(nSize - 2, uud);\r
-\r
-                               // Set internal data pointers again, just in case that memory moved\r
-                               m_pUIMap = m_arrUIMap.m_aT;\r
-                               m_pUIData = m_arrUIData.m_aT;\r
-\r
-                               bRetVal = true;\r
-                       }\r
-               }\r
-\r
-               return bRetVal;\r
-       }\r
-\r
-       bool UIRemoveUpdateElement(WORD nID)\r
-       {\r
-               bool bRetVal = false;\r
-\r
-               for(int i = 0; i < m_arrUIMap.GetSize(); i++)\r
-               {\r
-                       if(m_arrUIMap[i].m_nID == nID)\r
-                       {\r
-                               BOOL bRet = m_arrUIMap.RemoveAt(i);\r
-                               ATLASSERT(bRet);\r
-                               bRet = m_arrUIData.RemoveAt(i);\r
-                               ATLASSERT(bRet);\r
-\r
-                               bRetVal = true;\r
-                               break;\r
-                       }\r
-               }\r
-\r
-               return bRetVal;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDialogResize - provides support for resizing dialog controls\r
-//                 (works for any window that has child controls)\r
-\r
-// Put CDialogResize in the list of base classes for a dialog (or even plain window),\r
-// then implement DLGRESIZE map by specifying controls and groups of control\r
-// and using DLSZ_* values to specify how are they supposed to be resized.\r
-//\r
-// Notes:\r
-// - Resizeable border (WS_THICKFRAME style) should be set in the dialog template\r
-//   for top level dialogs (popup or overlapped), so that users can resize the dialog.\r
-// - Some flags cannot be combined; for instance DLSZ_CENTER_X overrides DLSZ_SIZE_X,\r
-//   DLSZ_SIZE_X overrides DLSZ_MOVE_X. X and Y flags can be combined.\r
-// - Order of controls is important - group controls are resized and moved based\r
-//   on the position of the previous control in a group.\r
-\r
-// dialog resize map macros\r
-#define BEGIN_DLGRESIZE_MAP(thisClass) \\r
-       static const _AtlDlgResizeMap* GetDlgResizeMap() \\r
-       { \\r
-               static const _AtlDlgResizeMap theMap[] = \\r
-               {\r
-\r
-#define END_DLGRESIZE_MAP() \\r
-                       { -1, 0 }, \\r
-               }; \\r
-               return theMap; \\r
-       }\r
-\r
-#define DLGRESIZE_CONTROL(id, flags) \\r
-               { id, flags },\r
-\r
-#define BEGIN_DLGRESIZE_GROUP() \\r
-               { -1, _DLSZ_BEGIN_GROUP },\r
-\r
-#define END_DLGRESIZE_GROUP() \\r
-               { -1, _DLSZ_END_GROUP },\r
-\r
-\r
-template <class T>\r
-class CDialogResize\r
-{\r
-public:\r
-// Data declarations and members\r
-       enum\r
-       {\r
-               DLSZ_SIZE_X             = 0x00000001,\r
-               DLSZ_SIZE_Y             = 0x00000002,\r
-               DLSZ_MOVE_X             = 0x00000004,\r
-               DLSZ_MOVE_Y             = 0x00000008,\r
-               DLSZ_REPAINT            = 0x00000010,\r
-               DLSZ_CENTER_X           = 0x00000020,\r
-               DLSZ_CENTER_Y           = 0x00000040,\r
-\r
-               // internal use only\r
-               _DLSZ_BEGIN_GROUP       = 0x00001000,\r
-               _DLSZ_END_GROUP         = 0x00002000,\r
-               _DLSZ_GRIPPER           = 0x00004000\r
-       };\r
-\r
-       struct _AtlDlgResizeMap\r
-       {\r
-               int m_nCtlID;\r
-               DWORD m_dwResizeFlags;\r
-       };\r
-\r
-       struct _AtlDlgResizeData\r
-       {\r
-               int m_nCtlID;\r
-               DWORD m_dwResizeFlags;\r
-               RECT m_rect;\r
-\r
-               int GetGroupCount() const\r
-               {\r
-                       return (int)LOBYTE(HIWORD(m_dwResizeFlags));\r
-               }\r
-\r
-               void SetGroupCount(int nCount)\r
-               {\r
-                       ATLASSERT(nCount > 0 && nCount < 256);\r
-                       DWORD dwCount = (DWORD)MAKELONG(0, MAKEWORD(nCount, 0));\r
-                       m_dwResizeFlags &= 0xFF00FFFF;\r
-                       m_dwResizeFlags |= dwCount;\r
-               }\r
-\r
-               bool operator ==(const _AtlDlgResizeData& r) const\r
-               { return (m_nCtlID == r.m_nCtlID && m_dwResizeFlags == r.m_dwResizeFlags); }\r
-       };\r
-\r
-       ATL::CSimpleArray<_AtlDlgResizeData> m_arrData;\r
-       SIZE m_sizeDialog;\r
-       POINT m_ptMinTrackSize;\r
-       bool m_bGripper;\r
-\r
-\r
-// Constructor\r
-       CDialogResize() : m_bGripper(false)\r
-       {\r
-               m_sizeDialog.cx = 0;\r
-               m_sizeDialog.cy = 0;\r
-               m_ptMinTrackSize.x = -1;\r
-               m_ptMinTrackSize.y = -1;\r
-       }\r
-\r
-// Operations\r
-       void DlgResize_Init(bool bAddGripper = true, bool bUseMinTrackSize = true, DWORD dwForceStyle = WS_CLIPCHILDREN)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               DWORD dwStyle = pT->GetStyle();\r
-\r
-#ifdef _DEBUG\r
-               // Debug only: Check if top level dialogs have a resizeable border.\r
-               if(((dwStyle & WS_CHILD) == 0) && ((dwStyle & WS_THICKFRAME) == 0))\r
-                       ATLTRACE2(atlTraceUI, 0, _T("DlgResize_Init - warning: top level dialog without the WS_THICKFRAME style - user cannot resize it\n"));\r
-#endif // _DEBUG\r
-\r
-               // Force specified styles (default WS_CLIPCHILDREN reduces flicker)\r
-               if((dwStyle & dwForceStyle) != dwForceStyle)\r
-                       pT->ModifyStyle(0, dwForceStyle);\r
-\r
-               // Adding this style removes an empty icon that dialogs with WS_THICKFRAME have.\r
-               // Setting icon to NULL is required when XP themes are active.\r
-               // Note: This will not prevent adding an icon for the dialog using SetIcon()\r
-               if((dwStyle & WS_CHILD) == 0)\r
-               {\r
-                       pT->ModifyStyleEx(0, WS_EX_DLGMODALFRAME);\r
-                       if(pT->GetIcon(FALSE) == NULL)\r
-                               pT->SetIcon(NULL, FALSE);\r
-               }\r
-\r
-               // Cleanup in case of multiple initialization\r
-               // block: first check for the gripper control, destroy it if needed\r
-               {\r
-                       ATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\r
-                       if(wndGripper.IsWindow() && m_arrData.GetSize() > 0 && (m_arrData[0].m_dwResizeFlags & _DLSZ_GRIPPER) != 0)\r
-                               wndGripper.DestroyWindow();\r
-               }\r
-               // clear out everything else\r
-               m_arrData.RemoveAll();\r
-               m_sizeDialog.cx = 0;\r
-               m_sizeDialog.cy = 0;\r
-               m_ptMinTrackSize.x = -1;\r
-               m_ptMinTrackSize.y = -1;\r
-\r
-               // Get initial dialog client size\r
-               RECT rectDlg = { 0 };\r
-               pT->GetClientRect(&rectDlg);\r
-               m_sizeDialog.cx = rectDlg.right;\r
-               m_sizeDialog.cy = rectDlg.bottom;\r
-\r
-#ifndef _WIN32_WCE\r
-               // Create gripper if requested\r
-               m_bGripper = false;\r
-               if(bAddGripper)\r
-               {\r
-                       // shouldn't exist already\r
-                       ATLASSERT(!::IsWindow(pT->GetDlgItem(ATL_IDW_STATUS_BAR)));\r
-                       if(!::IsWindow(pT->GetDlgItem(ATL_IDW_STATUS_BAR)))\r
-                       {\r
-                               ATL::CWindow wndGripper;\r
-                               wndGripper.Create(_T("SCROLLBAR"), pT->m_hWnd, rectDlg, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | SBS_SIZEBOX | SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN, 0, ATL_IDW_STATUS_BAR);\r
-                               ATLASSERT(wndGripper.IsWindow());\r
-                               if(wndGripper.IsWindow())\r
-                               {\r
-                                       m_bGripper = true;\r
-                                       RECT rectCtl = { 0 };\r
-                                       wndGripper.GetWindowRect(&rectCtl);\r
-                                       ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rectCtl, 2);\r
-                                       _AtlDlgResizeData data = { ATL_IDW_STATUS_BAR, DLSZ_MOVE_X | DLSZ_MOVE_Y | DLSZ_REPAINT | _DLSZ_GRIPPER, { rectCtl.left, rectCtl.top, rectCtl.right, rectCtl.bottom } };\r
-                                       m_arrData.Add(data);\r
-                               }\r
-                       }\r
-               }\r
-#else // CE specific\r
-               bAddGripper;   // avoid level 4 warning\r
-#endif // _WIN32_WCE\r
-\r
-               // Get min track position if requested\r
-               if(bUseMinTrackSize)\r
-               {\r
-                       if((dwStyle & WS_CHILD) != 0)\r
-                       {\r
-                               RECT rect = { 0 };\r
-                               pT->GetClientRect(&rect);\r
-                               m_ptMinTrackSize.x = rect.right - rect.left;\r
-                               m_ptMinTrackSize.y = rect.bottom - rect.top;\r
-                       }\r
-                       else\r
-                       {\r
-                               RECT rect = { 0 };\r
-                               pT->GetWindowRect(&rect);\r
-                               m_ptMinTrackSize.x = rect.right - rect.left;\r
-                               m_ptMinTrackSize.y = rect.bottom - rect.top;\r
-                       }\r
-               }\r
-\r
-               // Walk the map and initialize data\r
-               const _AtlDlgResizeMap* pMap = pT->GetDlgResizeMap();\r
-               ATLASSERT(pMap != NULL);\r
-               int nGroupStart = -1;\r
-               for(int nCount = 1; !(pMap->m_nCtlID == -1 && pMap->m_dwResizeFlags == 0); nCount++, pMap++)\r
-               {\r
-                       if(pMap->m_nCtlID == -1)\r
-                       {\r
-                               switch(pMap->m_dwResizeFlags)\r
-                               {\r
-                               case _DLSZ_BEGIN_GROUP:\r
-                                       ATLASSERT(nGroupStart == -1);\r
-                                       nGroupStart = m_arrData.GetSize();\r
-                                       break;\r
-                               case _DLSZ_END_GROUP:\r
-                                       {\r
-                                               ATLASSERT(nGroupStart != -1);\r
-                                               int nGroupCount = m_arrData.GetSize() - nGroupStart;\r
-                                               m_arrData[nGroupStart].SetGroupCount(nGroupCount);\r
-                                               nGroupStart = -1;\r
-                                       }\r
-                                       break;\r
-                               default:\r
-                                       ATLASSERT(FALSE && _T("Invalid DLGRESIZE Map Entry"));\r
-                                       break;\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               // this ID conflicts with the default gripper one\r
-                               ATLASSERT(m_bGripper ? (pMap->m_nCtlID != ATL_IDW_STATUS_BAR) : TRUE);\r
-\r
-                               ATL::CWindow ctl = pT->GetDlgItem(pMap->m_nCtlID);\r
-                               ATLASSERT(ctl.IsWindow());\r
-                               RECT rectCtl = { 0 };\r
-                               ctl.GetWindowRect(&rectCtl);\r
-                               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rectCtl, 2);\r
-\r
-                               DWORD dwGroupFlag = (nGroupStart != -1 && m_arrData.GetSize() == nGroupStart) ? _DLSZ_BEGIN_GROUP : 0;\r
-                               _AtlDlgResizeData data = { pMap->m_nCtlID, pMap->m_dwResizeFlags | dwGroupFlag, { rectCtl.left, rectCtl.top, rectCtl.right, rectCtl.bottom } };\r
-                               m_arrData.Add(data);\r
-                       }\r
-               }\r
-               ATLASSERT((nGroupStart == -1) && _T("No End Group Entry in the DLGRESIZE Map"));\r
-       }\r
-\r
-       void DlgResize_UpdateLayout(int cxWidth, int cyHeight)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               // Restrict minimum size if requested\r
-               if(((pT->GetStyle() & WS_CHILD) != 0) && m_ptMinTrackSize.x != -1 && m_ptMinTrackSize.y != -1)\r
-               {\r
-                       if(cxWidth < m_ptMinTrackSize.x)\r
-                               cxWidth = m_ptMinTrackSize.x;\r
-                       if(cyHeight < m_ptMinTrackSize.y)\r
-                               cyHeight = m_ptMinTrackSize.y;\r
-               }\r
-\r
-               BOOL bVisible = pT->IsWindowVisible();\r
-               if(bVisible)\r
-                       pT->SetRedraw(FALSE);\r
-\r
-               for(int i = 0; i < m_arrData.GetSize(); i++)\r
-               {\r
-                       if((m_arrData[i].m_dwResizeFlags & _DLSZ_BEGIN_GROUP) != 0)   // start of a group\r
-                       {\r
-                               int nGroupCount = m_arrData[i].GetGroupCount();\r
-                               ATLASSERT(nGroupCount > 0 && i + nGroupCount - 1 < m_arrData.GetSize());\r
-                               RECT rectGroup = m_arrData[i].m_rect;\r
-\r
-                               int j = 1;\r
-                               for(j = 1; j < nGroupCount; j++)\r
-                               {\r
-                                       rectGroup.left = min(rectGroup.left, m_arrData[i + j].m_rect.left);\r
-                                       rectGroup.top = min(rectGroup.top, m_arrData[i + j].m_rect.top);\r
-                                       rectGroup.right = max(rectGroup.right, m_arrData[i + j].m_rect.right);\r
-                                       rectGroup.bottom = max(rectGroup.bottom, m_arrData[i + j].m_rect.bottom);\r
-                               }\r
-\r
-                               for(j = 0; j < nGroupCount; j++)\r
-                               {\r
-                                       _AtlDlgResizeData* pDataPrev = NULL;\r
-                                       if(j > 0)\r
-                                               pDataPrev = &(m_arrData[i + j - 1]);\r
-                                       pT->DlgResize_PositionControl(cxWidth, cyHeight, rectGroup, m_arrData[i + j], true, pDataPrev);\r
-                               }\r
-\r
-                               i += nGroupCount - 1;   // increment to skip all group controls\r
-                       }\r
-                       else // one control entry\r
-                       {\r
-                               RECT rectGroup = { 0, 0, 0, 0 };\r
-                               pT->DlgResize_PositionControl(cxWidth, cyHeight, rectGroup, m_arrData[i], false);\r
-                       }\r
-               }\r
-\r
-               if(bVisible)\r
-                       pT->SetRedraw(TRUE);\r
-\r
-               pT->RedrawWindow(NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CDialogResize)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)\r
-#endif // _WIN32_WCE\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-#ifndef _WIN32_WCE\r
-               if(m_bGripper)\r
-               {\r
-                       ATL::CWindow wndGripper = pT->GetDlgItem(ATL_IDW_STATUS_BAR);\r
-                       if(wParam == SIZE_MAXIMIZED)\r
-                               wndGripper.ShowWindow(SW_HIDE);\r
-                       else if(wParam == SIZE_RESTORED)\r
-                               wndGripper.ShowWindow(SW_SHOW);\r
-               }\r
-#endif // _WIN32_WCE\r
-               if(wParam != SIZE_MINIMIZED)\r
-               {\r
-                       ATLASSERT(::IsWindow(pT->m_hWnd));\r
-                       pT->DlgResize_UpdateLayout(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\r
-               }\r
-               return 0;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnGetMinMaxInfo(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               if(m_ptMinTrackSize.x != -1 && m_ptMinTrackSize.y != -1)\r
-               {\r
-                       LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;\r
-                       lpMMI->ptMinTrackSize =  m_ptMinTrackSize;\r
-               }\r
-               return 0;\r
-       }\r
-#endif // _WIN32_WCE\r
-\r
-// Implementation\r
-       bool DlgResize_PositionControl(int cxWidth, int cyHeight, RECT& rectGroup, _AtlDlgResizeData& data, bool bGroup, \r
-                                      _AtlDlgResizeData* pDataPrev = NULL)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               ATL::CWindow ctl;\r
-               RECT rectCtl = { 0 };\r
-\r
-               ctl = pT->GetDlgItem(data.m_nCtlID);\r
-               if(!ctl.GetWindowRect(&rectCtl))\r
-                       return false;\r
-               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rectCtl, 2);\r
-\r
-               if(bGroup)\r
-               {\r
-                       if((data.m_dwResizeFlags & DLSZ_CENTER_X) != 0)\r
-                       {\r
-                               int cxRight = rectGroup.right + cxWidth - m_sizeDialog.cx;\r
-                               int cxCtl = data.m_rect.right - data.m_rect.left;\r
-                               rectCtl.left = rectGroup.left + (cxRight - rectGroup.left - cxCtl) / 2;\r
-                               rectCtl.right = rectCtl.left + cxCtl;\r
-                       }\r
-                       else if((data.m_dwResizeFlags & (DLSZ_SIZE_X | DLSZ_MOVE_X)) != 0)\r
-                       {\r
-                               rectCtl.left = rectGroup.left + ::MulDiv(data.m_rect.left - rectGroup.left, rectGroup.right - rectGroup.left + (cxWidth - m_sizeDialog.cx), rectGroup.right - rectGroup.left);\r
-\r
-                               if((data.m_dwResizeFlags & DLSZ_SIZE_X) != 0)\r
-                               {\r
-                                       rectCtl.right = rectGroup.left + ::MulDiv(data.m_rect.right - rectGroup.left, rectGroup.right - rectGroup.left + (cxWidth - m_sizeDialog.cx), rectGroup.right - rectGroup.left);\r
-\r
-                                       if(pDataPrev != NULL)\r
-                                       {\r
-                                               ATL::CWindow ctlPrev = pT->GetDlgItem(pDataPrev->m_nCtlID);\r
-                                               RECT rcPrev = { 0 };\r
-                                               ctlPrev.GetWindowRect(&rcPrev);\r
-                                               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rcPrev, 2);\r
-                                               int dxAdjust = (rectCtl.left - rcPrev.right) - (data.m_rect.left - pDataPrev->m_rect.right);\r
-                                               rcPrev.right += dxAdjust;\r
-                                               ctlPrev.SetWindowPos(NULL, &rcPrev, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       rectCtl.right = rectCtl.left + (data.m_rect.right - data.m_rect.left);\r
-                               }\r
-                       }\r
-\r
-                       if((data.m_dwResizeFlags & DLSZ_CENTER_Y) != 0)\r
-                       {\r
-                               int cyBottom = rectGroup.bottom + cyHeight - m_sizeDialog.cy;\r
-                               int cyCtl = data.m_rect.bottom - data.m_rect.top;\r
-                               rectCtl.top = rectGroup.top + (cyBottom - rectGroup.top - cyCtl) / 2;\r
-                               rectCtl.bottom = rectCtl.top + cyCtl;\r
-                       }\r
-                       else if((data.m_dwResizeFlags & (DLSZ_SIZE_Y | DLSZ_MOVE_Y)) != 0)\r
-                       {\r
-                               rectCtl.top = rectGroup.top + ::MulDiv(data.m_rect.top - rectGroup.top, rectGroup.bottom - rectGroup.top + (cyHeight - m_sizeDialog.cy), rectGroup.bottom - rectGroup.top);\r
-\r
-                               if((data.m_dwResizeFlags & DLSZ_SIZE_Y) != 0)\r
-                               {\r
-                                       rectCtl.bottom = rectGroup.top + ::MulDiv(data.m_rect.bottom - rectGroup.top, rectGroup.bottom - rectGroup.top + (cyHeight - m_sizeDialog.cy), rectGroup.bottom - rectGroup.top);\r
-\r
-                                       if(pDataPrev != NULL)\r
-                                       {\r
-                                               ATL::CWindow ctlPrev = pT->GetDlgItem(pDataPrev->m_nCtlID);\r
-                                               RECT rcPrev = { 0 };\r
-                                               ctlPrev.GetWindowRect(&rcPrev);\r
-                                               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rcPrev, 2);\r
-                                               int dxAdjust = (rectCtl.top - rcPrev.bottom) - (data.m_rect.top - pDataPrev->m_rect.bottom);\r
-                                               rcPrev.bottom += dxAdjust;\r
-                                               ctlPrev.SetWindowPos(NULL, &rcPrev, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       rectCtl.bottom = rectCtl.top + (data.m_rect.bottom - data.m_rect.top);\r
-                               }\r
-                       }\r
-               }\r
-               else // no group\r
-               {\r
-                       if((data.m_dwResizeFlags & DLSZ_CENTER_X) != 0)\r
-                       {\r
-                               int cxCtl = data.m_rect.right - data.m_rect.left;\r
-                               rectCtl.left = (cxWidth - cxCtl) / 2;\r
-                               rectCtl.right = rectCtl.left + cxCtl;\r
-                       }\r
-                       else if((data.m_dwResizeFlags & (DLSZ_SIZE_X | DLSZ_MOVE_X)) != 0)\r
-                       {\r
-                               rectCtl.right = data.m_rect.right + (cxWidth - m_sizeDialog.cx);\r
-\r
-                               if((data.m_dwResizeFlags & DLSZ_MOVE_X) != 0)\r
-                                       rectCtl.left = rectCtl.right - (data.m_rect.right - data.m_rect.left);\r
-                       }\r
-\r
-                       if((data.m_dwResizeFlags & DLSZ_CENTER_Y) != 0)\r
-                       {\r
-                               int cyCtl = data.m_rect.bottom - data.m_rect.top;\r
-                               rectCtl.top = (cyHeight - cyCtl) / 2;\r
-                               rectCtl.bottom = rectCtl.top + cyCtl;\r
-                       }\r
-                       else if((data.m_dwResizeFlags & (DLSZ_SIZE_Y | DLSZ_MOVE_Y)) != 0)\r
-                       {\r
-                               rectCtl.bottom = data.m_rect.bottom + (cyHeight - m_sizeDialog.cy);\r
-\r
-                               if((data.m_dwResizeFlags & DLSZ_MOVE_Y) != 0)\r
-                                       rectCtl.top = rectCtl.bottom - (data.m_rect.bottom - data.m_rect.top);\r
-                       }\r
-               }\r
-\r
-               if((data.m_dwResizeFlags & DLSZ_REPAINT) != 0)\r
-                       ctl.Invalidate();\r
-\r
-               if((data.m_dwResizeFlags & (DLSZ_SIZE_X | DLSZ_SIZE_Y | DLSZ_MOVE_X | DLSZ_MOVE_Y | DLSZ_REPAINT | DLSZ_CENTER_X | DLSZ_CENTER_Y)) != 0)\r
-                       ctl.SetWindowPos(NULL, &rectCtl, SWP_NOZORDER | SWP_NOACTIVATE);\r
-\r
-               return true;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDoubleBufferImpl - Provides double-buffer painting support to any window\r
-\r
-template <class T>\r
-class CDoubleBufferImpl\r
-{\r
-public:\r
-// Overrideables\r
-       void DoPaint(CDCHandle /*dc*/)\r
-       {\r
-               // must be implemented in a derived class\r
-               ATLASSERT(FALSE);\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CDoubleBufferImpl)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-#endif // !_WIN32_WCE\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background painting needed\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               if(wParam != NULL)\r
-               {\r
-                       RECT rect = { 0 };\r
-                       pT->GetClientRect(&rect);\r
-                       CMemoryDC dcMem((HDC)wParam, rect);\r
-                       pT->DoPaint(dcMem.m_hDC);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       CMemoryDC dcMem(dc.m_hDC, dc.m_ps.rcPaint);\r
-                       pT->DoPaint(dcMem.m_hDC);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDoubleBufferWindowImpl - Implements a double-buffer painting window\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CDoubleBufferWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CDoubleBufferImpl< T >\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CDoubleBufferWindowImpl)\r
-               CHAIN_MSG_MAP(CDoubleBufferImpl< T >)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-// command bar support\r
-#if !defined(__ATLCTRLW_H__) && !defined(_WIN32_WCE)\r
-  #undef CBRM_GETMENU\r
-  #undef CBRM_TRACKPOPUPMENU\r
-  #undef CBRM_GETCMDBAR\r
-  #undef CBRPOPUPMENU\r
-#endif // !defined(__ATLCTRLW_H__) && !defined(_WIN32_WCE)\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLFRAME_H__\r
diff --git a/WTL80/include/atlgdi.h b/WTL80/include/atlgdi.h
deleted file mode 100644 (file)
index 49a1371..0000000
+++ /dev/null
@@ -1,3850 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLGDI_H__\r
-#define __ATLGDI_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlgdi.h requires atlapp.h to be included first\r
-#endif\r
-\r
-\r
-// protect template members from windowsx.h macros\r
-#ifdef _INC_WINDOWSX\r
-  #undef CopyRgn\r
-  #undef CreateBrush\r
-  #undef CreatePen\r
-  #undef SelectBrush\r
-  #undef SelectPen\r
-  #undef SelectFont\r
-  #undef SelectBitmap\r
-#endif // _INC_WINDOWSX\r
-\r
-// required libraries\r
-#if !defined(_ATL_NO_MSIMG) && !defined(_WIN32_WCE)\r
-  #pragma comment(lib, "msimg32.lib")\r
-#endif // !defined(_ATL_NO_MSIMG) && !defined(_WIN32_WCE)\r
-#if !defined(_ATL_NO_OPENGL) && !defined(_WIN32_WCE)\r
-  #pragma comment(lib, "opengl32.lib")\r
-#endif // !defined(_ATL_NO_OPENGL) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CPenT<t_bManaged>\r
-// CBrushT<t_bManaged>\r
-// CLogFont\r
-// CFontT<t_bManaged>\r
-// CBitmapT<t_bManaged>\r
-// CPaletteT<t_bManaged>\r
-// CRgnT<t_bManaged>\r
-// CDCT<t_bManaged>\r
-// CPaintDC\r
-// CClientDC\r
-// CWindowDC\r
-// CMemoryDC\r
-// CEnhMetaFileInfo\r
-// CEnhMetaFileT<t_bManaged>\r
-// CEnhMetaFileDC\r
-//\r
-// Global functions:\r
-//   AtlGetBitmapResourceInfo()\r
-//   AtlGetBitmapResourceBitsPerPixel()\r
-//   AtlIsAlphaBitmapResource()\r
-//   AtlIsDib16()\r
-//   AtlGetDibColorTableSize()\r
-//   AtlGetDibNumColors(),\r
-//   AtlGetDibBitmap()\r
-//   AtlCopyBitmap()\r
-//   AtlCreatePackedDib16()\r
-//   AtlSetClipboardDib16()\r
-//   AtlGetClipboardDib()\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Bitmap resource helpers to extract bitmap information for a bitmap resource\r
-\r
-inline LPBITMAPINFOHEADER AtlGetBitmapResourceInfo(HMODULE hModule, ATL::_U_STRINGorID image)\r
-{\r
-       HRSRC hResource = ::FindResource(hModule, image.m_lpstr, RT_BITMAP);\r
-       ATLASSERT(hResource != NULL);\r
-       HGLOBAL hGlobal = ::LoadResource(hModule, hResource);\r
-       ATLASSERT(hGlobal != NULL);\r
-       LPBITMAPINFOHEADER pBitmapInfoHeader = (LPBITMAPINFOHEADER)::LockResource(hGlobal);\r
-       ATLASSERT(pBitmapInfoHeader != NULL);\r
-       return pBitmapInfoHeader;\r
-}\r
-\r
-inline WORD AtlGetBitmapResourceBitsPerPixel(HMODULE hModule, ATL::_U_STRINGorID image)\r
-{\r
-       LPBITMAPINFOHEADER pBitmapInfoHeader = AtlGetBitmapResourceInfo(hModule, image);\r
-       ATLASSERT(pBitmapInfoHeader != NULL);\r
-       return pBitmapInfoHeader->biBitCount;\r
-}\r
-\r
-inline WORD AtlGetBitmapResourceBitsPerPixel(ATL::_U_STRINGorID image)\r
-{\r
-       return AtlGetBitmapResourceBitsPerPixel(ModuleHelper::GetResourceInstance(), image);\r
-}\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// 32-bit (alpha channel) bitmap resource helper\r
-\r
-// Note: 32-bit (alpha channel) images work only on Windows XP with Common Controls version 6.\r
-// If you want your app to work on older version of Windows, load non-alpha images if Common\r
-// Controls version is less than 6.\r
-\r
-inline bool AtlIsAlphaBitmapResource(ATL::_U_STRINGorID image)\r
-{\r
-       return (AtlGetBitmapResourceBitsPerPixel(image) == 32);\r
-}\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPen\r
-\r
-template <bool t_bManaged>\r
-class CPenT\r
-{\r
-public:\r
-// Data members\r
-       HPEN m_hPen;\r
-\r
-// Constructor/destructor/operators\r
-       CPenT(HPEN hPen = NULL) : m_hPen(hPen)\r
-       { }\r
-\r
-       ~CPenT()\r
-       {\r
-               if(t_bManaged && m_hPen != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-       CPenT<t_bManaged>& operator =(HPEN hPen)\r
-       {\r
-               Attach(hPen);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HPEN hPen)\r
-       {\r
-               if(t_bManaged && m_hPen != NULL && m_hPen != hPen)\r
-                       ::DeleteObject(m_hPen);\r
-               m_hPen = hPen;\r
-       }\r
-\r
-       HPEN Detach()\r
-       {\r
-               HPEN hPen = m_hPen;\r
-               m_hPen = NULL;\r
-               return hPen;\r
-       }\r
-\r
-       operator HPEN() const { return m_hPen; }\r
-\r
-       bool IsNull() const { return (m_hPen == NULL); }\r
-\r
-// Create methods\r
-       HPEN CreatePen(int nPenStyle, int nWidth, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hPen == NULL);\r
-               m_hPen = ::CreatePen(nPenStyle, nWidth, crColor);\r
-               return m_hPen;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HPEN CreatePen(int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, int nStyleCount = 0, const DWORD* lpStyle = NULL)\r
-       {\r
-               ATLASSERT(m_hPen == NULL);\r
-               m_hPen = ::ExtCreatePen(nPenStyle, nWidth, pLogBrush, nStyleCount, lpStyle);\r
-               return m_hPen;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       HPEN CreatePenIndirect(LPLOGPEN lpLogPen)\r
-       {\r
-               ATLASSERT(m_hPen == NULL);\r
-               m_hPen = ::CreatePenIndirect(lpLogPen);\r
-               return m_hPen;\r
-       }\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hPen != NULL);\r
-               BOOL bRet = ::DeleteObject(m_hPen);\r
-               if(bRet)\r
-                       m_hPen = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       int GetLogPen(LOGPEN* pLogPen) const\r
-       {\r
-               ATLASSERT(m_hPen != NULL);\r
-               return ::GetObject(m_hPen, sizeof(LOGPEN), pLogPen);\r
-       }\r
-\r
-       bool GetLogPen(LOGPEN& LogPen) const\r
-       {\r
-               ATLASSERT(m_hPen != NULL);\r
-               return (::GetObject(m_hPen, sizeof(LOGPEN), &LogPen) == sizeof(LOGPEN));\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetExtLogPen(EXTLOGPEN* pLogPen) const\r
-       {\r
-               ATLASSERT(m_hPen != NULL);\r
-               return ::GetObject(m_hPen, sizeof(EXTLOGPEN), pLogPen);\r
-       }\r
-\r
-       bool GetExtLogPen(EXTLOGPEN& ExtLogPen) const\r
-       {\r
-               ATLASSERT(m_hPen != NULL);\r
-               return (::GetObject(m_hPen, sizeof(EXTLOGPEN), &ExtLogPen) == sizeof(EXTLOGPEN));\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-typedef CPenT<false>   CPenHandle;\r
-typedef CPenT<true>    CPen;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBrush\r
-\r
-template <bool t_bManaged>\r
-class CBrushT\r
-{\r
-public:\r
-// Data members\r
-       HBRUSH m_hBrush;\r
-\r
-// Constructor/destructor/operators\r
-       CBrushT(HBRUSH hBrush = NULL) : m_hBrush(hBrush)\r
-       { }\r
-\r
-       ~CBrushT()\r
-       {\r
-               if(t_bManaged && m_hBrush != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-       CBrushT<t_bManaged>& operator =(HBRUSH hBrush)\r
-       {\r
-               Attach(hBrush);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HBRUSH hBrush)\r
-       {\r
-               if(t_bManaged && m_hBrush != NULL && m_hBrush != hBrush)\r
-                       ::DeleteObject(m_hBrush);\r
-               m_hBrush = hBrush;\r
-       }\r
-\r
-       HBRUSH Detach()\r
-       {\r
-               HBRUSH hBrush = m_hBrush;\r
-               m_hBrush = NULL;\r
-               return hBrush;\r
-       }\r
-\r
-       operator HBRUSH() const { return m_hBrush; }\r
-\r
-       bool IsNull() const { return (m_hBrush == NULL); }\r
-\r
-// Create methods\r
-       HBRUSH CreateSolidBrush(COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hBrush == NULL);\r
-               m_hBrush = ::CreateSolidBrush(crColor);\r
-               return m_hBrush;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HBRUSH CreateHatchBrush(int nIndex, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hBrush == NULL);\r
-               m_hBrush = ::CreateHatchBrush(nIndex, crColor);\r
-               return m_hBrush;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if !defined(_WIN32_WCE) || (_ATL_VER >= 0x0800)\r
-       HBRUSH CreateBrushIndirect(const LOGBRUSH* lpLogBrush)\r
-       {\r
-               ATLASSERT(m_hBrush == NULL);\r
-#ifndef _WIN32_WCE\r
-               m_hBrush = ::CreateBrushIndirect(lpLogBrush);\r
-#else // CE specific\r
-               m_hBrush = ATL::CreateBrushIndirect(lpLogBrush);\r
-#endif // _WIN32_WCE\r
-               return m_hBrush;\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_ATL_VER >= 0x0800)\r
-\r
-       HBRUSH CreatePatternBrush(HBITMAP hBitmap)\r
-       {\r
-               ATLASSERT(m_hBrush == NULL);\r
-               m_hBrush = ::CreatePatternBrush(hBitmap);\r
-               return m_hBrush;\r
-       }\r
-\r
-       HBRUSH CreateDIBPatternBrush(HGLOBAL hPackedDIB, UINT nUsage)\r
-       {\r
-               ATLASSERT(hPackedDIB != NULL);\r
-               const void* lpPackedDIB = GlobalLock(hPackedDIB);\r
-               ATLASSERT(lpPackedDIB != NULL);\r
-               m_hBrush = ::CreateDIBPatternBrushPt(lpPackedDIB, nUsage);\r
-               GlobalUnlock(hPackedDIB);\r
-               return m_hBrush;\r
-       }\r
-\r
-       HBRUSH CreateDIBPatternBrush(const void* lpPackedDIB, UINT nUsage)\r
-       {\r
-               ATLASSERT(m_hBrush == NULL);\r
-               m_hBrush = ::CreateDIBPatternBrushPt(lpPackedDIB, nUsage);\r
-               return m_hBrush;\r
-       }\r
-\r
-       HBRUSH CreateSysColorBrush(int nIndex)\r
-       {\r
-               ATLASSERT(m_hBrush == NULL);\r
-               m_hBrush = ::GetSysColorBrush(nIndex);\r
-               return m_hBrush;\r
-       }\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hBrush != NULL);\r
-               BOOL bRet = ::DeleteObject(m_hBrush);\r
-               if(bRet)\r
-                       m_hBrush = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       int GetLogBrush(LOGBRUSH* pLogBrush) const\r
-       {\r
-               ATLASSERT(m_hBrush != NULL);\r
-               return ::GetObject(m_hBrush, sizeof(LOGBRUSH), pLogBrush);\r
-       }\r
-\r
-       bool GetLogBrush(LOGBRUSH& LogBrush) const\r
-       {\r
-               ATLASSERT(m_hBrush != NULL);\r
-               return (::GetObject(m_hBrush, sizeof(LOGBRUSH), &LogBrush) == sizeof(LOGBRUSH));\r
-       }\r
-};\r
-\r
-typedef CBrushT<false>   CBrushHandle;\r
-typedef CBrushT<true>    CBrush;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFont\r
-\r
-class CLogFont : public LOGFONT\r
-{\r
-public:\r
-       CLogFont()\r
-       {\r
-               memset(this, 0, sizeof(LOGFONT));\r
-       }\r
-\r
-       CLogFont(const LOGFONT& lf)\r
-       {\r
-               Copy(&lf);\r
-       }\r
-\r
-       CLogFont(HFONT hFont)\r
-       {\r
-               ATLASSERT(::GetObjectType(hFont) == OBJ_FONT);\r
-               ::GetObject(hFont, sizeof(LOGFONT), (LOGFONT*)this);\r
-       }\r
-\r
-       HFONT CreateFontIndirect()\r
-       {\r
-               return ::CreateFontIndirect(this);\r
-       }\r
-\r
-       void SetBold()\r
-       {\r
-               lfWeight = FW_BOLD;\r
-       }\r
-\r
-       bool IsBold() const\r
-       {\r
-               return (lfWeight >= FW_BOLD);\r
-       }\r
-\r
-       void MakeBolder(int iScale = 1)\r
-       {\r
-               lfWeight += FW_BOLD * iScale;\r
-       }\r
-\r
-       void MakeLarger(int iScale)\r
-       {\r
-               if(lfHeight > 0)\r
-                       lfHeight += iScale;\r
-               else\r
-                       lfHeight -= iScale;\r
-       }\r
-\r
-       void SetHeight(LONG nPointSize, HDC hDC = NULL)\r
-       {\r
-               // For MM_TEXT mapping mode\r
-               lfHeight = -::MulDiv(nPointSize, ::GetDeviceCaps(hDC, LOGPIXELSY), 72);\r
-       }\r
-\r
-       LONG GetHeight(HDC hDC = NULL) const\r
-       {\r
-               // For MM_TEXT mapping mode\r
-               return ::MulDiv(-lfHeight, 72, ::GetDeviceCaps(hDC, LOGPIXELSY));\r
-       }\r
-\r
-       LONG GetDeciPointHeight(HDC hDC = NULL) const\r
-       {\r
-#ifndef _WIN32_WCE\r
-               POINT ptOrg = { 0, 0 };\r
-               ::DPtoLP(hDC, &ptOrg, 1);\r
-               POINT pt = { 0, 0 };\r
-               pt.y = abs(lfHeight) + ptOrg.y;\r
-               ::LPtoDP(hDC,&pt,1);\r
-               return ::MulDiv(pt.y, 720, ::GetDeviceCaps(hDC, LOGPIXELSY));   // 72 points/inch, 10 decipoints/point\r
-#else // CE specific\r
-               // DP and LP are always the same on CE\r
-               return ::MulDiv(abs(lfHeight), 720, ::GetDeviceCaps(hDC, LOGPIXELSY));   // 72 points/inch, 10 decipoints/point\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-       void SetHeightFromDeciPoint(LONG nDeciPtHeight, HDC hDC = NULL)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               POINT pt = { 0, 0 };\r
-               pt.y = ::MulDiv(::GetDeviceCaps(hDC, LOGPIXELSY), nDeciPtHeight, 720);   // 72 points/inch, 10 decipoints/point\r
-               ::DPtoLP(hDC, &pt, 1);\r
-               POINT ptOrg = { 0, 0 };\r
-               ::DPtoLP(hDC, &ptOrg, 1);\r
-               lfHeight = -abs(pt.y - ptOrg.y);\r
-#else // CE specific\r
-               // DP and LP are always the same on CE\r
-               lfHeight = -abs(::MulDiv(::GetDeviceCaps(hDC, LOGPIXELSY), nDeciPtHeight, 720));   // 72 points/inch, 10 decipoints/point\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       void SetCaptionFont()\r
-       {\r
-               NONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\r
-               ATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\r
-               Copy(&ncm.lfCaptionFont);\r
-       }\r
-\r
-       void SetMenuFont()\r
-       {\r
-               NONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\r
-               ATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\r
-               Copy(&ncm.lfMenuFont);\r
-       }\r
-\r
-       void SetStatusFont()\r
-       {\r
-               NONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\r
-               ATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\r
-               Copy(&ncm.lfStatusFont);\r
-       }\r
-\r
-       void SetMessageBoxFont()\r
-       {\r
-               NONCLIENTMETRICS ncm = { RunTimeHelper::SizeOf_NONCLIENTMETRICS() };\r
-               ATLVERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0));\r
-               Copy(&ncm.lfMessageFont);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void Copy(const LOGFONT* pLogFont)\r
-       {\r
-               ATLASSERT(pLogFont != NULL);\r
-               *(LOGFONT*)this = *pLogFont;\r
-       }\r
-\r
-       CLogFont& operator =(const CLogFont& src)\r
-       {\r
-               Copy(&src);\r
-               return *this;\r
-       }\r
-\r
-       CLogFont& operator =(const LOGFONT& src)\r
-       {\r
-               Copy(&src);\r
-               return *this;\r
-       }\r
-\r
-       CLogFont& operator =(HFONT hFont)\r
-       {\r
-               ATLASSERT(::GetObjectType(hFont) == OBJ_FONT);\r
-               ::GetObject(hFont, sizeof(LOGFONT), (LOGFONT*)this);\r
-               return *this;\r
-       }\r
-\r
-       bool operator ==(const LOGFONT& logfont) const\r
-       {\r
-               return(logfont.lfHeight == lfHeight &&\r
-                      logfont.lfWidth == lfWidth &&\r
-                      logfont.lfEscapement == lfEscapement &&\r
-                      logfont.lfOrientation == lfOrientation &&\r
-                      logfont.lfWeight == lfWeight &&\r
-                      logfont.lfItalic == lfItalic &&\r
-                      logfont.lfUnderline == lfUnderline &&\r
-                      logfont.lfStrikeOut == lfStrikeOut &&\r
-                      logfont.lfCharSet == lfCharSet &&\r
-                      logfont.lfOutPrecision == lfOutPrecision &&\r
-                      logfont.lfClipPrecision == lfClipPrecision &&\r
-                      logfont.lfQuality == lfQuality &&\r
-                      logfont.lfPitchAndFamily == lfPitchAndFamily &&\r
-                      lstrcmp(logfont.lfFaceName, lfFaceName) == 0);\r
-       }\r
-};\r
-\r
-\r
-template <bool t_bManaged>\r
-class CFontT\r
-{\r
-public:\r
-// Data members\r
-       HFONT m_hFont;\r
-\r
-// Constructor/destructor/operators\r
-       CFontT(HFONT hFont = NULL) : m_hFont(hFont)\r
-       { }\r
-\r
-       ~CFontT()\r
-       {\r
-               if(t_bManaged && m_hFont != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-       CFontT<t_bManaged>& operator =(HFONT hFont)\r
-       {\r
-               Attach(hFont);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HFONT hFont)\r
-       {\r
-               if(t_bManaged && m_hFont != NULL && m_hFont != hFont)\r
-                       ::DeleteObject(m_hFont);\r
-               m_hFont = hFont;\r
-       }\r
-\r
-       HFONT Detach()\r
-       {\r
-               HFONT hFont = m_hFont;\r
-               m_hFont = NULL;\r
-               return hFont;\r
-       }\r
-\r
-       operator HFONT() const { return m_hFont; }\r
-\r
-       bool IsNull() const { return (m_hFont == NULL); }\r
-\r
-// Create methods\r
-       HFONT CreateFontIndirect(const LOGFONT* lpLogFont)\r
-       {\r
-               ATLASSERT(m_hFont == NULL);\r
-               m_hFont = ::CreateFontIndirect(lpLogFont);\r
-               return m_hFont;\r
-       }\r
-\r
-#if !defined(_WIN32_WCE) && (_WIN32_WINNT >= 0x0500)\r
-       HFONT CreateFontIndirectEx(CONST ENUMLOGFONTEXDV* penumlfex)\r
-       {\r
-               ATLASSERT(m_hFont == NULL);\r
-               m_hFont = ::CreateFontIndirectEx(penumlfex);\r
-               return m_hFont;\r
-       }\r
-#endif // !defined(_WIN32_WCE) && (_WIN32_WINNT >= 0x0500)\r
-\r
-#if !defined(_WIN32_WCE) || (_ATL_VER >= 0x0800)\r
-       HFONT CreateFont(int nHeight, int nWidth, int nEscapement,\r
-                       int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline,\r
-                       BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision,\r
-                       BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily,\r
-                       LPCTSTR lpszFacename)\r
-       {\r
-               ATLASSERT(m_hFont == NULL);\r
-#ifndef _WIN32_WCE\r
-               m_hFont = ::CreateFont(nHeight, nWidth, nEscapement,\r
-                       nOrientation, nWeight, bItalic, bUnderline, cStrikeOut,\r
-                       nCharSet, nOutPrecision, nClipPrecision, nQuality,\r
-                       nPitchAndFamily, lpszFacename);\r
-#else // CE specific\r
-               m_hFont = ATL::CreateFont(nHeight, nWidth, nEscapement,\r
-                       nOrientation, nWeight, bItalic, bUnderline, cStrikeOut,\r
-                       nCharSet, nOutPrecision, nClipPrecision, nQuality,\r
-                       nPitchAndFamily, lpszFacename);\r
-#endif // _WIN32_WCE\r
-               return m_hFont;\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_ATL_VER >= 0x0800)\r
-\r
-       HFONT CreatePointFont(int nPointSize, LPCTSTR lpszFaceName, HDC hDC = NULL, bool bBold = false, bool bItalic = false)\r
-       {\r
-               LOGFONT logFont = { 0 };\r
-               logFont.lfCharSet = DEFAULT_CHARSET;\r
-               logFont.lfHeight = nPointSize;\r
-               SecureHelper::strncpy_x(logFont.lfFaceName, _countof(logFont.lfFaceName), lpszFaceName, _TRUNCATE);\r
-\r
-               if(bBold)\r
-                       logFont.lfWeight = FW_BOLD;\r
-               if(bItalic)\r
-                       logFont.lfItalic = (BYTE)TRUE;\r
-\r
-               return CreatePointFontIndirect(&logFont, hDC);\r
-       }\r
-\r
-       HFONT CreatePointFontIndirect(const LOGFONT* lpLogFont, HDC hDC = NULL)\r
-       {\r
-               HDC hDC1 = (hDC != NULL) ? hDC : ::GetDC(NULL);\r
-\r
-               // convert nPointSize to logical units based on hDC\r
-               LOGFONT logFont = *lpLogFont;\r
-#ifndef _WIN32_WCE\r
-               POINT pt = { 0, 0 };\r
-               pt.y = ::MulDiv(::GetDeviceCaps(hDC1, LOGPIXELSY), logFont.lfHeight, 720);   // 72 points/inch, 10 decipoints/point\r
-               ::DPtoLP(hDC1, &pt, 1);\r
-               POINT ptOrg = { 0, 0 };\r
-               ::DPtoLP(hDC1, &ptOrg, 1);\r
-               logFont.lfHeight = -abs(pt.y - ptOrg.y);\r
-#else // CE specific\r
-               // DP and LP are always the same on CE\r
-               logFont.lfHeight = -abs(::MulDiv(::GetDeviceCaps(hDC1, LOGPIXELSY), logFont.lfHeight, 720));   // 72 points/inch, 10 decipoints/point\r
-#endif // _WIN32_WCE\r
-\r
-               if(hDC == NULL)\r
-                       ::ReleaseDC(NULL, hDC1);\r
-\r
-               return CreateFontIndirect(&logFont);\r
-       }\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hFont != NULL);\r
-               BOOL bRet = ::DeleteObject(m_hFont);\r
-               if(bRet)\r
-                       m_hFont = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       int GetLogFont(LOGFONT* pLogFont) const\r
-       {\r
-               ATLASSERT(m_hFont != NULL);\r
-               return ::GetObject(m_hFont, sizeof(LOGFONT), pLogFont);\r
-       }\r
-\r
-       bool GetLogFont(LOGFONT& LogFont) const\r
-       {\r
-               ATLASSERT(m_hFont != NULL);\r
-               return (::GetObject(m_hFont, sizeof(LOGFONT), &LogFont) == sizeof(LOGFONT));\r
-       }\r
-};\r
-\r
-typedef CFontT<false>   CFontHandle;\r
-typedef CFontT<true>    CFont;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBitmap\r
-\r
-template <bool t_bManaged>\r
-class CBitmapT\r
-{\r
-public:\r
-// Data members\r
-       HBITMAP m_hBitmap;\r
-\r
-// Constructor/destructor/operators\r
-       CBitmapT(HBITMAP hBitmap = NULL) : m_hBitmap(hBitmap)\r
-       { }\r
-\r
-       ~CBitmapT()\r
-       {\r
-               if(t_bManaged && m_hBitmap != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-       CBitmapT<t_bManaged>& operator =(HBITMAP hBitmap)\r
-       {\r
-               Attach(hBitmap);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HBITMAP hBitmap)\r
-       {\r
-               if(t_bManaged && m_hBitmap != NULL&& m_hBitmap != hBitmap)\r
-                       ::DeleteObject(m_hBitmap);\r
-               m_hBitmap = hBitmap;\r
-       }\r
-\r
-       HBITMAP Detach()\r
-       {\r
-               HBITMAP hBitmap = m_hBitmap;\r
-               m_hBitmap = NULL;\r
-               return hBitmap;\r
-       }\r
-\r
-       operator HBITMAP() const { return m_hBitmap; }\r
-\r
-       bool IsNull() const { return (m_hBitmap == NULL); }\r
-\r
-// Create and load methods\r
-       HBITMAP LoadBitmap(ATL::_U_STRINGorID bitmap)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::LoadBitmap(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr);\r
-               return m_hBitmap;\r
-       }\r
-\r
-       HBITMAP LoadOEMBitmap(UINT nIDBitmap) // for OBM_/OCR_/OIC_\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::LoadBitmap(NULL, MAKEINTRESOURCE(nIDBitmap));\r
-               return m_hBitmap;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HBITMAP LoadMappedBitmap(UINT nIDBitmap, UINT nFlags = 0, LPCOLORMAP lpColorMap = NULL, int nMapSize = 0)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateMappedBitmap(ModuleHelper::GetResourceInstance(), nIDBitmap, (WORD)nFlags, lpColorMap, nMapSize);\r
-               return m_hBitmap;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       HBITMAP CreateBitmap(int nWidth, int nHeight, UINT nPlanes, UINT nBitsPerPixel, const void* lpBits)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateBitmap(nWidth, nHeight, nPlanes, nBitsPerPixel, lpBits);\r
-               return m_hBitmap;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HBITMAP CreateBitmapIndirect(LPBITMAP lpBitmap)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateBitmapIndirect(lpBitmap);\r
-               return m_hBitmap;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       HBITMAP CreateCompatibleBitmap(HDC hDC, int nWidth, int nHeight)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateCompatibleBitmap(hDC, nWidth, nHeight);\r
-               return m_hBitmap;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HBITMAP CreateDiscardableBitmap(HDC hDC, int nWidth, int nHeight)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateDiscardableBitmap(hDC, nWidth, nHeight);\r
-               return m_hBitmap;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               BOOL bRet = ::DeleteObject(m_hBitmap);\r
-               if(bRet)\r
-                       m_hBitmap = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       int GetBitmap(BITMAP* pBitMap) const\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::GetObject(m_hBitmap, sizeof(BITMAP), pBitMap);\r
-       }\r
-\r
-       bool GetBitmap(BITMAP& bm) const\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return (::GetObject(m_hBitmap, sizeof(BITMAP), &bm) == sizeof(BITMAP));\r
-       }\r
-\r
-       bool GetSize(SIZE& size) const\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               BITMAP bm = { 0 };\r
-               if(!GetBitmap(&bm))\r
-                       return false;\r
-               size.cx = bm.bmWidth;\r
-               size.cy = bm.bmHeight;\r
-               return true;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       DWORD GetBitmapBits(DWORD dwCount, LPVOID lpBits) const\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::GetBitmapBits(m_hBitmap, dwCount, lpBits);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 410)\r
-       DWORD SetBitmapBits(DWORD dwCount, const void* lpBits)\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::SetBitmapBits(m_hBitmap, dwCount, lpBits);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 410)\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetBitmapDimension(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::GetBitmapDimensionEx(m_hBitmap, lpSize);\r
-       }\r
-\r
-       BOOL SetBitmapDimension(int nWidth, int nHeight, LPSIZE lpSize = NULL)\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::SetBitmapDimensionEx(m_hBitmap, nWidth, nHeight, lpSize);\r
-       }\r
-\r
-// DIB support\r
-       HBITMAP CreateDIBitmap(HDC hDC, CONST BITMAPINFOHEADER* lpbmih, DWORD dwInit, CONST VOID* lpbInit, CONST BITMAPINFO* lpbmi, UINT uColorUse)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateDIBitmap(hDC, lpbmih, dwInit, lpbInit, lpbmi, uColorUse);\r
-               return m_hBitmap;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       HBITMAP CreateDIBSection(HDC hDC, CONST BITMAPINFO* lpbmi, UINT uColorUse, VOID** ppvBits, HANDLE hSection, DWORD dwOffset)\r
-       {\r
-               ATLASSERT(m_hBitmap == NULL);\r
-               m_hBitmap = ::CreateDIBSection(hDC, lpbmi, uColorUse, ppvBits, hSection, dwOffset);\r
-               return m_hBitmap;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetDIBits(HDC hDC, UINT uStartScan, UINT cScanLines,  LPVOID lpvBits, LPBITMAPINFO lpbmi, UINT uColorUse) const\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::GetDIBits(hDC, m_hBitmap, uStartScan, cScanLines,  lpvBits, lpbmi, uColorUse);\r
-       }\r
-\r
-       int SetDIBits(HDC hDC, UINT uStartScan, UINT cScanLines, CONST VOID* lpvBits, CONST BITMAPINFO* lpbmi, UINT uColorUse)\r
-       {\r
-               ATLASSERT(m_hBitmap != NULL);\r
-               return ::SetDIBits(hDC, m_hBitmap, uStartScan, cScanLines, lpvBits, lpbmi, uColorUse);\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-typedef CBitmapT<false>   CBitmapHandle;\r
-typedef CBitmapT<true>    CBitmap;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPalette\r
-\r
-template <bool t_bManaged>\r
-class CPaletteT\r
-{\r
-public:\r
-// Data members\r
-       HPALETTE m_hPalette;\r
-\r
-// Constructor/destructor/operators\r
-       CPaletteT(HPALETTE hPalette = NULL) : m_hPalette(hPalette)\r
-       { }\r
-\r
-       ~CPaletteT()\r
-       {\r
-               if(t_bManaged && m_hPalette != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-       CPaletteT<t_bManaged>& operator =(HPALETTE hPalette)\r
-       {\r
-               Attach(hPalette);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HPALETTE hPalette)\r
-       {\r
-               if(t_bManaged && m_hPalette != NULL && m_hPalette != hPalette)\r
-                       ::DeleteObject(m_hPalette);\r
-               m_hPalette = hPalette;\r
-       }\r
-\r
-       HPALETTE Detach()\r
-       {\r
-               HPALETTE hPalette = m_hPalette;\r
-               m_hPalette = NULL;\r
-               return hPalette;\r
-       }\r
-\r
-       operator HPALETTE() const { return m_hPalette; }\r
-\r
-       bool IsNull() const { return (m_hPalette == NULL); }\r
-\r
-// Create methods\r
-       HPALETTE CreatePalette(LPLOGPALETTE lpLogPalette)\r
-       {\r
-               ATLASSERT(m_hPalette == NULL);\r
-               m_hPalette = ::CreatePalette(lpLogPalette);\r
-               return m_hPalette;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HPALETTE CreateHalftonePalette(HDC hDC)\r
-       {\r
-               ATLASSERT(m_hPalette == NULL);\r
-               ATLASSERT(hDC != NULL);\r
-               m_hPalette = ::CreateHalftonePalette(hDC);\r
-               return m_hPalette;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               BOOL bRet = ::DeleteObject(m_hPalette);\r
-               if(bRet)\r
-                       m_hPalette = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Attributes\r
-       int GetEntryCount() const\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               WORD nEntries = 0;\r
-               ::GetObject(m_hPalette, sizeof(WORD), &nEntries);\r
-               return (int)nEntries;\r
-       }\r
-\r
-       UINT GetPaletteEntries(UINT nStartIndex, UINT nNumEntries, LPPALETTEENTRY lpPaletteColors) const\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               return ::GetPaletteEntries(m_hPalette, nStartIndex, nNumEntries, lpPaletteColors);\r
-       }\r
-\r
-       UINT SetPaletteEntries(UINT nStartIndex, UINT nNumEntries, LPPALETTEENTRY lpPaletteColors)\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               return ::SetPaletteEntries(m_hPalette, nStartIndex, nNumEntries, lpPaletteColors);\r
-       }\r
-\r
-// Operations\r
-#ifndef _WIN32_WCE\r
-       void AnimatePalette(UINT nStartIndex, UINT nNumEntries, LPPALETTEENTRY lpPaletteColors)\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               ::AnimatePalette(m_hPalette, nStartIndex, nNumEntries, lpPaletteColors);\r
-       }\r
-\r
-       BOOL ResizePalette(UINT nNumEntries)\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               return ::ResizePalette(m_hPalette, nNumEntries);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       UINT GetNearestPaletteIndex(COLORREF crColor) const\r
-       {\r
-               ATLASSERT(m_hPalette != NULL);\r
-               return ::GetNearestPaletteIndex(m_hPalette, crColor);\r
-       }\r
-};\r
-\r
-typedef CPaletteT<false>   CPaletteHandle;\r
-typedef CPaletteT<true>    CPalette;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRgn\r
-\r
-template <bool t_bManaged>\r
-class CRgnT\r
-{\r
-public:\r
-// Data members\r
-       HRGN m_hRgn;\r
-\r
-// Constructor/destructor/operators\r
-       CRgnT(HRGN hRgn = NULL) : m_hRgn(hRgn)\r
-       { }\r
-\r
-       ~CRgnT()\r
-       {\r
-               if(t_bManaged && m_hRgn != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-       CRgnT<t_bManaged>& operator =(HRGN hRgn)\r
-       {\r
-               Attach(hRgn);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HRGN hRgn)\r
-       {\r
-               if(t_bManaged && m_hRgn != NULL && m_hRgn != hRgn)\r
-                       ::DeleteObject(m_hRgn);\r
-               m_hRgn = hRgn;\r
-       }\r
-\r
-       HRGN Detach()\r
-       {\r
-               HRGN hRgn = m_hRgn;\r
-               m_hRgn = NULL;\r
-               return hRgn;\r
-       }\r
-\r
-       operator HRGN() const { return m_hRgn; }\r
-\r
-       bool IsNull() const { return (m_hRgn == NULL); }\r
-\r
-// Create methods\r
-       HRGN CreateRectRgn(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreateRectRgn(x1, y1, x2, y2);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreateRectRgnIndirect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreateRectRgnIndirect(lpRect);\r
-               return m_hRgn;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HRGN CreateEllipticRgn(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreateEllipticRgn(x1, y1, x2, y2);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreateEllipticRgnIndirect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreateEllipticRgnIndirect(lpRect);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreatePolygonRgn(LPPOINT lpPoints, int nCount, int nMode)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreatePolygonRgn(lpPoints, nCount, nMode);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreatePolyPolygonRgn(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount, int nPolyFillMode)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreatePolyPolygonRgn(lpPoints, lpPolyCounts, nCount, nPolyFillMode);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::CreateRoundRectRgn(x1, y1, x2, y2, x3, y3);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreateFromPath(HDC hDC)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               ATLASSERT(hDC != NULL);\r
-               m_hRgn = ::PathToRegion(hDC);\r
-               return m_hRgn;\r
-       }\r
-\r
-       HRGN CreateFromData(const XFORM* lpXForm, int nCount, const RGNDATA* pRgnData)\r
-       {\r
-               ATLASSERT(m_hRgn == NULL);\r
-               m_hRgn = ::ExtCreateRegion(lpXForm, nCount, pRgnData);\r
-               return m_hRgn;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               BOOL bRet = ::DeleteObject(m_hRgn);\r
-               if(bRet)\r
-                       m_hRgn = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Operations\r
-       void SetRectRgn(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               ::SetRectRgn(m_hRgn, x1, y1, x2, y2);\r
-       }\r
-\r
-       void SetRectRgn(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               ::SetRectRgn(m_hRgn, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\r
-       }\r
-\r
-       int CombineRgn(HRGN hRgnSrc1, HRGN hRgnSrc2, int nCombineMode)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::CombineRgn(m_hRgn, hRgnSrc1, hRgnSrc2, nCombineMode);\r
-       }\r
-\r
-       int CombineRgn(HRGN hRgnSrc, int nCombineMode)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::CombineRgn(m_hRgn, m_hRgn, hRgnSrc, nCombineMode);\r
-       }\r
-\r
-       int CopyRgn(HRGN hRgnSrc)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::CombineRgn(m_hRgn, hRgnSrc, NULL, RGN_COPY);\r
-       }\r
-\r
-       BOOL EqualRgn(HRGN hRgn) const\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::EqualRgn(m_hRgn, hRgn);\r
-       }\r
-\r
-       int OffsetRgn(int x, int y)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::OffsetRgn(m_hRgn, x, y);\r
-       }\r
-\r
-       int OffsetRgn(POINT point)\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::OffsetRgn(m_hRgn, point.x, point.y);\r
-       }\r
-\r
-       int GetRgnBox(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::GetRgnBox(m_hRgn, lpRect);\r
-       }\r
-\r
-       BOOL PtInRegion(int x, int y) const\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::PtInRegion(m_hRgn, x, y);\r
-       }\r
-\r
-       BOOL PtInRegion(POINT point) const\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::PtInRegion(m_hRgn, point.x, point.y);\r
-       }\r
-\r
-       BOOL RectInRegion(LPCRECT lpRect) const\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return ::RectInRegion(m_hRgn, lpRect);\r
-       }\r
-\r
-       int GetRegionData(LPRGNDATA lpRgnData, int nDataSize) const\r
-       {\r
-               ATLASSERT(m_hRgn != NULL);\r
-               return (int)::GetRegionData(m_hRgn, nDataSize, lpRgnData);\r
-       }\r
-};\r
-\r
-typedef CRgnT<false>   CRgnHandle;\r
-typedef CRgnT<true>    CRgn;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDC - The device context class\r
-\r
-template <bool t_bManaged>\r
-class CDCT\r
-{\r
-public:\r
-// Data members\r
-       HDC m_hDC;\r
-\r
-// Constructor/destructor/operators\r
-       CDCT(HDC hDC = NULL) : m_hDC(hDC)\r
-       {\r
-       }\r
-\r
-       ~CDCT()\r
-       {\r
-               if(t_bManaged && m_hDC != NULL)\r
-                       ::DeleteDC(Detach());\r
-       }\r
-\r
-       CDCT<t_bManaged>& operator =(HDC hDC)\r
-       {\r
-               Attach(hDC);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HDC hDC)\r
-       {\r
-               if(t_bManaged && m_hDC != NULL && m_hDC != hDC)\r
-                       ::DeleteDC(m_hDC);\r
-               m_hDC = hDC;\r
-       }\r
-\r
-       HDC Detach()\r
-       {\r
-               HDC hDC = m_hDC;\r
-               m_hDC = NULL;\r
-               return hDC;\r
-       }\r
-\r
-       operator HDC() const { return m_hDC; }\r
-\r
-       bool IsNull() const { return (m_hDC == NULL); }\r
-\r
-// Operations\r
-#ifndef _WIN32_WCE\r
-       HWND WindowFromDC() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::WindowFromDC(m_hDC);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       CPenHandle GetCurrentPen() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return CPenHandle((HPEN)::GetCurrentObject(m_hDC, OBJ_PEN));\r
-       }\r
-\r
-       CBrushHandle GetCurrentBrush() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return CBrushHandle((HBRUSH)::GetCurrentObject(m_hDC, OBJ_BRUSH));\r
-       }\r
-\r
-       CPaletteHandle GetCurrentPalette() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return CPaletteHandle((HPALETTE)::GetCurrentObject(m_hDC, OBJ_PAL));\r
-       }\r
-\r
-       CFontHandle GetCurrentFont() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return CFontHandle((HFONT)::GetCurrentObject(m_hDC, OBJ_FONT));\r
-       }\r
-\r
-       CBitmapHandle GetCurrentBitmap() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return CBitmapHandle((HBITMAP)::GetCurrentObject(m_hDC, OBJ_BITMAP));\r
-       }\r
-\r
-       HDC CreateDC(LPCTSTR lpszDriverName, LPCTSTR lpszDeviceName, LPCTSTR lpszOutput, const DEVMODE* lpInitData)\r
-       {\r
-               ATLASSERT(m_hDC == NULL);\r
-               m_hDC = ::CreateDC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData);\r
-               return m_hDC;\r
-       }\r
-\r
-       HDC CreateCompatibleDC(HDC hDC = NULL)\r
-       {\r
-               ATLASSERT(m_hDC == NULL);\r
-               m_hDC = ::CreateCompatibleDC(hDC);\r
-               return m_hDC;\r
-       }\r
-\r
-       BOOL DeleteDC()\r
-       {\r
-               if(m_hDC == NULL)\r
-                       return FALSE;\r
-               BOOL bRet = ::DeleteDC(m_hDC);\r
-               if(bRet)\r
-                       m_hDC = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Device-Context Functions\r
-       int SaveDC()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SaveDC(m_hDC);\r
-       }\r
-\r
-       BOOL RestoreDC(int nSavedDC)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::RestoreDC(m_hDC, nSavedDC);\r
-       }\r
-\r
-       int GetDeviceCaps(int nIndex) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetDeviceCaps(m_hDC, nIndex);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       UINT SetBoundsRect(LPCRECT lpRectBounds, UINT flags)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetBoundsRect(m_hDC, lpRectBounds, flags);\r
-       }\r
-\r
-       UINT GetBoundsRect(LPRECT lpRectBounds, UINT flags) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetBoundsRect(m_hDC, lpRectBounds, flags);\r
-       }\r
-\r
-       BOOL ResetDC(const DEVMODE* lpDevMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ResetDC(m_hDC, lpDevMode) != NULL;\r
-       }\r
-\r
-// Drawing-Tool Functions\r
-       BOOL GetBrushOrg(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetBrushOrgEx(m_hDC, lpPoint);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL SetBrushOrg(int x, int y, LPPOINT lpPoint = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetBrushOrgEx(m_hDC, x, y, lpPoint);\r
-       }\r
-\r
-       BOOL SetBrushOrg(POINT point, LPPOINT lpPointRet = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetBrushOrgEx(m_hDC, point.x, point.y, lpPointRet);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int EnumObjects(int nObjectType, int (CALLBACK* lpfn)(LPVOID, LPARAM), LPARAM lpData)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#ifdef STRICT\r
-               return ::EnumObjects(m_hDC, nObjectType, (GOBJENUMPROC)lpfn, lpData);\r
-#else\r
-               return ::EnumObjects(m_hDC, nObjectType, (GOBJENUMPROC)lpfn, (LPVOID)lpData);\r
-#endif\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Type-safe selection helpers\r
-       HPEN SelectPen(HPEN hPen)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#ifndef _WIN32_WCE\r
-               ATLASSERT(hPen == NULL || ::GetObjectType(hPen) == OBJ_PEN || ::GetObjectType(hPen) == OBJ_EXTPEN);\r
-#else // CE specific\r
-               ATLASSERT(hPen == NULL || ::GetObjectType(hPen) == OBJ_PEN);\r
-#endif // _WIN32_WCE\r
-               return (HPEN)::SelectObject(m_hDC, hPen);\r
-       }\r
-\r
-       HBRUSH SelectBrush(HBRUSH hBrush)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ATLASSERT(hBrush == NULL || ::GetObjectType(hBrush) == OBJ_BRUSH);\r
-               return (HBRUSH)::SelectObject(m_hDC, hBrush);\r
-       }\r
-\r
-       HFONT SelectFont(HFONT hFont)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ATLASSERT(hFont == NULL || ::GetObjectType(hFont) == OBJ_FONT);\r
-               return (HFONT)::SelectObject(m_hDC, hFont);\r
-       }\r
-\r
-       HBITMAP SelectBitmap(HBITMAP hBitmap)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ATLASSERT(hBitmap == NULL || ::GetObjectType(hBitmap) == OBJ_BITMAP);\r
-               return (HBITMAP)::SelectObject(m_hDC, hBitmap);\r
-       }\r
-\r
-       int SelectRgn(HRGN hRgn)       // special return for regions\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ATLASSERT(hRgn == NULL || ::GetObjectType(hRgn) == OBJ_REGION);\r
-               return PtrToInt(::SelectObject(m_hDC, hRgn));\r
-       }\r
-\r
-// Type-safe selection helpers for stock objects\r
-       HPEN SelectStockPen(int nPen)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#if (_WIN32_WINNT >= 0x0500)\r
-               ATLASSERT(nPen == WHITE_PEN || nPen == BLACK_PEN || nPen == NULL_PEN || nPen == DC_PEN);\r
-#else\r
-               ATLASSERT(nPen == WHITE_PEN || nPen == BLACK_PEN || nPen == NULL_PEN);\r
-#endif // !(_WIN32_WINNT >= 0x0500)\r
-               return SelectPen((HPEN)::GetStockObject(nPen));\r
-       }\r
-\r
-       HBRUSH SelectStockBrush(int nBrush)\r
-       {\r
-#if (_WIN32_WINNT >= 0x0500)\r
-               ATLASSERT((nBrush >= WHITE_BRUSH && nBrush <= HOLLOW_BRUSH) || nBrush == DC_BRUSH);\r
-#else\r
-               ATLASSERT(nBrush >= WHITE_BRUSH && nBrush <= HOLLOW_BRUSH);\r
-#endif // !(_WIN32_WINNT >= 0x0500)\r
-               return SelectBrush((HBRUSH)::GetStockObject(nBrush));\r
-       }\r
-\r
-       HFONT SelectStockFont(int nFont)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               ATLASSERT((nFont >= OEM_FIXED_FONT && nFont <= SYSTEM_FIXED_FONT) || nFont == DEFAULT_GUI_FONT);\r
-#else // CE specific\r
-               ATLASSERT(nFont == SYSTEM_FONT);\r
-#endif // _WIN32_WCE\r
-               return SelectFont((HFONT)::GetStockObject(nFont));\r
-       }\r
-\r
-       HPALETTE SelectStockPalette(int nPalette, BOOL bForceBackground)\r
-       {\r
-               ATLASSERT(nPalette == DEFAULT_PALETTE); // the only one supported\r
-               return SelectPalette((HPALETTE)::GetStockObject(nPalette), bForceBackground);\r
-       }\r
-\r
-// Color and Color Palette Functions\r
-       COLORREF GetNearestColor(COLORREF crColor) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetNearestColor(m_hDC, crColor);\r
-       }\r
-\r
-       HPALETTE SelectPalette(HPALETTE hPalette, BOOL bForceBackground)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-\r
-               return ::SelectPalette(m_hDC, hPalette, bForceBackground);\r
-       }\r
-\r
-       UINT RealizePalette()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::RealizePalette(m_hDC);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       void UpdateColors()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ::UpdateColors(m_hDC);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Drawing-Attribute Functions\r
-       COLORREF GetBkColor() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetBkColor(m_hDC);\r
-       }\r
-\r
-       int GetBkMode() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetBkMode(m_hDC);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int GetPolyFillMode() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetPolyFillMode(m_hDC);\r
-       }\r
-\r
-       int GetROP2() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetROP2(m_hDC);\r
-       }\r
-\r
-       int GetStretchBltMode() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetStretchBltMode(m_hDC);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       COLORREF GetTextColor() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextColor(m_hDC);\r
-       }\r
-\r
-       COLORREF SetBkColor(COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetBkColor(m_hDC, crColor);\r
-       }\r
-\r
-       int SetBkMode(int nBkMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetBkMode(m_hDC, nBkMode);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int SetPolyFillMode(int nPolyFillMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetPolyFillMode(m_hDC, nPolyFillMode);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int SetROP2(int nDrawMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetROP2(m_hDC, nDrawMode);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int SetStretchBltMode(int nStretchMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetStretchBltMode(m_hDC, nStretchMode);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       COLORREF SetTextColor(COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetTextColor(m_hDC, crColor);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetColorAdjustment(LPCOLORADJUSTMENT lpColorAdjust) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetColorAdjustment(m_hDC, lpColorAdjust);\r
-       }\r
-\r
-       BOOL SetColorAdjustment(const COLORADJUSTMENT* lpColorAdjust)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetColorAdjustment(m_hDC, lpColorAdjust);\r
-       }\r
-\r
-// Mapping Functions\r
-       int GetMapMode() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetMapMode(m_hDC);\r
-       }\r
-\r
-       BOOL GetViewportOrg(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetViewportOrgEx(m_hDC, lpPoint);\r
-       }\r
-\r
-       int SetMapMode(int nMapMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetMapMode(m_hDC, nMapMode);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // Viewport Origin\r
-       BOOL SetViewportOrg(int x, int y, LPPOINT lpPoint = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetViewportOrgEx(m_hDC, x, y, lpPoint);\r
-       }\r
-\r
-       BOOL SetViewportOrg(POINT point, LPPOINT lpPointRet = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return SetViewportOrg(point.x, point.y, lpPointRet);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL OffsetViewportOrg(int nWidth, int nHeight, LPPOINT lpPoint = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::OffsetViewportOrgEx(m_hDC, nWidth, nHeight, lpPoint);\r
-       }\r
-\r
-       // Viewport Extent\r
-       BOOL GetViewportExt(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetViewportExtEx(m_hDC, lpSize);\r
-       }\r
-\r
-       BOOL SetViewportExt(int x, int y, LPSIZE lpSize = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetViewportExtEx(m_hDC, x, y, lpSize);\r
-       }\r
-\r
-       BOOL SetViewportExt(SIZE size, LPSIZE lpSizeRet = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return SetViewportExt(size.cx, size.cy, lpSizeRet);\r
-       }\r
-\r
-       BOOL ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom, LPSIZE lpSize = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ScaleViewportExtEx(m_hDC, xNum, xDenom, yNum, yDenom, lpSize);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // Window Origin\r
-#ifndef _WIN32_WCE\r
-       BOOL GetWindowOrg(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetWindowOrgEx(m_hDC, lpPoint);\r
-       }\r
-\r
-       BOOL SetWindowOrg(int x, int y, LPPOINT lpPoint = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetWindowOrgEx(m_hDC, x, y, lpPoint);\r
-       }\r
-\r
-       BOOL SetWindowOrg(POINT point, LPPOINT lpPointRet = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return SetWindowOrg(point.x, point.y, lpPointRet);\r
-       }\r
-\r
-       BOOL OffsetWindowOrg(int nWidth, int nHeight, LPPOINT lpPoint = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::OffsetWindowOrgEx(m_hDC, nWidth, nHeight, lpPoint);\r
-       }\r
-\r
-       // Window extent\r
-       BOOL GetWindowExt(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetWindowExtEx(m_hDC, lpSize);\r
-       }\r
-\r
-       BOOL SetWindowExt(int x, int y, LPSIZE lpSize = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetWindowExtEx(m_hDC, x, y, lpSize);\r
-       }\r
-\r
-       BOOL SetWindowExt(SIZE size, LPSIZE lpSizeRet = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return SetWindowExt(size.cx, size.cy, lpSizeRet);\r
-       }\r
-\r
-       BOOL ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom, LPSIZE lpSize = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ScaleWindowExtEx(m_hDC, xNum, xDenom, yNum, yDenom, lpSize);\r
-       }\r
-\r
-// Coordinate Functions\r
-       BOOL DPtoLP(LPPOINT lpPoints, int nCount = 1) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DPtoLP(m_hDC, lpPoints, nCount);\r
-       }\r
-\r
-       BOOL DPtoLP(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DPtoLP(m_hDC, (LPPOINT)lpRect, 2);\r
-       }\r
-\r
-       BOOL DPtoLP(LPSIZE lpSize) const\r
-       {\r
-               SIZE sizeWinExt = { 0, 0 };\r
-               if(!GetWindowExt(&sizeWinExt))\r
-                       return FALSE;\r
-               SIZE sizeVpExt = { 0, 0 };\r
-               if(!GetViewportExt(&sizeVpExt))\r
-                       return FALSE;\r
-               lpSize->cx = ::MulDiv(lpSize->cx, abs(sizeWinExt.cx), abs(sizeVpExt.cx));\r
-               lpSize->cy = ::MulDiv(lpSize->cy, abs(sizeWinExt.cy), abs(sizeVpExt.cy));\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL LPtoDP(LPPOINT lpPoints, int nCount = 1) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::LPtoDP(m_hDC, lpPoints, nCount);\r
-       }\r
-\r
-       BOOL LPtoDP(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::LPtoDP(m_hDC, (LPPOINT)lpRect, 2);\r
-       }\r
-\r
-       BOOL LPtoDP(LPSIZE lpSize) const\r
-       {\r
-               SIZE sizeWinExt = { 0, 0 };\r
-               if(!GetWindowExt(&sizeWinExt))\r
-                       return FALSE;\r
-               SIZE sizeVpExt = { 0, 0 };\r
-               if(!GetViewportExt(&sizeVpExt))\r
-                       return FALSE;\r
-               lpSize->cx = ::MulDiv(lpSize->cx, abs(sizeVpExt.cx), abs(sizeWinExt.cx));\r
-               lpSize->cy = ::MulDiv(lpSize->cy, abs(sizeVpExt.cy), abs(sizeWinExt.cy));\r
-               return TRUE;\r
-       }\r
-\r
-// Special Coordinate Functions (useful for dealing with metafiles and OLE)\r
-       #define HIMETRIC_INCH   2540    // HIMETRIC units per inch\r
-\r
-       void DPtoHIMETRIC(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               int nMapMode;\r
-               if((nMapMode = GetMapMode()) < MM_ISOTROPIC && nMapMode != MM_TEXT)\r
-               {\r
-                       // when using a constrained map mode, map against physical inch\r
-                       ((CDCHandle*)this)->SetMapMode(MM_HIMETRIC);\r
-                       DPtoLP(lpSize);\r
-                       ((CDCHandle*)this)->SetMapMode(nMapMode);\r
-               }\r
-               else\r
-               {\r
-                       // map against logical inch for non-constrained mapping modes\r
-                       int cxPerInch = GetDeviceCaps(LOGPIXELSX);\r
-                       int cyPerInch = GetDeviceCaps(LOGPIXELSY);\r
-                       ATLASSERT(cxPerInch != 0 && cyPerInch != 0);\r
-                       lpSize->cx = ::MulDiv(lpSize->cx, HIMETRIC_INCH, cxPerInch);\r
-                       lpSize->cy = ::MulDiv(lpSize->cy, HIMETRIC_INCH, cyPerInch);\r
-               }\r
-       }\r
-\r
-       void HIMETRICtoDP(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               int nMapMode;\r
-               if((nMapMode = GetMapMode()) < MM_ISOTROPIC && nMapMode != MM_TEXT)\r
-               {\r
-                       // when using a constrained map mode, map against physical inch\r
-                       ((CDCHandle*)this)->SetMapMode(MM_HIMETRIC);\r
-                       LPtoDP(lpSize);\r
-                       ((CDCHandle*)this)->SetMapMode(nMapMode);\r
-               }\r
-               else\r
-               {\r
-                       // map against logical inch for non-constrained mapping modes\r
-                       int cxPerInch = GetDeviceCaps(LOGPIXELSX);\r
-                       int cyPerInch = GetDeviceCaps(LOGPIXELSY);\r
-                       ATLASSERT(cxPerInch != 0 && cyPerInch != 0);\r
-                       lpSize->cx = ::MulDiv(lpSize->cx, cxPerInch, HIMETRIC_INCH);\r
-                       lpSize->cy = ::MulDiv(lpSize->cy, cyPerInch, HIMETRIC_INCH);\r
-               }\r
-       }\r
-\r
-       void LPtoHIMETRIC(LPSIZE lpSize) const\r
-       {\r
-               LPtoDP(lpSize);\r
-               DPtoHIMETRIC(lpSize);\r
-       }\r
-\r
-       void HIMETRICtoLP(LPSIZE lpSize) const\r
-       {\r
-               HIMETRICtoDP(lpSize);\r
-               DPtoLP(lpSize);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Region Functions\r
-       BOOL FillRgn(HRGN hRgn, HBRUSH hBrush)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FillRgn(m_hDC, hRgn, hBrush);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL FrameRgn(HRGN hRgn, HBRUSH hBrush, int nWidth, int nHeight)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FrameRgn(m_hDC, hRgn, hBrush, nWidth, nHeight);\r
-       }\r
-\r
-       BOOL InvertRgn(HRGN hRgn)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::InvertRgn(m_hDC, hRgn);\r
-       }\r
-\r
-       BOOL PaintRgn(HRGN hRgn)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PaintRgn(m_hDC, hRgn);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Clipping Functions\r
-       int GetClipBox(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetClipBox(m_hDC, lpRect);\r
-       }\r
-\r
-       int GetClipRgn(CRgn& region) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(region.IsNull())\r
-                       region.CreateRectRgn(0, 0, 0, 0);\r
-\r
-               int nRet = ::GetClipRgn(m_hDC, region);\r
-               if(nRet != 1)\r
-                       region.DeleteObject();\r
-\r
-               return nRet;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL PtVisible(int x, int y) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PtVisible(m_hDC, x, y);\r
-       }\r
-\r
-       BOOL PtVisible(POINT point) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PtVisible(m_hDC, point.x, point.y);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL RectVisible(LPCRECT lpRect) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::RectVisible(m_hDC, lpRect);\r
-       }\r
-\r
-       int SelectClipRgn(HRGN hRgn)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SelectClipRgn(m_hDC, (HRGN)hRgn);\r
-       }\r
-\r
-       int ExcludeClipRect(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ExcludeClipRect(m_hDC, x1, y1, x2, y2);\r
-       }\r
-\r
-       int ExcludeClipRect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ExcludeClipRect(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int ExcludeUpdateRgn(HWND hWnd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ExcludeUpdateRgn(m_hDC, hWnd);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int IntersectClipRect(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::IntersectClipRect(m_hDC, x1, y1, x2, y2);\r
-       }\r
-\r
-       int IntersectClipRect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::IntersectClipRect(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int OffsetClipRgn(int x, int y)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::OffsetClipRgn(m_hDC, x, y);\r
-       }\r
-\r
-       int OffsetClipRgn(SIZE size)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::OffsetClipRgn(m_hDC, size.cx, size.cy);\r
-       }\r
-\r
-       int SelectClipRgn(HRGN hRgn, int nMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ExtSelectClipRgn(m_hDC, hRgn, nMode);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Line-Output Functions\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-       BOOL GetCurrentPosition(LPPOINT lpPoint) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCurrentPositionEx(m_hDC, lpPoint);\r
-       }\r
-\r
-       BOOL MoveTo(int x, int y, LPPOINT lpPoint = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::MoveToEx(m_hDC, x, y, lpPoint);\r
-       }\r
-\r
-       BOOL MoveTo(POINT point, LPPOINT lpPointRet = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return MoveTo(point.x, point.y, lpPointRet);\r
-       }\r
-\r
-       BOOL LineTo(int x, int y)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::LineTo(m_hDC, x, y);\r
-       }\r
-\r
-       BOOL LineTo(POINT point)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return LineTo(point.x, point.y);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL Arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Arc(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\r
-       }\r
-\r
-       BOOL Arc(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Arc(m_hDC, lpRect->left, lpRect->top,\r
-                       lpRect->right, lpRect->bottom, ptStart.x, ptStart.y,\r
-                       ptEnd.x, ptEnd.y);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL Polyline(LPPOINT lpPoints, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Polyline(m_hDC, lpPoints, nCount);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL AngleArc(int x, int y, int nRadius, float fStartAngle, float fSweepAngle)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::AngleArc(m_hDC, x, y, nRadius, fStartAngle, fSweepAngle);\r
-       }\r
-\r
-       BOOL ArcTo(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ArcTo(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\r
-       }\r
-\r
-       BOOL ArcTo(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ArcTo(lpRect->left, lpRect->top, lpRect->right,\r
-               lpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);\r
-       }\r
-\r
-       int GetArcDirection() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetArcDirection(m_hDC);\r
-       }\r
-\r
-       int SetArcDirection(int nArcDirection)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetArcDirection(m_hDC, nArcDirection);\r
-       }\r
-\r
-       BOOL PolyDraw(const POINT* lpPoints, const BYTE* lpTypes, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PolyDraw(m_hDC, lpPoints, lpTypes, nCount);\r
-       }\r
-\r
-       BOOL PolylineTo(const POINT* lpPoints, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PolylineTo(m_hDC, lpPoints, nCount);\r
-       }\r
-\r
-       BOOL PolyPolyline(const POINT* lpPoints,\r
-               const DWORD* lpPolyPoints, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PolyPolyline(m_hDC, lpPoints, lpPolyPoints, nCount);\r
-       }\r
-\r
-       BOOL PolyBezier(const POINT* lpPoints, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PolyBezier(m_hDC, lpPoints, nCount);\r
-       }\r
-\r
-       BOOL PolyBezierTo(const POINT* lpPoints, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PolyBezierTo(m_hDC, lpPoints, nCount);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Simple Drawing Functions\r
-       BOOL FillRect(LPCRECT lpRect, HBRUSH hBrush)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FillRect(m_hDC, lpRect, hBrush);\r
-       }\r
-\r
-       BOOL FillRect(LPCRECT lpRect, int nColorIndex)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#ifndef _WIN32_WCE\r
-               return ::FillRect(m_hDC, lpRect, (HBRUSH)LongToPtr(nColorIndex + 1));\r
-#else // CE specific\r
-               return ::FillRect(m_hDC, lpRect, ::GetSysColorBrush(nColorIndex));\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL FrameRect(LPCRECT lpRect, HBRUSH hBrush)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FrameRect(m_hDC, lpRect, hBrush);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 420)\r
-       BOOL InvertRect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::InvertRect(m_hDC, lpRect);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 420)\r
-\r
-       BOOL DrawIcon(int x, int y, HICON hIcon)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#ifndef _WIN32_WCE\r
-               return ::DrawIcon(m_hDC, x, y, hIcon);\r
-#else // CE specific\r
-               return ::DrawIconEx(m_hDC, x, y, hIcon, 0, 0, 0, NULL, DI_NORMAL);\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-       BOOL DrawIcon(POINT point, HICON hIcon)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#ifndef _WIN32_WCE\r
-               return ::DrawIcon(m_hDC, point.x, point.y, hIcon);\r
-#else // CE specific\r
-               return ::DrawIconEx(m_hDC, point.x, point.y, hIcon, 0, 0, 0, NULL, DI_NORMAL);\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-       BOOL DrawIconEx(int x, int y, HICON hIcon, int cxWidth, int cyWidth, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawIconEx(m_hDC, x, y, hIcon, cxWidth, cyWidth, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\r
-       }\r
-\r
-       BOOL DrawIconEx(POINT point, HICON hIcon, SIZE size, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawIconEx(m_hDC, point.x, point.y, hIcon, size.cx, size.cy, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL DrawState(POINT pt, SIZE size, HBITMAP hBitmap, UINT nFlags, HBRUSH hBrush = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawState(m_hDC, hBrush, NULL, (LPARAM)hBitmap, 0, pt.x, pt.y, size.cx, size.cy, nFlags | DST_BITMAP);\r
-       }\r
-\r
-       BOOL DrawState(POINT pt, SIZE size, HICON hIcon, UINT nFlags, HBRUSH hBrush = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawState(m_hDC, hBrush, NULL, (LPARAM)hIcon, 0, pt.x, pt.y, size.cx, size.cy, nFlags | DST_ICON);\r
-       }\r
-\r
-       BOOL DrawState(POINT pt, SIZE size, LPCTSTR lpszText, UINT nFlags, BOOL bPrefixText = TRUE, int nTextLen = 0, HBRUSH hBrush = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawState(m_hDC, hBrush, NULL, (LPARAM)lpszText, (WPARAM)nTextLen, pt.x, pt.y, size.cx, size.cy, nFlags | (bPrefixText ? DST_PREFIXTEXT : DST_TEXT));\r
-       }\r
-\r
-       BOOL DrawState(POINT pt, SIZE size, DRAWSTATEPROC lpDrawProc, LPARAM lData, UINT nFlags, HBRUSH hBrush = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawState(m_hDC, hBrush, lpDrawProc, lData, 0, pt.x, pt.y, size.cx, size.cy, nFlags | DST_COMPLEX);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Ellipse and Polygon Functions\r
-#ifndef _WIN32_WCE\r
-       BOOL Chord(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Chord(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\r
-       }\r
-\r
-       BOOL Chord(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Chord(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       void DrawFocusRect(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ::DrawFocusRect(m_hDC, lpRect);\r
-       }\r
-\r
-       BOOL Ellipse(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Ellipse(m_hDC, x1, y1, x2, y2);\r
-       }\r
-\r
-       BOOL Ellipse(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Ellipse(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Pie(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);\r
-       }\r
-\r
-       BOOL Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Pie(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL Polygon(LPPOINT lpPoints, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Polygon(m_hDC, lpPoints, nCount);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL PolyPolygon(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PolyPolygon(m_hDC, lpPoints, lpPolyCounts, nCount);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL Rectangle(int x1, int y1, int x2, int y2)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Rectangle(m_hDC, x1, y1, x2, y2);\r
-       }\r
-\r
-       BOOL Rectangle(LPCRECT lpRect)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Rectangle(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);\r
-       }\r
-\r
-       BOOL RoundRect(int x1, int y1, int x2, int y2, int x3, int y3)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::RoundRect(m_hDC, x1, y1, x2, y2, x3, y3);\r
-       }\r
-\r
-       BOOL RoundRect(LPCRECT lpRect, POINT point)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::RoundRect(m_hDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, point.x, point.y);\r
-       }\r
-\r
-// Bitmap Functions\r
-       BOOL PatBlt(int x, int y, int nWidth, int nHeight, DWORD dwRop)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PatBlt(m_hDC, x, y, nWidth, nHeight, dwRop);\r
-       }\r
-\r
-       BOOL BitBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC,\r
-               int xSrc, int ySrc, DWORD dwRop)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::BitBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, dwRop);\r
-       }\r
-\r
-       BOOL StretchBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::StretchBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, dwRop);\r
-       }\r
-\r
-       COLORREF GetPixel(int x, int y) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetPixel(m_hDC, x, y);\r
-       }\r
-\r
-       COLORREF GetPixel(POINT point) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetPixel(m_hDC, point.x, point.y);\r
-       }\r
-\r
-       COLORREF SetPixel(int x, int y, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetPixel(m_hDC, x, y, crColor);\r
-       }\r
-\r
-       COLORREF SetPixel(POINT point, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetPixel(m_hDC, point.x, point.y, crColor);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL FloodFill(int x, int y, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FloodFill(m_hDC, x, y, crColor);\r
-       }\r
-\r
-       BOOL ExtFloodFill(int x, int y, COLORREF crColor, UINT nFillType)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ExtFloodFill(m_hDC, x, y, crColor, nFillType);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL MaskBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, HBITMAP hMaskBitmap, int xMask, int yMask, DWORD dwRop)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::MaskBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, hMaskBitmap, xMask, yMask, dwRop);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL PlgBlt(LPPOINT lpPoint, HDC hSrcDC, int xSrc, int ySrc, int nWidth, int nHeight, HBITMAP hMaskBitmap, int xMask, int yMask)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PlgBlt(m_hDC, lpPoint, hSrcDC, xSrc, ySrc, nWidth, nHeight, hMaskBitmap, xMask, yMask);\r
-       }\r
-\r
-       BOOL SetPixelV(int x, int y, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetPixelV(m_hDC, x, y, crColor);\r
-       }\r
-\r
-       BOOL SetPixelV(POINT point, COLORREF crColor)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetPixelV(m_hDC, point.x, point.y, crColor);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if !defined(_ATL_NO_MSIMG) || defined(_WIN32_WCE)\r
-#ifndef _WIN32_WCE\r
-       BOOL TransparentBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, UINT crTransparent)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::TransparentBlt(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, crTransparent);\r
-       }\r
-#else // CE specific\r
-       BOOL TransparentImage(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, UINT crTransparent)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::TransparentImage(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, crTransparent);\r
-       }\r
-#endif // _WIN32_WCE\r
-\r
-#if (!defined(_WIN32_WCE) || (_WIN32_WCE >= 420))\r
-       BOOL GradientFill(const PTRIVERTEX pVertices, DWORD nVertices, void* pMeshElements, DWORD nMeshElements, DWORD dwMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GradientFill(m_hDC, pVertices, nVertices, pMeshElements, nMeshElements, dwMode);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 420)\r
-\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE > 0x500)\r
-       BOOL AlphaBlend(int x, int y, int nWidth, int nHeight, HDC hSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, BLENDFUNCTION bf)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::AlphaBlend(m_hDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, bf);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE > 0x500)\r
-#endif //  !defined(_ATL_NO_MSIMG) || defined(_WIN32_WCE)\r
-\r
-// Extra bitmap functions\r
-       // Helper function for painting a disabled toolbar or menu bitmap\r
-       // This function can take either an HBITMAP (for SS) or a DC with \r
-       //           the bitmap already painted (for cmdbar)\r
-       BOOL DitherBlt(int x, int y, int nWidth, int nHeight, HDC hSrcDC, HBITMAP hBitmap, int xSrc, int ySrc,\r
-                       HBRUSH hBrushBackground = ::GetSysColorBrush(COLOR_3DFACE),\r
-                       HBRUSH hBrush3DEffect = ::GetSysColorBrush(COLOR_3DHILIGHT),\r
-                       HBRUSH hBrushDisabledImage = ::GetSysColorBrush(COLOR_3DSHADOW))\r
-       {\r
-               ATLASSERT(m_hDC != NULL || hBitmap != NULL);\r
-               ATLASSERT(nWidth > 0 && nHeight > 0);\r
-               \r
-               // Create a generic DC for all BitBlts\r
-               CDCHandle dc = (hSrcDC != NULL) ? hSrcDC : ::CreateCompatibleDC(m_hDC);\r
-               ATLASSERT(dc.m_hDC != NULL);\r
-               if(dc.m_hDC == NULL)\r
-                       return FALSE;\r
-               \r
-               // Create a DC for the monochrome DIB section\r
-               CDC dcBW = ::CreateCompatibleDC(m_hDC);\r
-               ATLASSERT(dcBW.m_hDC != NULL);\r
-               if(dcBW.m_hDC == NULL)\r
-               {\r
-                       if(hSrcDC == NULL)\r
-                               dc.DeleteDC();\r
-                       return FALSE;\r
-               }\r
-\r
-               // Create the monochrome DIB section with a black and white palette\r
-               struct RGBBWBITMAPINFO\r
-               {\r
-                       BITMAPINFOHEADER bmiHeader; \r
-                       RGBQUAD bmiColors[2]; \r
-               };\r
-\r
-               RGBBWBITMAPINFO rgbBWBitmapInfo = \r
-               {\r
-                       { sizeof(BITMAPINFOHEADER), nWidth, nHeight, 1, 1, BI_RGB, 0, 0, 0, 0, 0 },\r
-                       { { 0x00, 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF, 0x00 } }\r
-               };\r
-\r
-               VOID* pbitsBW;\r
-               CBitmap bmpBW = ::CreateDIBSection(dcBW, (LPBITMAPINFO)&rgbBWBitmapInfo, DIB_RGB_COLORS, &pbitsBW, NULL, 0);\r
-               ATLASSERT(bmpBW.m_hBitmap != NULL);\r
-               if(bmpBW.m_hBitmap == NULL)\r
-               {\r
-                       if(hSrcDC == NULL)\r
-                               dc.DeleteDC();\r
-                       return FALSE;\r
-               }\r
-               \r
-               // Attach the monochrome DIB section and the bitmap to the DCs\r
-               HBITMAP hbmOldBW = dcBW.SelectBitmap(bmpBW);\r
-               HBITMAP hbmOldDC = NULL;\r
-               if(hBitmap != NULL)\r
-                       hbmOldDC = dc.SelectBitmap(hBitmap);\r
-\r
-               // Block: Dark gray removal: we want (128, 128, 128) pixels to become black and not white\r
-               {\r
-                       CDC dcTemp1 = ::CreateCompatibleDC(m_hDC);\r
-                       CDC dcTemp2 = ::CreateCompatibleDC(m_hDC);\r
-                       CBitmap bmpTemp1;\r
-                       bmpTemp1.CreateCompatibleBitmap(dc, nWidth, nHeight);\r
-                       CBitmap bmpTemp2;\r
-                       bmpTemp2.CreateBitmap(nWidth, nHeight, 1, 1, NULL);\r
-                       HBITMAP hOldBmp1 = dcTemp1.SelectBitmap(bmpTemp1);\r
-                       HBITMAP hOldBmp2 = dcTemp2.SelectBitmap(bmpTemp2);\r
-                       // Let's copy our image, it will be altered\r
-                       dcTemp1.BitBlt(0, 0, nWidth, nHeight, dc, xSrc, ySrc, SRCCOPY);\r
-\r
-                       // All dark gray pixels will become white, the others black\r
-                       dcTemp1.SetBkColor(RGB(128, 128, 128));\r
-                       dcTemp2.BitBlt(0, 0, nWidth, nHeight, dcTemp1, 0, 0, SRCCOPY);\r
-                       // Do an XOR to set to black these white pixels\r
-                       dcTemp1.BitBlt(0, 0, nWidth, nHeight, dcTemp2, 0, 0, SRCINVERT);\r
-\r
-                       // BitBlt the bitmap into the monochrome DIB section\r
-                       // The DIB section will do a true monochrome conversion\r
-                       // The magenta background being closer to white will become white\r
-                       dcBW.BitBlt(0, 0, nWidth, nHeight, dcTemp1, 0, 0, SRCCOPY);\r
-\r
-                       // Cleanup\r
-                       dcTemp1.SelectBitmap(hOldBmp1);\r
-                       dcTemp2.SelectBitmap(hOldBmp2);\r
-               }\r
-               \r
-               // Paint the destination rectangle using hBrushBackground\r
-               if(hBrushBackground != NULL)\r
-               {\r
-                       RECT rc = { x, y, x + nWidth, y + nHeight };\r
-                       FillRect(&rc, hBrushBackground);\r
-               }\r
-\r
-               // BitBlt the black bits in the monochrome bitmap into hBrush3DEffect color in the destination DC\r
-               // The magic ROP comes from the Charles Petzold's book\r
-               HBRUSH hOldBrush = SelectBrush(hBrush3DEffect);\r
-               BitBlt(x + 1, y + 1, nWidth, nHeight, dcBW, 0, 0, 0xB8074A);\r
-\r
-               // BitBlt the black bits in the monochrome bitmap into hBrushDisabledImage color in the destination DC\r
-               SelectBrush(hBrushDisabledImage);\r
-               BitBlt(x, y, nWidth, nHeight, dcBW, 0, 0, 0xB8074A);\r
-\r
-               SelectBrush(hOldBrush);\r
-               dcBW.SelectBitmap(hbmOldBW);\r
-               dc.SelectBitmap(hbmOldDC);\r
-\r
-               if(hSrcDC == NULL)\r
-                       dc.DeleteDC();\r
-\r
-               return TRUE;\r
-       }\r
-\r
-// Text Functions\r
-#ifndef _WIN32_WCE\r
-       BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount = -1)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(nCount == -1)\r
-                       nCount = lstrlen(lpszString);\r
-               return ::TextOut(m_hDC, x, y, lpszString, nCount);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect, LPCTSTR lpszString, UINT nCount = -1, LPINT lpDxWidths = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(nCount == -1)\r
-                       nCount = lstrlen(lpszString);\r
-               return ::ExtTextOut(m_hDC, x, y, nOptions, lpRect, lpszString, nCount, lpDxWidths);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       SIZE TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount = -1, int nTabPositions = 0, LPINT lpnTabStopPositions = NULL, int nTabOrigin = 0)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(nCount == -1)\r
-                       nCount = lstrlen(lpszString);\r
-               LONG lRes = ::TabbedTextOut(m_hDC, x, y, lpszString, nCount, nTabPositions, lpnTabStopPositions, nTabOrigin);\r
-               SIZE size = { GET_X_LPARAM(lRes), GET_Y_LPARAM(lRes) };\r
-               return size;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int DrawText(LPCTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-#ifndef _WIN32_WCE\r
-               ATLASSERT((uFormat & DT_MODIFYSTRING) == 0);\r
-#endif // !_WIN32_WCE\r
-               return ::DrawText(m_hDC, lpstrText, cchText, lpRect, uFormat);\r
-       }\r
-\r
-       int DrawText(LPTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawText(m_hDC, lpstrText, cchText, lpRect, uFormat);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int DrawTextEx(LPTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat, LPDRAWTEXTPARAMS lpDTParams = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawTextEx(m_hDC, lpstrText, cchText, lpRect, uFormat, lpDTParams);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if (_WIN32_WINNT >= 0x0501)\r
-       int DrawShadowText(LPCWSTR lpstrText, int cchText, LPRECT lpRect, DWORD dwFlags, COLORREF clrText, COLORREF clrShadow, int xOffset, int yOffset)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               // This function is present only if comctl32.dll version 6 is loaded;\r
-               // we use LoadLibrary/GetProcAddress to allow apps compiled with\r
-               // _WIN32_WINNT >= 0x0501 to run on older Windows/CommCtrl\r
-               int nRet = 0;\r
-               HMODULE hCommCtrlDLL = ::LoadLibrary(_T("comctl32.dll"));\r
-               ATLASSERT(hCommCtrlDLL != NULL);\r
-               if(hCommCtrlDLL != NULL)\r
-               {\r
-                       typedef int (WINAPI *PFN_DrawShadowText)(HDC hDC, LPCWSTR lpstrText, UINT cchText, LPRECT lpRect, DWORD dwFlags, COLORREF clrText, COLORREF clrShadow, int xOffset, int yOffset);\r
-                       PFN_DrawShadowText pfnDrawShadowText = (PFN_DrawShadowText)::GetProcAddress(hCommCtrlDLL, "DrawShadowText");\r
-                       ATLASSERT(pfnDrawShadowText != NULL);   // this function requires CommCtrl6\r
-                       if(pfnDrawShadowText != NULL)\r
-                               nRet = pfnDrawShadowText(m_hDC, lpstrText, cchText, lpRect, dwFlags, clrText, clrShadow, xOffset, yOffset);\r
-                       ::FreeLibrary(hCommCtrlDLL);\r
-               }\r
-               return nRet;\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0501)\r
-\r
-       BOOL GetTextExtent(LPCTSTR lpszString, int nCount, LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(nCount == -1)\r
-                       nCount = lstrlen(lpszString);\r
-               return ::GetTextExtentPoint32(m_hDC, lpszString, nCount, lpSize);\r
-       }\r
-\r
-       BOOL GetTextExtentExPoint(LPCTSTR lpszString, int cchString, LPSIZE lpSize, int nMaxExtent, LPINT lpnFit = NULL, LPINT alpDx = NULL)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextExtentExPoint(m_hDC, lpszString, cchString, nMaxExtent, lpnFit, alpDx, lpSize);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       DWORD GetTabbedTextExtent(LPCTSTR lpszString, int nCount = -1, int nTabPositions = 0, LPINT lpnTabStopPositions = NULL) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(nCount == -1)\r
-                       nCount = lstrlen(lpszString);\r
-               return ::GetTabbedTextExtent(m_hDC, lpszString, nCount, nTabPositions, lpnTabStopPositions);\r
-       }\r
-\r
-       BOOL GrayString(HBRUSH hBrush, BOOL (CALLBACK* lpfnOutput)(HDC, LPARAM, int), LPARAM lpData, int nCount, int x, int y, int nWidth, int nHeight)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GrayString(m_hDC, hBrush, (GRAYSTRINGPROC)lpfnOutput, lpData, nCount, x, y, nWidth, nHeight);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-       UINT GetTextAlign() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextAlign(m_hDC);\r
-       }\r
-\r
-       UINT SetTextAlign(UINT nFlags)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetTextAlign(m_hDC, nFlags);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-\r
-       int GetTextFace(LPTSTR lpszFacename, int nCount) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextFace(m_hDC, nCount, lpszFacename);\r
-       }\r
-\r
-       int GetTextFaceLen() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextFace(m_hDC, 0, NULL);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-#ifdef _OLEAUTO_H_\r
-       BOOL GetTextFace(BSTR& bstrFace) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(m_hDC != NULL);\r
-               ATLASSERT(bstrFace == NULL);\r
-\r
-               int nLen = GetTextFaceLen();\r
-               if(nLen == 0)\r
-                       return FALSE;\r
-\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpszText = buff.Allocate(nLen);\r
-               if(lpszText == NULL)\r
-                       return FALSE;\r
-\r
-               if(!GetTextFace(lpszText, nLen))\r
-                       return FALSE;\r
-\r
-               bstrFace = ::SysAllocString(T2OLE(lpszText));\r
-               return (bstrFace != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif\r
-#endif // !_ATL_NO_COM\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetTextFace(_CSTRING_NS::CString& strFace) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-\r
-               int nLen = GetTextFaceLen();\r
-               if(nLen == 0)\r
-                       return 0;\r
-\r
-               LPTSTR lpstr = strFace.GetBufferSetLength(nLen);\r
-               if(lpstr == NULL)\r
-                       return 0;\r
-               int nRet = GetTextFace(lpstr, nLen);\r
-               strFace.ReleaseBuffer();\r
-               return nRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       BOOL GetTextMetrics(LPTEXTMETRIC lpMetrics) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextMetrics(m_hDC, lpMetrics);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int SetTextJustification(int nBreakExtra, int nBreakCount)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetTextJustification(m_hDC, nBreakExtra, nBreakCount);\r
-       }\r
-\r
-       int GetTextCharacterExtra() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextCharacterExtra(m_hDC);\r
-       }\r
-\r
-       int SetTextCharacterExtra(int nCharExtra)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetTextCharacterExtra(m_hDC, nCharExtra);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Advanced Drawing\r
-       BOOL DrawEdge(LPRECT lpRect, UINT nEdge, UINT nFlags)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawEdge(m_hDC, lpRect, nEdge, nFlags);\r
-       }\r
-\r
-       BOOL DrawFrameControl(LPRECT lpRect, UINT nType, UINT nState)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawFrameControl(m_hDC, lpRect, nType, nState);\r
-       }\r
-\r
-// Scrolling Functions\r
-       BOOL ScrollDC(int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ScrollDC(m_hDC, dx, dy, lpRectScroll, lpRectClip, hRgnUpdate, lpRectUpdate);\r
-       }\r
-\r
-// Font Functions\r
-#ifndef _WIN32_WCE\r
-       BOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharWidth(m_hDC, nFirstChar, nLastChar, lpBuffer);\r
-       }\r
-\r
-       // GetCharWidth32 is not supported under Win9x\r
-       BOOL GetCharWidth32(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharWidth32(m_hDC, nFirstChar, nLastChar, lpBuffer);\r
-       }\r
-\r
-       DWORD SetMapperFlags(DWORD dwFlag)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetMapperFlags(m_hDC, dwFlag);\r
-       }\r
-\r
-       BOOL GetAspectRatioFilter(LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetAspectRatioFilterEx(m_hDC, lpSize);\r
-       }\r
-\r
-       BOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABC lpabc) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharABCWidths(m_hDC, nFirstChar, nLastChar, lpabc);\r
-       }\r
-\r
-       DWORD GetFontData(DWORD dwTable, DWORD dwOffset, LPVOID lpData, DWORD cbData) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetFontData(m_hDC, dwTable, dwOffset, lpData, cbData);\r
-       }\r
-\r
-       int GetKerningPairs(int nPairs, LPKERNINGPAIR lpkrnpair) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetKerningPairs(m_hDC, nPairs, lpkrnpair);\r
-       }\r
-\r
-       UINT GetOutlineTextMetrics(UINT cbData, LPOUTLINETEXTMETRIC lpotm) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetOutlineTextMetrics(m_hDC, cbData, lpotm);\r
-       }\r
-\r
-       DWORD GetGlyphOutline(UINT nChar, UINT nFormat, LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPVOID lpBuffer, const MAT2* lpmat2) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetGlyphOutline(m_hDC, nChar, nFormat, lpgm, cbBuffer, lpBuffer, lpmat2);\r
-       }\r
-\r
-       BOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABCFLOAT lpABCF) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharABCWidthsFloat(m_hDC, nFirstChar, nLastChar, lpABCF);\r
-       }\r
-\r
-       BOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, float* lpFloatBuffer) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharWidthFloat(m_hDC, nFirstChar, nLastChar, lpFloatBuffer);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Printer/Device Escape Functions\r
-#ifndef _WIN32_WCE\r
-       int Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::Escape(m_hDC, nEscape, nCount, lpszInData, lpOutData);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       int Escape(int nEscape, int nInputSize, LPCSTR lpszInputData,\r
-               int nOutputSize, LPSTR lpszOutputData)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ExtEscape(m_hDC, nEscape, nInputSize, lpszInputData, nOutputSize, lpszOutputData);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       int DrawEscape(int nEscape, int nInputSize, LPCSTR lpszInputData)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DrawEscape(m_hDC, nEscape, nInputSize, lpszInputData);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // Escape helpers\r
-#if !defined(_WIN32_WCE) || ((_WIN32_WCE >= 200) && defined(StartDoc))\r
-       int StartDoc(LPCTSTR lpszDocName)  // old Win3.0 version\r
-       {\r
-               DOCINFO di = { 0 };\r
-               di.cbSize = sizeof(DOCINFO);\r
-               di.lpszDocName = lpszDocName;\r
-               return StartDoc(&di);\r
-       }\r
-\r
-       int StartDoc(LPDOCINFO lpDocInfo)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::StartDoc(m_hDC, lpDocInfo);\r
-       }\r
-\r
-       int StartPage()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::StartPage(m_hDC);\r
-       }\r
-\r
-       int EndPage()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::EndPage(m_hDC);\r
-       }\r
-\r
-       int SetAbortProc(BOOL (CALLBACK* lpfn)(HDC, int))\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetAbortProc(m_hDC, (ABORTPROC)lpfn);\r
-       }\r
-\r
-       int AbortDoc()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::AbortDoc(m_hDC);\r
-       }\r
-\r
-       int EndDoc()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::EndDoc(m_hDC);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || ((_WIN32_WCE >= 200) && defined(StartDoc))\r
-\r
-// MetaFile Functions\r
-#ifndef _WIN32_WCE\r
-       BOOL PlayMetaFile(HMETAFILE hMF)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               if(::GetDeviceCaps(m_hDC, TECHNOLOGY) == DT_METAFILE)\r
-               {\r
-                       // playing metafile in metafile, just use core windows API\r
-                       return ::PlayMetaFile(m_hDC, hMF);\r
-               }\r
-\r
-               // for special playback, lParam == pDC\r
-               return ::EnumMetaFile(m_hDC, hMF, EnumMetaFileProc, (LPARAM)this);\r
-       }\r
-\r
-       BOOL PlayMetaFile(HENHMETAFILE hEnhMetaFile, LPCRECT lpBounds)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::PlayEnhMetaFile(m_hDC, hEnhMetaFile, lpBounds);\r
-       }\r
-\r
-       BOOL AddMetaFileComment(UINT nDataSize, const BYTE* pCommentData) // can be used for enhanced metafiles only\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GdiComment(m_hDC, nDataSize, pCommentData);\r
-       }\r
-\r
-       // Special handling for metafile playback\r
-       static int CALLBACK EnumMetaFileProc(HDC hDC, HANDLETABLE* pHandleTable, METARECORD* pMetaRec, int nHandles, LPARAM lParam)\r
-       {\r
-               CDCHandle* pDC = (CDCHandle*)lParam;\r
-\r
-               switch (pMetaRec->rdFunction)\r
-               {\r
-               case META_SETMAPMODE:\r
-                       pDC->SetMapMode((int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SETWINDOWEXT:\r
-                       pDC->SetWindowExt((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SETWINDOWORG:\r
-                       pDC->SetWindowOrg((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SETVIEWPORTEXT:\r
-                       pDC->SetViewportExt((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SETVIEWPORTORG:\r
-                       pDC->SetViewportOrg((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SCALEWINDOWEXT:\r
-                       pDC->ScaleWindowExt((int)(short)pMetaRec->rdParm[3], (int)(short)pMetaRec->rdParm[2], \r
-                               (int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SCALEVIEWPORTEXT:\r
-                       pDC->ScaleViewportExt((int)(short)pMetaRec->rdParm[3], (int)(short)pMetaRec->rdParm[2],\r
-                               (int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_OFFSETVIEWPORTORG:\r
-                       pDC->OffsetViewportOrg((int)(short)pMetaRec->rdParm[1], (int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SAVEDC:\r
-                       pDC->SaveDC();\r
-                       break;\r
-               case META_RESTOREDC:\r
-                       pDC->RestoreDC((int)(short)pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SETBKCOLOR:\r
-                       pDC->SetBkColor(*(UNALIGNED COLORREF*)&pMetaRec->rdParm[0]);\r
-                       break;\r
-               case META_SETTEXTCOLOR:\r
-                       pDC->SetTextColor(*(UNALIGNED COLORREF*)&pMetaRec->rdParm[0]);\r
-                       break;\r
-\r
-               // need to watch out for SelectObject(HFONT), for custom font mapping\r
-               case META_SELECTOBJECT:\r
-                       {\r
-                               HGDIOBJ hObject = pHandleTable->objectHandle[pMetaRec->rdParm[0]];\r
-                               UINT nObjType = ::GetObjectType(hObject);\r
-                               if(nObjType == 0)\r
-                               {\r
-                                       // object type is unknown, determine if it is a font\r
-                                       HFONT hStockFont = (HFONT)::GetStockObject(SYSTEM_FONT);\r
-                                       HFONT hFontOld = (HFONT)::SelectObject(pDC->m_hDC, hStockFont);\r
-                                       HGDIOBJ hObjOld = ::SelectObject(pDC->m_hDC, hObject);\r
-                                       if(hObjOld == hStockFont)\r
-                                       {\r
-                                               // got the stock object back, so must be selecting a font\r
-                                               pDC->SelectFont((HFONT)hObject);\r
-                                               break;  // don't play the default record\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               // didn't get the stock object back, so restore everything\r
-                                               ::SelectObject(pDC->m_hDC, hFontOld);\r
-                                               ::SelectObject(pDC->m_hDC, hObjOld);\r
-                                       }\r
-                                       // and fall through to PlayMetaFileRecord...\r
-                               }\r
-                               else if(nObjType == OBJ_FONT)\r
-                               {\r
-                                       // play back as CDCHandle::SelectFont(HFONT)\r
-                                       pDC->SelectFont((HFONT)hObject);\r
-                                       break;  // don't play the default record\r
-                               }\r
-                       }\r
-                       // fall through...\r
-\r
-               default:\r
-                       ::PlayMetaFileRecord(hDC, pHandleTable, pMetaRec, nHandles);\r
-                       break;\r
-               }\r
-\r
-               return 1;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Path Functions\r
-#ifndef _WIN32_WCE\r
-       BOOL AbortPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::AbortPath(m_hDC);\r
-       }\r
-\r
-       BOOL BeginPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::BeginPath(m_hDC);\r
-       }\r
-\r
-       BOOL CloseFigure()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::CloseFigure(m_hDC);\r
-       }\r
-\r
-       BOOL EndPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::EndPath(m_hDC);\r
-       }\r
-\r
-       BOOL FillPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FillPath(m_hDC);\r
-       }\r
-\r
-       BOOL FlattenPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::FlattenPath(m_hDC);\r
-       }\r
-\r
-       BOOL StrokeAndFillPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::StrokeAndFillPath(m_hDC);\r
-       }\r
-\r
-       BOOL StrokePath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::StrokePath(m_hDC);\r
-       }\r
-\r
-       BOOL WidenPath()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::WidenPath(m_hDC);\r
-       }\r
-\r
-       BOOL GetMiterLimit(PFLOAT pfMiterLimit) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetMiterLimit(m_hDC, pfMiterLimit);\r
-       }\r
-\r
-       BOOL SetMiterLimit(float fMiterLimit)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetMiterLimit(m_hDC, fMiterLimit, NULL);\r
-       }\r
-\r
-       int GetPath(LPPOINT lpPoints, LPBYTE lpTypes, int nCount) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetPath(m_hDC, lpPoints, lpTypes, nCount);\r
-       }\r
-\r
-       BOOL SelectClipPath(int nMode)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SelectClipPath(m_hDC, nMode);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Misc Helper Functions\r
-       static CBrushHandle PASCAL GetHalftoneBrush()\r
-       {\r
-               HBRUSH halftoneBrush = NULL;\r
-               WORD grayPattern[8];\r
-               for(int i = 0; i < 8; i++)\r
-                       grayPattern[i] = (WORD)(0x5555 << (i & 1));\r
-               HBITMAP grayBitmap = CreateBitmap(8, 8, 1, 1, &grayPattern);\r
-               if(grayBitmap != NULL)\r
-               {\r
-                       halftoneBrush = ::CreatePatternBrush(grayBitmap);\r
-                       DeleteObject(grayBitmap);\r
-               }\r
-               return CBrushHandle(halftoneBrush);\r
-       }\r
-\r
-       void DrawDragRect(LPCRECT lpRect, SIZE size, LPCRECT lpRectLast, SIZE sizeLast, HBRUSH hBrush = NULL, HBRUSH hBrushLast = NULL)\r
-       {\r
-               // first, determine the update region and select it\r
-               CRgn rgnOutside;\r
-               rgnOutside.CreateRectRgnIndirect(lpRect);\r
-               RECT rect = *lpRect;\r
-               ::InflateRect(&rect, -size.cx, -size.cy);\r
-               ::IntersectRect(&rect, &rect, lpRect);\r
-               CRgn rgnInside;\r
-               rgnInside.CreateRectRgnIndirect(&rect);\r
-               CRgn rgnNew;\r
-               rgnNew.CreateRectRgn(0, 0, 0, 0);\r
-               rgnNew.CombineRgn(rgnOutside, rgnInside, RGN_XOR);\r
-\r
-               HBRUSH hBrushOld = NULL;\r
-               CBrush brushHalftone;\r
-               if(hBrush == NULL)\r
-                       brushHalftone = hBrush = CDCHandle::GetHalftoneBrush();\r
-               if(hBrushLast == NULL)\r
-                       hBrushLast = hBrush;\r
-\r
-               CRgn rgnLast;\r
-               CRgn rgnUpdate;\r
-               if(lpRectLast != NULL)\r
-               {\r
-                       // find difference between new region and old region\r
-                       rgnLast.CreateRectRgn(0, 0, 0, 0);\r
-                       rgnOutside.SetRectRgn(lpRectLast->left, lpRectLast->top, lpRectLast->right, lpRectLast->bottom);\r
-                       rect = *lpRectLast;\r
-                       ::InflateRect(&rect, -sizeLast.cx, -sizeLast.cy);\r
-                       ::IntersectRect(&rect, &rect, lpRectLast);\r
-                       rgnInside.SetRectRgn(rect.left, rect.top, rect.right, rect.bottom);\r
-                       rgnLast.CombineRgn(rgnOutside, rgnInside, RGN_XOR);\r
-\r
-                       // only diff them if brushes are the same\r
-                       if(hBrush == hBrushLast)\r
-                       {\r
-                               rgnUpdate.CreateRectRgn(0, 0, 0, 0);\r
-                               rgnUpdate.CombineRgn(rgnLast, rgnNew, RGN_XOR);\r
-                       }\r
-               }\r
-               if(hBrush != hBrushLast && lpRectLast != NULL)\r
-               {\r
-                       // brushes are different -- erase old region first\r
-                       SelectClipRgn(rgnLast);\r
-                       GetClipBox(&rect);\r
-                       hBrushOld = SelectBrush(hBrushLast);\r
-                       PatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);\r
-                       SelectBrush(hBrushOld);\r
-                       hBrushOld = NULL;\r
-               }\r
-\r
-               // draw into the update/new region\r
-               SelectClipRgn(rgnUpdate.IsNull() ? rgnNew : rgnUpdate);\r
-               GetClipBox(&rect);\r
-               hBrushOld = SelectBrush(hBrush);\r
-               PatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);\r
-\r
-               // cleanup DC\r
-               if(hBrushOld != NULL)\r
-                       SelectBrush(hBrushOld);\r
-               SelectClipRgn(NULL);\r
-       }\r
-\r
-       void FillSolidRect(LPCRECT lpRect, COLORREF clr)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-\r
-               COLORREF clrOld = ::SetBkColor(m_hDC, clr);\r
-               ATLASSERT(clrOld != CLR_INVALID);\r
-               if(clrOld != CLR_INVALID)\r
-               {\r
-                       ::ExtTextOut(m_hDC, 0, 0, ETO_OPAQUE, lpRect, NULL, 0, NULL);\r
-                       ::SetBkColor(m_hDC, clrOld);\r
-               }\r
-       }\r
-\r
-       void FillSolidRect(int x, int y, int cx, int cy, COLORREF clr)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-\r
-               RECT rect = { x, y, x + cx, y + cy };\r
-               FillSolidRect(&rect, clr);\r
-       }\r
-\r
-       void Draw3dRect(LPCRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight)\r
-       {\r
-               Draw3dRect(lpRect->left, lpRect->top, lpRect->right - lpRect->left,\r
-                       lpRect->bottom - lpRect->top, clrTopLeft, clrBottomRight);\r
-       }\r
-\r
-       void Draw3dRect(int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)\r
-       {\r
-               FillSolidRect(x, y, cx - 1, 1, clrTopLeft);\r
-               FillSolidRect(x, y, 1, cy - 1, clrTopLeft);\r
-               FillSolidRect(x + cx, y, -1, cy, clrBottomRight);\r
-               FillSolidRect(x, y + cy, cx, -1, clrBottomRight);\r
-       }\r
-\r
-// DIB support\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 410)\r
-       int 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)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetDIBitsToDevice(m_hDC, x, y, dwWidth, dwHeight, xSrc, ySrc, uStartScan, cScanLines, lpvBits, lpbmi, uColorUse);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 410)\r
-\r
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-       int 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)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::StretchDIBits(m_hDC, x, y, nWidth, nHeight, xSrc, ySrc, nSrcWidth, nSrcHeight, lpvBits, lpbmi, uColorUse, dwRop);\r
-       }\r
-\r
-       UINT GetDIBColorTable(UINT uStartIndex, UINT cEntries, RGBQUAD* pColors) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetDIBColorTable(m_hDC, uStartIndex, cEntries, pColors);\r
-       }\r
-\r
-       UINT SetDIBColorTable(UINT uStartIndex, UINT cEntries, CONST RGBQUAD* pColors)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetDIBColorTable(m_hDC, uStartIndex, cEntries, pColors);\r
-       }\r
-#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)\r
-\r
-// OpenGL support\r
-#if !defined(_ATL_NO_OPENGL) && !defined(_WIN32_WCE)\r
-       int ChoosePixelFormat(CONST PIXELFORMATDESCRIPTOR* ppfd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ChoosePixelFormat(m_hDC, ppfd);\r
-       }\r
-\r
-       int DescribePixelFormat(int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::DescribePixelFormat(m_hDC, iPixelFormat, nBytes, ppfd);\r
-       }\r
-\r
-       int GetPixelFormat() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetPixelFormat(m_hDC);\r
-       }\r
-\r
-       BOOL SetPixelFormat(int iPixelFormat, CONST PIXELFORMATDESCRIPTOR* ppfd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetPixelFormat(m_hDC, iPixelFormat, ppfd);\r
-       }\r
-\r
-       BOOL SwapBuffers()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SwapBuffers(m_hDC);\r
-       }\r
-\r
-       HGLRC wglCreateContext()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglCreateContext(m_hDC);\r
-       }\r
-\r
-       HGLRC wglCreateLayerContext(int iLayerPlane)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglCreateLayerContext(m_hDC, iLayerPlane);\r
-       }\r
-\r
-       BOOL wglMakeCurrent(HGLRC hglrc)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglMakeCurrent(m_hDC, hglrc);\r
-       }\r
-\r
-       BOOL wglUseFontBitmaps(DWORD dwFirst, DWORD dwCount, DWORD listBase)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglUseFontBitmaps(m_hDC, dwFirst, dwCount, listBase);\r
-       }\r
-\r
-       BOOL wglUseFontOutlines(DWORD dwFirst, DWORD dwCount, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglUseFontOutlines(m_hDC, dwFirst, dwCount, listBase, deviation, extrusion, format, lpgmf);\r
-       }\r
-\r
-       BOOL wglDescribeLayerPlane(int iPixelFormat, int iLayerPlane, UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglDescribeLayerPlane(m_hDC, iPixelFormat, iLayerPlane, nBytes, plpd);\r
-       }\r
-\r
-       int wglSetLayerPaletteEntries(int iLayerPlane, int iStart, int cEntries, CONST COLORREF* pclr)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglSetLayerPaletteEntries(m_hDC, iLayerPlane, iStart, cEntries, pclr);\r
-       }\r
-\r
-       int wglGetLayerPaletteEntries(int iLayerPlane, int iStart, int cEntries, COLORREF* pclr)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglGetLayerPaletteEntries(m_hDC, iLayerPlane, iStart, cEntries, pclr);\r
-       }\r
-\r
-       BOOL wglRealizeLayerPalette(int iLayerPlane, BOOL bRealize)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglRealizeLayerPalette(m_hDC, iLayerPlane, bRealize);\r
-       }\r
-\r
-       BOOL wglSwapLayerBuffers(UINT uPlanes)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::wglSwapLayerBuffers(m_hDC, uPlanes);\r
-       }\r
-#endif // !defined(_ATL_NO_OPENGL) && !defined(_WIN32_WCE)\r
-\r
-// New for Windows 2000 only\r
-#if (_WIN32_WINNT >= 0x0500)\r
-       COLORREF GetDCPenColor() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetDCPenColor(m_hDC);\r
-       }\r
-\r
-       COLORREF SetDCPenColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetDCPenColor(m_hDC, clr);\r
-       }\r
-\r
-       COLORREF GetDCBrushColor() const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetDCBrushColor(m_hDC);\r
-       }\r
-\r
-       COLORREF SetDCBrushColor(COLORREF clr)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::SetDCBrushColor(m_hDC, clr);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       DWORD GetFontUnicodeRanges(LPGLYPHSET lpgs) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetFontUnicodeRanges(m_hDC, lpgs);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       DWORD GetGlyphIndices(LPCTSTR lpstr, int cch, LPWORD pgi, DWORD dwFlags) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetGlyphIndices(m_hDC, lpstr, cch, pgi, dwFlags);\r
-       }\r
-\r
-       BOOL GetTextExtentPointI(LPWORD pgiIn, int cgi, LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextExtentPointI(m_hDC, pgiIn, cgi, lpSize);\r
-       }\r
-\r
-       BOOL GetTextExtentExPointI(LPWORD pgiIn, int cgi, int nMaxExtent, LPINT lpnFit, LPINT alpDx, LPSIZE lpSize) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetTextExtentExPointI(m_hDC, pgiIn, cgi, nMaxExtent, lpnFit, alpDx, lpSize);\r
-       }\r
-\r
-       BOOL GetCharWidthI(UINT giFirst, UINT cgi, LPWORD pgi, LPINT lpBuffer) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharWidthI(m_hDC, giFirst, cgi, pgi, lpBuffer);\r
-       }\r
-\r
-       BOOL GetCharABCWidthsI(UINT giFirst, UINT cgi, LPWORD pgi, LPABC lpabc) const\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::GetCharABCWidthsI(m_hDC, giFirst, cgi, pgi, lpabc);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0500)\r
-\r
-// New for Windows 2000 and Windows 98\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-       BOOL ColorCorrectPalette(HPALETTE hPalette, DWORD dwFirstEntry, DWORD dwNumOfEntries)\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               return ::ColorCorrectPalette(m_hDC, hPalette, dwFirstEntry, dwNumOfEntries);\r
-       }\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-};\r
-\r
-typedef CDCT<false>   CDCHandle;\r
-typedef CDCT<true>    CDC;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDC Helpers\r
-\r
-class CPaintDC : public CDC\r
-{\r
-public:\r
-// Data members\r
-       HWND m_hWnd;\r
-       PAINTSTRUCT m_ps;\r
-\r
-// Constructor/destructor\r
-       CPaintDC(HWND hWnd)\r
-       {\r
-               ATLASSERT(::IsWindow(hWnd));\r
-               m_hWnd = hWnd;\r
-               m_hDC = ::BeginPaint(hWnd, &m_ps);\r
-       }\r
-\r
-       ~CPaintDC()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::EndPaint(m_hWnd, &m_ps);\r
-               Detach();\r
-       }\r
-};\r
-\r
-class CClientDC : public CDC\r
-{\r
-public:\r
-// Data members\r
-       HWND m_hWnd;\r
-\r
-// Constructor/destructor\r
-       CClientDC(HWND hWnd)\r
-       {\r
-               ATLASSERT(hWnd == NULL || ::IsWindow(hWnd));\r
-               m_hWnd = hWnd;\r
-               m_hDC = ::GetDC(hWnd);\r
-       }\r
-\r
-       ~CClientDC()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ::ReleaseDC(m_hWnd, Detach());\r
-       }\r
-};\r
-\r
-class CWindowDC : public CDC\r
-{\r
-public:\r
-// Data members\r
-       HWND m_hWnd;\r
-\r
-// Constructor/destructor\r
-       CWindowDC(HWND hWnd)\r
-       {\r
-               ATLASSERT(hWnd == NULL || ::IsWindow(hWnd));\r
-               m_hWnd = hWnd;\r
-               m_hDC = ::GetWindowDC(hWnd);\r
-       }\r
-\r
-       ~CWindowDC()\r
-       {\r
-               ATLASSERT(m_hDC != NULL);\r
-               ::ReleaseDC(m_hWnd, Detach());\r
-       }\r
-};\r
-\r
-class CMemoryDC : public CDC\r
-{\r
-public:\r
-// Data members\r
-       HDC m_hDCOriginal;\r
-       RECT m_rcPaint;\r
-       CBitmap m_bmp;\r
-       HBITMAP m_hBmpOld;\r
-\r
-// Constructor/destructor\r
-       CMemoryDC(HDC hDC, RECT& rcPaint) : m_hDCOriginal(hDC), m_hBmpOld(NULL)\r
-       {\r
-               m_rcPaint = rcPaint;\r
-               CreateCompatibleDC(m_hDCOriginal);\r
-               ATLASSERT(m_hDC != NULL);\r
-               m_bmp.CreateCompatibleBitmap(m_hDCOriginal, m_rcPaint.right - m_rcPaint.left, m_rcPaint.bottom - m_rcPaint.top);\r
-               ATLASSERT(m_bmp.m_hBitmap != NULL);\r
-               m_hBmpOld = SelectBitmap(m_bmp);\r
-               SetViewportOrg(-m_rcPaint.left, -m_rcPaint.top);\r
-       }\r
-\r
-       ~CMemoryDC()\r
-       {\r
-               ::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);\r
-               SelectBitmap(m_hBmpOld);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Enhanced metafile support\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-class CEnhMetaFileInfo\r
-{\r
-public:\r
-// Data members\r
-       HENHMETAFILE m_hEMF;\r
-       BYTE* m_pBits;\r
-       TCHAR* m_pDesc;\r
-       ENHMETAHEADER m_header;\r
-       PIXELFORMATDESCRIPTOR m_pfd;\r
-\r
-// Constructor/destructor\r
-       CEnhMetaFileInfo(HENHMETAFILE hEMF) : m_pBits(NULL), m_pDesc(NULL), m_hEMF(hEMF)\r
-       { }\r
-\r
-       ~CEnhMetaFileInfo()\r
-       {\r
-               delete [] m_pBits;\r
-               delete [] m_pDesc;\r
-       }\r
-\r
-// Operations\r
-       BYTE* GetEnhMetaFileBits()\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               UINT nBytes = ::GetEnhMetaFileBits(m_hEMF, 0, NULL);\r
-               delete [] m_pBits;\r
-               m_pBits = NULL;\r
-               ATLTRY(m_pBits = new BYTE[nBytes]);\r
-               if (m_pBits != NULL)\r
-                       ::GetEnhMetaFileBits(m_hEMF, nBytes, m_pBits);\r
-               return m_pBits;\r
-       }\r
-\r
-       LPTSTR GetEnhMetaFileDescription()\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               UINT nLen = ::GetEnhMetaFileDescription(m_hEMF, 0, NULL);\r
-               delete [] m_pDesc;\r
-               m_pDesc = NULL;\r
-               ATLTRY(m_pDesc = new TCHAR[nLen]);\r
-               if (m_pDesc != NULL)\r
-                       nLen = ::GetEnhMetaFileDescription(m_hEMF, nLen, m_pDesc);\r
-               return m_pDesc;\r
-       }\r
-\r
-       ENHMETAHEADER* GetEnhMetaFileHeader()\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               memset(&m_header, 0, sizeof(m_header));\r
-               m_header.iType = EMR_HEADER;\r
-               m_header.nSize = sizeof(ENHMETAHEADER);\r
-               UINT n = ::GetEnhMetaFileHeader(m_hEMF, sizeof(ENHMETAHEADER), &m_header);\r
-               return (n != 0) ? &m_header : NULL;\r
-       }\r
-\r
-       PIXELFORMATDESCRIPTOR* GetEnhMetaFilePixelFormat()\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               memset(&m_pfd, 0, sizeof(m_pfd));\r
-               UINT n = ::GetEnhMetaFilePixelFormat(m_hEMF, sizeof(m_pfd), &m_pfd);\r
-               return (n != 0) ? &m_pfd : NULL;\r
-       }\r
-};\r
-\r
-\r
-template <bool t_bManaged>\r
-class CEnhMetaFileT\r
-{\r
-public:\r
-// Data members\r
-       HENHMETAFILE m_hEMF;\r
-\r
-// Constructor/destructor\r
-       CEnhMetaFileT(HENHMETAFILE hEMF = NULL) : m_hEMF(hEMF)\r
-       {\r
-       }\r
-\r
-       ~CEnhMetaFileT()\r
-       {\r
-               if(t_bManaged && m_hEMF != NULL)\r
-                       DeleteObject();\r
-       }\r
-\r
-// Operations\r
-       CEnhMetaFileT<t_bManaged>& operator =(HENHMETAFILE hEMF)\r
-       {\r
-               Attach(hEMF);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HENHMETAFILE hEMF)\r
-       {\r
-               if(t_bManaged && m_hEMF != NULL && m_hEMF != hEMF)\r
-                       DeleteObject();\r
-               m_hEMF = hEMF;\r
-       }\r
-\r
-       HENHMETAFILE Detach()\r
-       {\r
-               HENHMETAFILE hEMF = m_hEMF;\r
-               m_hEMF = NULL;\r
-               return hEMF;\r
-       }\r
-\r
-       operator HENHMETAFILE() const { return m_hEMF; }\r
-\r
-       bool IsNull() const { return (m_hEMF == NULL); }\r
-\r
-       BOOL DeleteObject()\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               BOOL bRet = ::DeleteEnhMetaFile(m_hEMF);\r
-               m_hEMF = NULL;\r
-               return bRet;\r
-       }\r
-\r
-       UINT GetEnhMetaFileBits(UINT cbBuffer, LPBYTE lpbBuffer) const\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               return ::GetEnhMetaFileBits(m_hEMF, cbBuffer, lpbBuffer);\r
-       }\r
-\r
-       UINT GetEnhMetaFileDescription(UINT cchBuffer, LPTSTR lpszDescription) const\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               return ::GetEnhMetaFileDescription(m_hEMF, cchBuffer, lpszDescription);\r
-       }\r
-\r
-       UINT GetEnhMetaFileHeader(LPENHMETAHEADER lpemh) const\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               lpemh->iType = EMR_HEADER;\r
-               lpemh->nSize = sizeof(ENHMETAHEADER);\r
-               return ::GetEnhMetaFileHeader(m_hEMF, sizeof(ENHMETAHEADER), lpemh);\r
-       }\r
-\r
-       UINT GetEnhMetaFilePaletteEntries(UINT cEntries, LPPALETTEENTRY lppe) const\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               return ::GetEnhMetaFilePaletteEntries(m_hEMF, cEntries, lppe);\r
-       }\r
-\r
-       UINT GetEnhMetaFilePixelFormat(DWORD cbBuffer, PIXELFORMATDESCRIPTOR* ppfd) const\r
-       {\r
-               ATLASSERT(m_hEMF != NULL);\r
-               return ::GetEnhMetaFilePixelFormat(m_hEMF, cbBuffer, ppfd);\r
-       }\r
-};\r
-\r
-typedef CEnhMetaFileT<false>   CEnhMetaFileHandle;\r
-typedef CEnhMetaFileT<true>    CEnhMetaFile;\r
-\r
-\r
-class CEnhMetaFileDC : public CDC\r
-{\r
-public:\r
-// Constructor/destructor\r
-       CEnhMetaFileDC()\r
-       {\r
-       }\r
-\r
-       CEnhMetaFileDC(HDC hdc, LPCRECT lpRect)\r
-       {\r
-               Create(hdc, NULL, lpRect, NULL);\r
-               ATLASSERT(m_hDC != NULL);\r
-       }\r
-\r
-       CEnhMetaFileDC(HDC hdcRef, LPCTSTR lpFilename, LPCRECT lpRect, LPCTSTR lpDescription)\r
-       {\r
-               Create(hdcRef, lpFilename, lpRect, lpDescription);\r
-               ATLASSERT(m_hDC != NULL);\r
-       }\r
-\r
-       ~CEnhMetaFileDC()\r
-       {\r
-               HENHMETAFILE hEMF = Close();\r
-               if (hEMF != NULL)\r
-                       ::DeleteEnhMetaFile(hEMF);\r
-       }\r
-\r
-// Operations\r
-       void Create(HDC hdcRef, LPCTSTR lpFilename, LPCRECT lpRect, LPCTSTR lpDescription)\r
-       {\r
-               ATLASSERT(m_hDC == NULL);\r
-               m_hDC = ::CreateEnhMetaFile(hdcRef, lpFilename, lpRect, lpDescription);\r
-       }\r
-\r
-       HENHMETAFILE Close()\r
-       {\r
-               HENHMETAFILE hEMF = NULL;\r
-               if (m_hDC != NULL)\r
-               {\r
-                       hEMF = ::CloseEnhMetaFile(m_hDC);\r
-                       m_hDC = NULL;\r
-               }\r
-               return hEMF;\r
-       }\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// WinCE compatible clipboard CF_DIB format support functions\r
-\r
-#ifndef _WTL_NO_DIB16\r
-\r
-#define DIBINFO16_BITFIELDS { 31744, 992, 31 }\r
-\r
-// DIBINFO16 - To avoid color table problems in WinCE we only create this type of Dib\r
-struct DIBINFO16 // a BITMAPINFO with 2 additional color bitfields\r
-{\r
-    BITMAPINFOHEADER    bmiHeader;\r
-    RGBQUAD             bmiColors[3];\r
-\r
-       DIBINFO16(SIZE size) \r
-       {\r
-               BITMAPINFOHEADER bmih = { sizeof(BITMAPINFOHEADER), size.cx, size.cy, \r
-                                         1, 16, BI_BITFIELDS, 2 * size.cx * size.cy , 0, 0, 3 };\r
-               DWORD dw[3] = DIBINFO16_BITFIELDS ;\r
-\r
-               bmiHeader = bmih;\r
-               memcpy(bmiColors, dw, 3 * sizeof(DWORD));\r
-       }\r
-};\r
-\r
-\r
-// AtlxxxDibxxx minimal packed DIB implementation and helpers to copy and paste CF_DIB\r
\r
-inline bool AtlIsDib16(LPBITMAPINFOHEADER pbmih)\r
-{\r
-       return (pbmih->biBitCount == 16) && (pbmih->biCompression == BI_BITFIELDS);\r
-}\r
-\r
-inline int AtlGetDibColorTableSize(LPBITMAPINFOHEADER pbmih)\r
-{\r
-       switch (pbmih->biBitCount) \r
-       {\r
-               case  2:\r
-               case  4:\r
-               case  8:\r
-                       return pbmih->biClrUsed ? pbmih->biClrUsed : 1 << pbmih->biBitCount;\r
-               case 24:\r
-                       break;\r
-               case 16:\r
-               case 32:\r
-                       return pbmih->biCompression == BI_BITFIELDS ? 3 : 0;\r
-               default:\r
-                       ATLASSERT(FALSE);   // should never come here\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-inline int AtlGetDibNumColors(LPBITMAPINFOHEADER pbmih)\r
-{\r
-       switch (pbmih->biBitCount) \r
-       {\r
-               case  2:\r
-               case  4:\r
-               case  8: \r
-                       if (pbmih->biClrUsed)\r
-                               return pbmih->biClrUsed;\r
-                       else\r
-                               break;\r
-               case 16: \r
-                       if (pbmih->biCompression == BI_BITFIELDS )\r
-                               return 1 << 15;\r
-                       else\r
-                               break;\r
-               case 24:\r
-                       break;\r
-               case 32: \r
-                       if (pbmih->biCompression == BI_BITFIELDS )\r
-                               return 1 << 24;\r
-                       else\r
-                               break;\r
-               default:\r
-                       ATLASSERT(FALSE);\r
-       }\r
-\r
-       return 1 << pbmih->biBitCount;\r
-}\r
-\r
-inline HBITMAP AtlGetDibBitmap(LPBITMAPINFO pbmi)\r
-{\r
-       HBITMAP hbm = NULL;\r
-       CDC dc(NULL);\r
-       void * pBits = NULL;\r
-\r
-       LPBYTE pDibBits = (LPBYTE)pbmi + sizeof(BITMAPINFOHEADER) + AtlGetDibColorTableSize(&pbmi->bmiHeader) * sizeof(RGBQUAD);\r
-       if (hbm = CreateDIBSection(dc, pbmi, DIB_RGB_COLORS, &pBits, NULL, NULL)) \r
-               memcpy(pBits, pDibBits, pbmi->bmiHeader.biSizeImage);\r
-\r
-       return hbm;\r
-}\r
-       \r
-inline HBITMAP AtlCopyBitmap(HBITMAP hbm , SIZE sizeDst, bool bAsBitmap = false)\r
-{\r
-       CDC hdcSrc = CreateCompatibleDC(NULL);\r
-       CDC hdcDst = CreateCompatibleDC(NULL);\r
-\r
-       CBitmapHandle hbmOld = NULL, hbmOld2 = NULL, bmSrc = hbm;\r
-\r
-       CBitmap bmNew = NULL;\r
-\r
-       SIZE sizeSrc = { 0 };\r
-       bmSrc.GetSize(sizeSrc);\r
-\r
-       hbmOld = hdcSrc.SelectBitmap(bmSrc);\r
-\r
-       if (bAsBitmap)\r
-       {\r
-               bmNew.CreateCompatibleBitmap(hdcSrc, sizeDst.cx, sizeDst.cy);\r
-       }\r
-       else\r
-       {\r
-               DIBINFO16 dib16(sizeDst);\r
-               LPVOID pBits = NULL;\r
-               bmNew = CreateDIBSection(hdcDst, (const BITMAPINFO*)&dib16, DIB_RGB_COLORS, &pBits, NULL, NULL);\r
-       }\r
-       \r
-       ATLASSERT(!bmNew.IsNull());\r
-\r
-       hbmOld2 = hdcDst.SelectBitmap(bmNew);\r
-       BOOL bOK = FALSE;\r
-\r
-       if ((sizeDst.cx == sizeSrc.cx) && (sizeDst.cy == sizeSrc.cy))\r
-               bOK = hdcDst.BitBlt(0, 0, sizeDst.cx, sizeDst.cy, hdcSrc, 0, 0, SRCCOPY);\r
-       else\r
-               bOK = hdcDst.StretchBlt(0, 0, sizeDst.cx, sizeDst.cy, hdcSrc, 0, 0, sizeSrc.cx, sizeSrc.cy, SRCCOPY);\r
-\r
-       hdcSrc.SelectBitmap(hbmOld);\r
-       hdcDst.SelectBitmap(hbmOld2);\r
-\r
-       if (bOK == FALSE)\r
-               bmNew.DeleteObject();\r
-\r
-       return bmNew.Detach();\r
-}\r
-\r
-inline HLOCAL AtlCreatePackedDib16(HBITMAP hbm, SIZE size)\r
-{\r
-       DIBSECTION ds = { 0 };\r
-       LPBYTE pDib = NULL;\r
-       bool bCopied = false;\r
-\r
-       bool bOK = GetObject(hbm, sizeof(ds), &ds) == sizeof(ds);\r
-       if ((bOK == FALSE) || (ds.dsBm.bmBits == NULL) || (AtlIsDib16(&ds.dsBmih) == FALSE) || \r
-           (ds.dsBmih.biWidth != size.cx ) || (ds.dsBmih.biHeight != size.cy ))\r
-       {\r
-               if ((hbm = AtlCopyBitmap(hbm, size)) != NULL)\r
-               {\r
-                       bCopied = true;\r
-                       bOK = GetObject(hbm, sizeof(ds), &ds) == sizeof(ds);\r
-               }\r
-               else\r
-               {\r
-                       bOK = FALSE;\r
-               }\r
-       }\r
-\r
-       if((bOK == TRUE) && (AtlIsDib16(&ds.dsBmih) == TRUE) && (ds.dsBm.bmBits != NULL))\r
-       {\r
-               pDib = (LPBYTE)LocalAlloc(LMEM_ZEROINIT, sizeof(DIBINFO16) + ds.dsBmih.biSizeImage);\r
-               if (pDib != NULL)\r
-               {\r
-                       memcpy(pDib , &ds.dsBmih, sizeof(DIBINFO16));\r
-                       memcpy(pDib + sizeof(DIBINFO16), ds.dsBm.bmBits, ds.dsBmih.biSizeImage);\r
-               }\r
-       }\r
-\r
-       if (bCopied == true)\r
-               DeleteObject(hbm);\r
-\r
-       return (HLOCAL)pDib;\r
-}\r
-\r
-inline bool AtlSetClipboardDib16(HBITMAP hbm, SIZE size, HWND hWnd)\r
-{\r
-       ATLASSERT(::IsWindow(hWnd));\r
-       BOOL bOK = OpenClipboard(hWnd);\r
-       if (bOK == TRUE)\r
-       {\r
-               if ((bOK = EmptyClipboard()) == TRUE)\r
-               {\r
-                       HLOCAL hDib = AtlCreatePackedDib16(hbm, size);\r
-                       if (hDib != NULL)\r
-                       {\r
-                               bOK = SetClipboardData(CF_DIB, hDib) != NULL;\r
-                               if (bOK == FALSE)  \r
-                                       LocalFree(hDib);\r
-                       }\r
-                       else\r
-                       {\r
-                               bOK = FALSE;\r
-                       }\r
-               }\r
-               CloseClipboard();\r
-       }\r
-\r
-       return bOK == TRUE;\r
-}\r
-\r
-inline HBITMAP AtlGetClipboardDib(HWND hWnd)\r
-{\r
-       ATLASSERT(::IsWindow(hWnd) == TRUE);\r
-       HBITMAP hbm = NULL;\r
-       if  (OpenClipboard(hWnd) == TRUE)\r
-       {\r
-               LPBITMAPINFO pbmi = (LPBITMAPINFO)GetClipboardData(CF_DIB);\r
-               if (pbmi != NULL)\r
-                       hbm = AtlGetDibBitmap(pbmi);\r
-               CloseClipboard();\r
-       }\r
-\r
-       return hbm;\r
-}\r
-\r
-#endif // _WTL_NO_DIB16\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLGDI_H__\r
diff --git a/WTL80/include/atlmisc.h b/WTL80/include/atlmisc.h
deleted file mode 100644 (file)
index 70c8745..0000000
+++ /dev/null
@@ -1,4021 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLMISC_H__\r
-#define __ATLMISC_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlmisc.h requires atlapp.h to be included first\r
-#endif\r
-\r
-\r
-#ifdef _ATL_TMP_NO_CSTRING\r
-  #define _WTL_NO_CSTRING\r
-#endif\r
-\r
-#if defined(_WTL_USE_CSTRING) && defined(_WTL_NO_CSTRING)\r
-       #error Conflicting options - both _WTL_USE_CSTRING and _WTL_NO_CSTRING are defined\r
-#endif // defined(_WTL_USE_CSTRING) && defined(_WTL_NO_CSTRING)\r
-\r
-#if !defined(_WTL_USE_CSTRING) && !defined(_WTL_NO_CSTRING)\r
-  #define _WTL_USE_CSTRING\r
-#endif // !defined(_WTL_USE_CSTRING) && !defined(_WTL_NO_CSTRING)\r
-\r
-#ifndef _WTL_NO_CSTRING\r
-  #if defined(_ATL_USE_CSTRING_FLOAT) && defined(_ATL_MIN_CRT)\r
-       #error Cannot use CString floating point formatting with _ATL_MIN_CRT defined\r
-  #endif // defined(_ATL_USE_CSTRING_FLOAT) && defined(_ATL_MIN_CRT)\r
-#endif // !_WTL_NO_CSTRING\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CSize\r
-// CPoint\r
-// CRect\r
-// CString\r
-//\r
-// CRecentDocumentListBase<T, t_cchItemLen, t_nFirstID, t_nLastID>\r
-// CRecentDocumentList\r
-// CFindFile\r
-//\r
-// Global functions:\r
-//   AtlLoadAccelerators()\r
-//   AtlLoadMenu()\r
-//   AtlLoadBitmap()\r
-//   AtlLoadSysBitmap()\r
-//   AtlLoadCursor()\r
-//   AtlLoadSysCursor()\r
-//   AtlLoadIcon()\r
-//   AtlLoadSysIcon()\r
-//   AtlLoadBitmapImage()\r
-//   AtlLoadCursorImage()\r
-//   AtlLoadIconImage()\r
-//   AtlLoadSysBitmapImage()\r
-//   AtlLoadSysCursorImage()\r
-//   AtlLoadSysIconImage()\r
-//   AtlLoadString()\r
-//\r
-//   AtlGetStockPen()\r
-//   AtlGetStockBrush()\r
-//   AtlGetStockFont()\r
-//   AtlGetStockPalette()\r
-//\r
-//   AtlCompactPath()\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-#ifndef _WTL_NO_WTYPES\r
-\r
-// forward declarations\r
-class CSize;\r
-class CPoint;\r
-class CRect;\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSize - Wrapper for Windows SIZE structure.\r
-\r
-class CSize : public SIZE\r
-{\r
-public:\r
-// Constructors\r
-       CSize()\r
-       {\r
-               cx = 0;\r
-               cy = 0;\r
-       }\r
-\r
-       CSize(int initCX, int initCY)\r
-       {\r
-               cx = initCX;\r
-               cy = initCY;\r
-       }\r
-\r
-       CSize(SIZE initSize)\r
-       {\r
-               *(SIZE*)this = initSize;\r
-       }\r
-\r
-       CSize(POINT initPt)\r
-       {\r
-               *(POINT*)this = initPt;\r
-       }\r
-\r
-       CSize(DWORD dwSize)\r
-       {\r
-               cx = (short)LOWORD(dwSize);\r
-               cy = (short)HIWORD(dwSize);\r
-       }\r
-\r
-// Operations\r
-       BOOL operator ==(SIZE size) const\r
-       {\r
-               return (cx == size.cx && cy == size.cy);\r
-       }\r
-\r
-       BOOL operator !=(SIZE size) const\r
-       {\r
-               return (cx != size.cx || cy != size.cy);\r
-       }\r
-\r
-       void operator +=(SIZE size)\r
-       {\r
-               cx += size.cx;\r
-               cy += size.cy;\r
-       }\r
-\r
-       void operator -=(SIZE size)\r
-       {\r
-               cx -= size.cx;\r
-               cy -= size.cy;\r
-       }\r
-\r
-       void SetSize(int CX, int CY)\r
-       {\r
-               cx = CX;\r
-               cy = CY;\r
-       }\r
-\r
-// Operators returning CSize values\r
-       CSize operator +(SIZE size) const\r
-       {\r
-               return CSize(cx + size.cx, cy + size.cy);\r
-       }\r
-\r
-       CSize operator -(SIZE size) const\r
-       {\r
-               return CSize(cx - size.cx, cy - size.cy);\r
-       }\r
-\r
-       CSize operator -() const\r
-       {\r
-               return CSize(-cx, -cy);\r
-       }\r
-\r
-// Operators returning CPoint values\r
-       CPoint operator +(POINT point) const;\r
-       CPoint operator -(POINT point) const;\r
-\r
-// Operators returning CRect values\r
-       CRect operator +(const RECT* lpRect) const;\r
-       CRect operator -(const RECT* lpRect) const;\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPoint - Wrapper for Windows POINT structure.\r
-\r
-class CPoint : public POINT\r
-{\r
-public:\r
-// Constructors\r
-       CPoint()\r
-       {\r
-               x = 0;\r
-               y = 0;\r
-       }\r
-\r
-       CPoint(int initX, int initY)\r
-       {\r
-               x = initX;\r
-               y = initY;\r
-       }\r
-\r
-       CPoint(POINT initPt)\r
-       {\r
-               *(POINT*)this = initPt;\r
-       }\r
-\r
-       CPoint(SIZE initSize)\r
-       {\r
-               *(SIZE*)this = initSize;\r
-       }\r
-\r
-       CPoint(DWORD dwPoint)\r
-       {\r
-               x = (short)LOWORD(dwPoint);\r
-               y = (short)HIWORD(dwPoint);\r
-       }\r
-\r
-// Operations\r
-       void Offset(int xOffset, int yOffset)\r
-       {\r
-               x += xOffset;\r
-               y += yOffset;\r
-       }\r
-\r
-       void Offset(POINT point)\r
-       {\r
-               x += point.x;\r
-               y += point.y;\r
-       }\r
-\r
-       void Offset(SIZE size)\r
-       {\r
-               x += size.cx;\r
-               y += size.cy;\r
-       }\r
-\r
-       BOOL operator ==(POINT point) const\r
-       {\r
-               return (x == point.x && y == point.y);\r
-       }\r
-\r
-       BOOL operator !=(POINT point) const\r
-       {\r
-               return (x != point.x || y != point.y);\r
-       }\r
-\r
-       void operator +=(SIZE size)\r
-       {\r
-               x += size.cx;\r
-               y += size.cy;\r
-       }\r
-\r
-       void operator -=(SIZE size)\r
-       {\r
-               x -= size.cx;\r
-               y -= size.cy;\r
-       }\r
-\r
-       void operator +=(POINT point)\r
-       {\r
-               x += point.x;\r
-               y += point.y;\r
-       }\r
-\r
-       void operator -=(POINT point)\r
-       {\r
-               x -= point.x;\r
-               y -= point.y;\r
-       }\r
-\r
-       void SetPoint(int X, int Y)\r
-       {\r
-               x = X;\r
-               y = Y;\r
-       }\r
-\r
-// Operators returning CPoint values\r
-       CPoint operator +(SIZE size) const\r
-       {\r
-               return CPoint(x + size.cx, y + size.cy);\r
-       }\r
-\r
-       CPoint operator -(SIZE size) const\r
-       {\r
-               return CPoint(x - size.cx, y - size.cy);\r
-       }\r
-\r
-       CPoint operator -() const\r
-       {\r
-               return CPoint(-x, -y);\r
-       }\r
-\r
-       CPoint operator +(POINT point) const\r
-       {\r
-               return CPoint(x + point.x, y + point.y);\r
-       }\r
-\r
-// Operators returning CSize values\r
-       CSize operator -(POINT point) const\r
-       {\r
-               return CSize(x - point.x, y - point.y);\r
-       }\r
-\r
-// Operators returning CRect values\r
-       CRect operator +(const RECT* lpRect) const;\r
-       CRect operator -(const RECT* lpRect) const;\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRect - Wrapper for Windows RECT structure.\r
-\r
-class CRect : public RECT\r
-{\r
-public:\r
-// Constructors\r
-       CRect()\r
-       {\r
-               left = 0;\r
-               top = 0;\r
-               right = 0;\r
-               bottom = 0;\r
-       }\r
-\r
-       CRect(int l, int t, int r, int b)\r
-       {\r
-               left = l;\r
-               top = t;\r
-               right = r;\r
-               bottom = b;\r
-       }\r
-\r
-       CRect(const RECT& srcRect)\r
-       {\r
-               ::CopyRect(this, &srcRect);\r
-       }\r
-\r
-       CRect(LPCRECT lpSrcRect)\r
-       {\r
-               ::CopyRect(this, lpSrcRect);\r
-       }\r
-\r
-       CRect(POINT point, SIZE size)\r
-       {\r
-               right = (left = point.x) + size.cx;\r
-               bottom = (top = point.y) + size.cy;\r
-       }\r
-\r
-       CRect(POINT topLeft, POINT bottomRight)\r
-       {\r
-               left = topLeft.x;\r
-               top = topLeft.y;\r
-               right = bottomRight.x;\r
-               bottom = bottomRight.y;\r
-       }\r
-\r
-// Attributes (in addition to RECT members)\r
-       int Width() const\r
-       {\r
-               return right - left;\r
-       }\r
-\r
-       int Height() const\r
-       {\r
-               return bottom - top;\r
-       }\r
-\r
-       CSize Size() const\r
-       {\r
-               return CSize(right - left, bottom - top);\r
-       }\r
-\r
-       CPoint& TopLeft()\r
-       {\r
-               return *((CPoint*)this);\r
-       }\r
-\r
-       CPoint& BottomRight()\r
-       {\r
-               return *((CPoint*)this + 1);\r
-       }\r
-\r
-       const CPoint& TopLeft() const\r
-       {\r
-               return *((CPoint*)this);\r
-       }\r
-\r
-       const CPoint& BottomRight() const\r
-       {\r
-               return *((CPoint*)this + 1);\r
-       }\r
-\r
-       CPoint CenterPoint() const\r
-       {\r
-               return CPoint((left + right) / 2, (top + bottom) / 2);\r
-       }\r
-\r
-       // convert between CRect and LPRECT/LPCRECT (no need for &)\r
-       operator LPRECT()\r
-       {\r
-               return this;\r
-       }\r
-\r
-       operator LPCRECT() const\r
-       {\r
-               return this;\r
-       }\r
-\r
-       BOOL IsRectEmpty() const\r
-       {\r
-               return ::IsRectEmpty(this);\r
-       }\r
-\r
-       BOOL IsRectNull() const\r
-       {\r
-               return (left == 0 && right == 0 && top == 0 && bottom == 0);\r
-       }\r
-\r
-       BOOL PtInRect(POINT point) const\r
-       {\r
-               return ::PtInRect(this, point);\r
-       }\r
-\r
-// Operations\r
-       void SetRect(int x1, int y1, int x2, int y2)\r
-       {\r
-               ::SetRect(this, x1, y1, x2, y2);\r
-       }\r
-\r
-       void SetRect(POINT topLeft, POINT bottomRight)\r
-       {\r
-               ::SetRect(this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);\r
-       }\r
-\r
-       void SetRectEmpty()\r
-       {\r
-               ::SetRectEmpty(this);\r
-       }\r
-\r
-       void CopyRect(LPCRECT lpSrcRect)\r
-       {\r
-               ::CopyRect(this, lpSrcRect);\r
-       }\r
-\r
-       BOOL EqualRect(LPCRECT lpRect) const\r
-       {\r
-               return ::EqualRect(this, lpRect);\r
-       }\r
-\r
-       void InflateRect(int x, int y)\r
-       {\r
-               ::InflateRect(this, x, y);\r
-       }\r
-\r
-       void InflateRect(SIZE size)\r
-       {\r
-               ::InflateRect(this, size.cx, size.cy);\r
-       }\r
-\r
-       void InflateRect(LPCRECT lpRect)\r
-       {\r
-               left -= lpRect->left;\r
-               top -= lpRect->top;\r
-               right += lpRect->right;\r
-               bottom += lpRect->bottom;\r
-       }\r
-\r
-       void InflateRect(int l, int t, int r, int b)\r
-       {\r
-               left -= l;\r
-               top -= t;\r
-               right += r;\r
-               bottom += b;\r
-       }\r
-\r
-       void DeflateRect(int x, int y)\r
-       {\r
-               ::InflateRect(this, -x, -y);\r
-       }\r
-\r
-       void DeflateRect(SIZE size)\r
-       {\r
-               ::InflateRect(this, -size.cx, -size.cy);\r
-       }\r
-\r
-       void DeflateRect(LPCRECT lpRect)\r
-       {\r
-               left += lpRect->left;\r
-               top += lpRect->top;\r
-               right -= lpRect->right;\r
-               bottom -= lpRect->bottom;\r
-       }\r
-\r
-       void DeflateRect(int l, int t, int r, int b)\r
-       {\r
-               left += l;\r
-               top += t;\r
-               right -= r;\r
-               bottom -= b;\r
-       }\r
-\r
-       void OffsetRect(int x, int y)\r
-       {\r
-               ::OffsetRect(this, x, y);\r
-       }\r
-       void OffsetRect(SIZE size)\r
-       {\r
-               ::OffsetRect(this, size.cx, size.cy);\r
-       }\r
-\r
-       void OffsetRect(POINT point)\r
-       {\r
-               ::OffsetRect(this, point.x, point.y);\r
-       }\r
-\r
-       void NormalizeRect()\r
-       {\r
-               int nTemp;\r
-               if (left > right)\r
-               {\r
-                       nTemp = left;\r
-                       left = right;\r
-                       right = nTemp;\r
-               }\r
-               if (top > bottom)\r
-               {\r
-                       nTemp = top;\r
-                       top = bottom;\r
-                       bottom = nTemp;\r
-               }\r
-       }\r
-\r
-       // absolute position of rectangle\r
-       void MoveToY(int y)\r
-       {\r
-               bottom = Height() + y;\r
-               top = y;\r
-       }\r
-\r
-       void MoveToX(int x)\r
-       {\r
-               right = Width() + x;\r
-               left = x;\r
-       }\r
-\r
-       void MoveToXY(int x, int y)\r
-       {\r
-               MoveToX(x);\r
-               MoveToY(y);\r
-       }\r
-\r
-       void MoveToXY(POINT pt)\r
-       {\r
-               MoveToX(pt.x);\r
-               MoveToY(pt.y);\r
-       }\r
-\r
-       // operations that fill '*this' with result\r
-       BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2)\r
-       {\r
-               return ::IntersectRect(this, lpRect1, lpRect2);\r
-       }\r
-\r
-       BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2)\r
-       {\r
-               return ::UnionRect(this, lpRect1, lpRect2);\r
-       }\r
-\r
-       BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2)\r
-       {\r
-               return ::SubtractRect(this, lpRectSrc1, lpRectSrc2);\r
-       }\r
-\r
-// Additional Operations\r
-       void operator =(const RECT& srcRect)\r
-       {\r
-               ::CopyRect(this, &srcRect);\r
-       }\r
-\r
-       BOOL operator ==(const RECT& rect) const\r
-       {\r
-               return ::EqualRect(this, &rect);\r
-       }\r
-\r
-       BOOL operator !=(const RECT& rect) const\r
-       {\r
-               return !::EqualRect(this, &rect);\r
-       }\r
-\r
-       void operator +=(POINT point)\r
-       {\r
-               ::OffsetRect(this, point.x, point.y);\r
-       }\r
-\r
-       void operator +=(SIZE size)\r
-       {\r
-               ::OffsetRect(this, size.cx, size.cy);\r
-       }\r
-\r
-       void operator +=(LPCRECT lpRect)\r
-       {\r
-               InflateRect(lpRect);\r
-       }\r
-\r
-       void operator -=(POINT point)\r
-       {\r
-               ::OffsetRect(this, -point.x, -point.y);\r
-       }\r
-\r
-       void operator -=(SIZE size)\r
-       {\r
-               ::OffsetRect(this, -size.cx, -size.cy);\r
-       }\r
-\r
-       void operator -=(LPCRECT lpRect)\r
-       {\r
-               DeflateRect(lpRect);\r
-       }\r
-\r
-       void operator &=(const RECT& rect)\r
-       {\r
-               ::IntersectRect(this, this, &rect);\r
-       }\r
-\r
-       void operator |=(const RECT& rect)\r
-       {\r
-               ::UnionRect(this, this, &rect);\r
-       }\r
-\r
-// Operators returning CRect values\r
-       CRect operator +(POINT pt) const\r
-       {\r
-               CRect rect(*this);\r
-               ::OffsetRect(&rect, pt.x, pt.y);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator -(POINT pt) const\r
-       {\r
-               CRect rect(*this);\r
-               ::OffsetRect(&rect, -pt.x, -pt.y);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator +(LPCRECT lpRect) const\r
-       {\r
-               CRect rect(this);\r
-               rect.InflateRect(lpRect);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator +(SIZE size) const\r
-       {\r
-               CRect rect(*this);\r
-               ::OffsetRect(&rect, size.cx, size.cy);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator -(SIZE size) const\r
-       {\r
-               CRect rect(*this);\r
-               ::OffsetRect(&rect, -size.cx, -size.cy);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator -(LPCRECT lpRect) const\r
-       {\r
-               CRect rect(this);\r
-               rect.DeflateRect(lpRect);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator &(const RECT& rect2) const\r
-       {\r
-               CRect rect;\r
-               ::IntersectRect(&rect, this, &rect2);\r
-               return rect;\r
-       }\r
-\r
-       CRect operator |(const RECT& rect2) const\r
-       {\r
-               CRect rect;\r
-               ::UnionRect(&rect, this, &rect2);\r
-               return rect;\r
-       }\r
-\r
-       CRect MulDiv(int nMultiplier, int nDivisor) const\r
-       {\r
-               return CRect(\r
-                       ::MulDiv(left, nMultiplier, nDivisor),\r
-                       ::MulDiv(top, nMultiplier, nDivisor),\r
-                       ::MulDiv(right, nMultiplier, nDivisor),\r
-                       ::MulDiv(bottom, nMultiplier, nDivisor));\r
-       }\r
-};\r
-\r
-\r
-// CSize implementation\r
-\r
-inline CPoint CSize::operator +(POINT point) const\r
-{ return CPoint(cx + point.x, cy + point.y); }\r
-\r
-inline CPoint CSize::operator -(POINT point) const\r
-{ return CPoint(cx - point.x, cy - point.y); }\r
-\r
-inline CRect CSize::operator +(const RECT* lpRect) const\r
-{ return CRect(lpRect) + *this; }\r
-\r
-inline CRect CSize::operator -(const RECT* lpRect) const\r
-{ return CRect(lpRect) - *this; }\r
-\r
-\r
-// CPoint implementation\r
-\r
-inline CRect CPoint::operator +(const RECT* lpRect) const\r
-{ return CRect(lpRect) + *this; }\r
-\r
-inline CRect CPoint::operator -(const RECT* lpRect) const\r
-{ return CRect(lpRect) - *this; }\r
-\r
-#endif // !_WTL_NO_WTYPES\r
-\r
-\r
-// WTL::CSize or ATL::CSize scalar operators \r
-\r
-#if !defined(_WTL_NO_SIZE_SCALAR) && (!defined(_WTL_NO_WTYPES) || defined(__ATLTYPES_H__))\r
-\r
-template <class Num>\r
-inline CSize operator *(SIZE s, Num n) \r
-{\r
-       return CSize((int)(s.cx * n), (int)(s.cy * n));\r
-};\r
-\r
-template <class Num>\r
-inline void operator *=(SIZE & s, Num n)\r
-{\r
-       s = s * n;\r
-};     \r
-\r
-template <class Num>\r
-inline CSize operator /(SIZE s, Num n) \r
-{\r
-       return CSize((int)(s.cx / n), (int)(s.cy / n));\r
-};\r
-\r
-template <class Num>\r
-inline void operator /=(SIZE & s, Num n)\r
-{\r
-       s = s / n;\r
-};     \r
-\r
-#endif // !defined(_WTL_NO_SIZE_SCALAR) && (!defined(_WTL_NO_WTYPES) || defined(__ATLTYPES_H__))\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CString - String class\r
-\r
-#ifndef _WTL_NO_CSTRING\r
-\r
-struct CStringData\r
-{\r
-       long nRefs;     // reference count\r
-       int nDataLength;\r
-       int nAllocLength;\r
-       // TCHAR data[nAllocLength]\r
-\r
-       TCHAR* data()\r
-       { return (TCHAR*)(this + 1); }\r
-};\r
-\r
-// Globals\r
-\r
-// For an empty string, m_pchData will point here\r
-// (note: avoids special case of checking for NULL m_pchData)\r
-// empty string data (and locked)\r
-_declspec(selectany) int rgInitData[] = { -1, 0, 0, 0 };\r
-_declspec(selectany) CStringData* _atltmpDataNil = (CStringData*)&rgInitData;\r
-_declspec(selectany) LPCTSTR _atltmpPchNil = (LPCTSTR)(((BYTE*)&rgInitData) + sizeof(CStringData));\r
-\r
-\r
-class CString\r
-{\r
-public:\r
-// Constructors\r
-       CString()\r
-       {\r
-               Init();\r
-       }\r
-\r
-       CString(const CString& stringSrc)\r
-       {\r
-               ATLASSERT(stringSrc.GetData()->nRefs != 0);\r
-               if (stringSrc.GetData()->nRefs >= 0)\r
-               {\r
-                       ATLASSERT(stringSrc.GetData() != _atltmpDataNil);\r
-                       m_pchData = stringSrc.m_pchData;\r
-                       InterlockedIncrement(&GetData()->nRefs);\r
-               }\r
-               else\r
-               {\r
-                       Init();\r
-                       *this = stringSrc.m_pchData;\r
-               }\r
-       }\r
-\r
-       CString(TCHAR ch, int nRepeat = 1)\r
-       {\r
-               ATLASSERT(!_istlead(ch));   // can't create a lead byte string\r
-               Init();\r
-               if (nRepeat >= 1)\r
-               {\r
-                       if(AllocBuffer(nRepeat))\r
-                       {\r
-#ifdef _UNICODE\r
-                               for (int i = 0; i < nRepeat; i++)\r
-                                       m_pchData[i] = ch;\r
-#else\r
-                               memset(m_pchData, ch, nRepeat);\r
-#endif\r
-                       }\r
-               }\r
-       }\r
-\r
-       CString(LPCTSTR lpsz)\r
-       {\r
-               Init();\r
-               if (lpsz != NULL && HIWORD(lpsz) == NULL)\r
-               {\r
-                       UINT nID = LOWORD((DWORD_PTR)lpsz);\r
-                       if (!LoadString(nID))\r
-                               ATLTRACE2(atlTraceUI, 0, _T("Warning: implicit LoadString(%u) in CString failed\n"), nID);\r
-               }\r
-               else\r
-               {\r
-                       int nLen = SafeStrlen(lpsz);\r
-                       if (nLen != 0)\r
-                       {\r
-                               if(AllocBuffer(nLen))\r
-                                       SecureHelper::memcpy_x(m_pchData, (nLen + 1) * sizeof(TCHAR), lpsz, nLen * sizeof(TCHAR));\r
-                       }\r
-               }\r
-       }\r
-\r
-#ifdef _UNICODE\r
-       CString(LPCSTR lpsz)\r
-       {\r
-               Init();\r
-#if defined(_WIN32_WCE) && (_ATL_VER >= 0x0800)\r
-               int nSrcLen = (lpsz != NULL) ? ATL::lstrlenA(lpsz) : 0;\r
-#else\r
-               int nSrcLen = (lpsz != NULL) ? lstrlenA(lpsz) : 0;\r
-#endif\r
-               if (nSrcLen != 0)\r
-               {\r
-                       if(AllocBuffer(nSrcLen))\r
-                       {\r
-                               _mbstowcsz(m_pchData, lpsz, nSrcLen + 1);\r
-                               ReleaseBuffer();\r
-                       }\r
-               }\r
-       }\r
-#else // !_UNICODE\r
-       CString(LPCWSTR lpsz)\r
-       {\r
-               Init();\r
-               int nSrcLen = (lpsz != NULL) ? (int)wcslen(lpsz) : 0;\r
-               if (nSrcLen != 0)\r
-               {\r
-                       if(AllocBuffer(nSrcLen * 2))\r
-                       {\r
-                               _wcstombsz(m_pchData, lpsz, (nSrcLen * 2) + 1);\r
-                               ReleaseBuffer();\r
-                       }\r
-               }\r
-       }\r
-#endif // !_UNICODE\r
-\r
-       CString(LPCTSTR lpch, int nLength)\r
-       {\r
-               Init();\r
-               if (nLength != 0)\r
-               {\r
-                       if(AllocBuffer(nLength))\r
-                               SecureHelper::memcpy_x(m_pchData, (nLength + 1) * sizeof(TCHAR), lpch, nLength * sizeof(TCHAR));\r
-               }\r
-       }\r
-\r
-#ifdef _UNICODE\r
-       CString(LPCSTR lpsz, int nLength)\r
-       {\r
-               Init();\r
-               if (nLength != 0)\r
-               {\r
-                       if(AllocBuffer(nLength))\r
-                       {\r
-                               int n = ::MultiByteToWideChar(CP_ACP, 0, lpsz, nLength, m_pchData, nLength + 1);\r
-                               ReleaseBuffer((n >= 0) ? n : -1);\r
-                       }\r
-               }\r
-       }\r
-#else // !_UNICODE\r
-       CString(LPCWSTR lpsz, int nLength)\r
-       {\r
-               Init();\r
-               if (nLength != 0)\r
-               {\r
-                       if(((nLength * 2) > nLength) && AllocBuffer(nLength * 2))\r
-                       {\r
-                               int n = ::WideCharToMultiByte(CP_ACP, 0, lpsz, nLength, m_pchData, (nLength * 2) + 1, NULL, NULL);\r
-                               ReleaseBuffer((n >= 0) ? n : -1);\r
-                       }\r
-               }\r
-       }\r
-#endif // !_UNICODE\r
-\r
-       CString(const unsigned char* lpsz)\r
-       {\r
-               Init();\r
-               *this = (LPCSTR)lpsz;\r
-       }\r
-\r
-// Attributes & Operations\r
-       int GetLength() const   // as an array of characters\r
-       {\r
-               return GetData()->nDataLength;\r
-       }\r
-\r
-       BOOL IsEmpty() const\r
-       {\r
-               return GetData()->nDataLength == 0;\r
-       }\r
-\r
-       void Empty()   // free up the data\r
-       {\r
-               if (GetData()->nDataLength == 0)\r
-                       return;\r
-\r
-               if (GetData()->nRefs >= 0)\r
-                       Release();\r
-               else\r
-                       *this = _T("");\r
-\r
-               ATLASSERT(GetData()->nDataLength == 0);\r
-               ATLASSERT(GetData()->nRefs < 0 || GetData()->nAllocLength == 0);\r
-       }\r
-\r
-       TCHAR GetAt(int nIndex) const   // 0 based\r
-       {\r
-               ATLASSERT(nIndex >= 0);\r
-               ATLASSERT(nIndex < GetData()->nDataLength);\r
-               return m_pchData[nIndex];\r
-       }\r
-\r
-       TCHAR operator [](int nIndex) const   // same as GetAt\r
-       {\r
-               // same as GetAt\r
-               ATLASSERT(nIndex >= 0);\r
-               ATLASSERT(nIndex < GetData()->nDataLength);\r
-               return m_pchData[nIndex];\r
-       }\r
-\r
-       void SetAt(int nIndex, TCHAR ch)\r
-       {\r
-               ATLASSERT(nIndex >= 0);\r
-               ATLASSERT(nIndex < GetData()->nDataLength);\r
-\r
-               CopyBeforeWrite();\r
-               m_pchData[nIndex] = ch;\r
-       }\r
-\r
-       operator LPCTSTR() const   // as a C string\r
-       {\r
-               return m_pchData;\r
-       }\r
-\r
-       // overloaded assignment\r
-       CString& operator =(const CString& stringSrc)\r
-       {\r
-               if (m_pchData != stringSrc.m_pchData)\r
-               {\r
-                       if ((GetData()->nRefs < 0 && GetData() != _atltmpDataNil) || stringSrc.GetData()->nRefs < 0)\r
-                       {\r
-                               // actual copy necessary since one of the strings is locked\r
-                               AssignCopy(stringSrc.GetData()->nDataLength, stringSrc.m_pchData);\r
-                       }\r
-                       else\r
-                       {\r
-                               // can just copy references around\r
-                               Release();\r
-                               ATLASSERT(stringSrc.GetData() != _atltmpDataNil);\r
-                               m_pchData = stringSrc.m_pchData;\r
-                               InterlockedIncrement(&GetData()->nRefs);\r
-                       }\r
-               }\r
-               return *this;\r
-       }\r
-\r
-       CString& operator =(TCHAR ch)\r
-       {\r
-               ATLASSERT(!_istlead(ch));   // can't set single lead byte\r
-               AssignCopy(1, &ch);\r
-               return *this;\r
-       }\r
-\r
-#ifdef _UNICODE\r
-       CString& operator =(char ch)\r
-       {\r
-               *this = (TCHAR)ch;\r
-               return *this;\r
-       }\r
-#endif\r
-\r
-       CString& operator =(LPCTSTR lpsz)\r
-       {\r
-               ATLASSERT(lpsz == NULL || _IsValidString(lpsz));\r
-               AssignCopy(SafeStrlen(lpsz), lpsz);\r
-               return *this;\r
-       }\r
-\r
-#ifdef _UNICODE\r
-       CString& operator =(LPCSTR lpsz)\r
-       {\r
-#if defined(_WIN32_WCE) && (_ATL_VER >= 0x0800)\r
-               int nSrcLen = (lpsz != NULL) ? ATL::lstrlenA(lpsz) : 0;\r
-#else\r
-               int nSrcLen = (lpsz != NULL) ? lstrlenA(lpsz) : 0;\r
-#endif\r
-               if(AllocBeforeWrite(nSrcLen))\r
-               {\r
-                       _mbstowcsz(m_pchData, lpsz, nSrcLen + 1);\r
-                       ReleaseBuffer();\r
-               }\r
-               return *this;\r
-       }\r
-#else // !_UNICODE\r
-       CString& operator =(LPCWSTR lpsz)\r
-       {\r
-               int nSrcLen = (lpsz != NULL) ? (int)wcslen(lpsz) : 0;\r
-               if(AllocBeforeWrite(nSrcLen * 2))\r
-               {\r
-                       _wcstombsz(m_pchData, lpsz, (nSrcLen * 2) + 1);\r
-                       ReleaseBuffer();\r
-               }\r
-               return *this;\r
-       }\r
-#endif  // !_UNICODE\r
-\r
-       CString& operator =(const unsigned char* lpsz)\r
-       {\r
-               *this = (LPCSTR)lpsz;\r
-               return *this;\r
-       }\r
-\r
-       // string concatenation\r
-       CString& operator +=(const CString& string)\r
-       {\r
-               ConcatInPlace(string.GetData()->nDataLength, string.m_pchData);\r
-               return *this;\r
-       }\r
-\r
-       CString& operator +=(TCHAR ch)\r
-       {\r
-               ConcatInPlace(1, &ch);\r
-               return *this;\r
-       }\r
-\r
-#ifdef _UNICODE\r
-       CString& operator +=(char ch)\r
-       {\r
-               *this += (TCHAR)ch;\r
-               return *this;\r
-       }\r
-#endif\r
-\r
-       CString& operator +=(LPCTSTR lpsz)\r
-       {\r
-               ATLASSERT(lpsz == NULL || _IsValidString(lpsz));\r
-               ConcatInPlace(SafeStrlen(lpsz), lpsz);\r
-               return *this;\r
-       }\r
-\r
-       friend CString __stdcall operator +(const CString& string1, const CString& string2);\r
-       friend CString __stdcall operator +(const CString& string, TCHAR ch);\r
-       friend CString __stdcall operator +(TCHAR ch, const CString& string);\r
-#ifdef _UNICODE\r
-       friend CString __stdcall operator +(const CString& string, char ch);\r
-       friend CString __stdcall operator +(char ch, const CString& string);\r
-#endif\r
-       friend CString __stdcall operator +(const CString& string, LPCTSTR lpsz);\r
-       friend CString __stdcall operator +(LPCTSTR lpsz, const CString& string);\r
-\r
-       // string comparison\r
-       int Compare(LPCTSTR lpsz) const   // straight character (MBCS/Unicode aware)\r
-       {\r
-               return _cstrcmp(m_pchData, lpsz);\r
-       }\r
-\r
-       int CompareNoCase(LPCTSTR lpsz) const   // ignore case (MBCS/Unicode aware)\r
-       {\r
-               return _cstrcmpi(m_pchData, lpsz);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       // CString::Collate is often slower than Compare but is MBSC/Unicode\r
-       //  aware as well as locale-sensitive with respect to sort order.\r
-       int Collate(LPCTSTR lpsz) const   // NLS aware\r
-       {\r
-               return _cstrcoll(m_pchData, lpsz);\r
-       }\r
-\r
-       int CollateNoCase(LPCTSTR lpsz) const   // ignore case\r
-       {\r
-               return _cstrcolli(m_pchData, lpsz);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       // simple sub-string extraction\r
-       CString Mid(int nFirst, int nCount) const\r
-       {\r
-               // out-of-bounds requests return sensible things\r
-               if (nFirst < 0)\r
-                       nFirst = 0;\r
-               if (nCount < 0)\r
-                       nCount = 0;\r
-\r
-               if (nFirst + nCount > GetData()->nDataLength)\r
-                       nCount = GetData()->nDataLength - nFirst;\r
-               if (nFirst > GetData()->nDataLength)\r
-                       nCount = 0;\r
-\r
-               CString dest;\r
-               AllocCopy(dest, nCount, nFirst, 0);\r
-               return dest;\r
-       }\r
-\r
-       CString Mid(int nFirst) const\r
-       {\r
-               return Mid(nFirst, GetData()->nDataLength - nFirst);\r
-       }\r
-\r
-       CString Left(int nCount) const\r
-       {\r
-               if (nCount < 0)\r
-                       nCount = 0;\r
-               else if (nCount > GetData()->nDataLength)\r
-                       nCount = GetData()->nDataLength;\r
-\r
-               CString dest;\r
-               AllocCopy(dest, nCount, 0, 0);\r
-               return dest;\r
-       }\r
-\r
-       CString Right(int nCount) const\r
-       {\r
-               if (nCount < 0)\r
-                       nCount = 0;\r
-               else if (nCount > GetData()->nDataLength)\r
-                       nCount = GetData()->nDataLength;\r
-\r
-               CString dest;\r
-               AllocCopy(dest, nCount, GetData()->nDataLength-nCount, 0);\r
-               return dest;\r
-       }\r
-\r
-       CString SpanIncluding(LPCTSTR lpszCharSet) const   // strspn equivalent\r
-       {\r
-               ATLASSERT(_IsValidString(lpszCharSet));\r
-               return Left(_cstrspn(m_pchData, lpszCharSet));\r
-       }\r
-\r
-       CString SpanExcluding(LPCTSTR lpszCharSet) const   // strcspn equivalent\r
-       {\r
-               ATLASSERT(_IsValidString(lpszCharSet));\r
-               return Left(_cstrcspn(m_pchData, lpszCharSet));\r
-       }\r
-\r
-       // upper/lower/reverse conversion\r
-       void MakeUpper()\r
-       {\r
-               CopyBeforeWrite();\r
-               CharUpper(m_pchData);\r
-       }\r
-\r
-       void MakeLower()\r
-       {\r
-               CopyBeforeWrite();\r
-               CharLower(m_pchData);\r
-       }\r
-\r
-       void MakeReverse()\r
-       {\r
-               CopyBeforeWrite();\r
-               _cstrrev(m_pchData);\r
-       }\r
-\r
-       // trimming whitespace (either side)\r
-       void TrimRight()\r
-       {\r
-               CopyBeforeWrite();\r
-\r
-               // find beginning of trailing spaces by starting at beginning (DBCS aware)\r
-               LPTSTR lpsz = m_pchData;\r
-               LPTSTR lpszLast = NULL;\r
-               while (*lpsz != _T('\0'))\r
-               {\r
-                       if (_cstrisspace(*lpsz))\r
-                       {\r
-                               if (lpszLast == NULL)\r
-                                       lpszLast = lpsz;\r
-                       }\r
-                       else\r
-                       {\r
-                               lpszLast = NULL;\r
-                       }\r
-                       lpsz = ::CharNext(lpsz);\r
-               }\r
-\r
-               if (lpszLast != NULL)\r
-               {\r
-                       // truncate at trailing space start\r
-                       *lpszLast = _T('\0');\r
-                       GetData()->nDataLength = (int)(DWORD_PTR)(lpszLast - m_pchData);\r
-               }\r
-       }\r
-\r
-       void TrimLeft()\r
-       {\r
-               CopyBeforeWrite();\r
-\r
-               // find first non-space character\r
-               LPCTSTR lpsz = m_pchData;\r
-               while (_cstrisspace(*lpsz))\r
-                       lpsz = ::CharNext(lpsz);\r
-\r
-               // fix up data and length\r
-               int nDataLength = GetData()->nDataLength - (int)(DWORD_PTR)(lpsz - m_pchData);\r
-               SecureHelper::memmove_x(m_pchData, (GetData()->nAllocLength + 1) * sizeof(TCHAR), lpsz, (nDataLength + 1) * sizeof(TCHAR));\r
-               GetData()->nDataLength = nDataLength;\r
-       }\r
-\r
-       // remove continuous occurrences of chTarget starting from right\r
-       void TrimRight(TCHAR chTarget)\r
-       {\r
-               // find beginning of trailing matches\r
-               // by starting at beginning (DBCS aware)\r
-\r
-               CopyBeforeWrite();\r
-               LPTSTR lpsz = m_pchData;\r
-               LPTSTR lpszLast = NULL;\r
-\r
-               while (*lpsz != _T('\0'))\r
-               {\r
-                       if (*lpsz == chTarget)\r
-                       {\r
-                               if (lpszLast == NULL)\r
-                                       lpszLast = lpsz;\r
-                       }\r
-                       else\r
-                               lpszLast = NULL;\r
-                       lpsz = ::CharNext(lpsz);\r
-               }\r
-\r
-               if (lpszLast != NULL)\r
-               {\r
-                       // truncate at left-most matching character\r
-                       *lpszLast = _T('\0');\r
-                       GetData()->nDataLength = (int)(DWORD_PTR)(lpszLast - m_pchData);\r
-               }\r
-       }\r
-\r
-       // remove continuous occcurrences of characters in passed string, starting from right\r
-       void TrimRight(LPCTSTR lpszTargetList)\r
-       {\r
-               // find beginning of trailing matches by starting at beginning (DBCS aware)\r
-\r
-               CopyBeforeWrite();\r
-               LPTSTR lpsz = m_pchData;\r
-               LPTSTR lpszLast = NULL;\r
-\r
-               while (*lpsz != _T('\0'))\r
-               {\r
-                       TCHAR* pNext = ::CharNext(lpsz);\r
-                       if(pNext > lpsz + 1)\r
-                       {\r
-                               if (_cstrchr_db(lpszTargetList, *lpsz, *(lpsz + 1)) != NULL)\r
-                               {\r
-                                       if (lpszLast == NULL)\r
-                                               lpszLast = lpsz;\r
-                               }\r
-                               else\r
-                               {\r
-                                       lpszLast = NULL;\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               if (_cstrchr(lpszTargetList, *lpsz) != NULL)\r
-                               {\r
-                                       if (lpszLast == NULL)\r
-                                               lpszLast = lpsz;\r
-                               }\r
-                               else\r
-                               {\r
-                                       lpszLast = NULL;\r
-                               }\r
-                       }\r
-\r
-                       lpsz = pNext;\r
-               }\r
-\r
-               if (lpszLast != NULL)\r
-               {\r
-                       // truncate at left-most matching character\r
-                       *lpszLast = _T('\0');\r
-                       GetData()->nDataLength = (int)(DWORD_PTR)(lpszLast - m_pchData);\r
-               }\r
-       }\r
-\r
-       // remove continuous occurrences of chTarget starting from left\r
-       void TrimLeft(TCHAR chTarget)\r
-       {\r
-               // find first non-matching character\r
-\r
-               CopyBeforeWrite();\r
-               LPCTSTR lpsz = m_pchData;\r
-\r
-               while (chTarget == *lpsz)\r
-                       lpsz = ::CharNext(lpsz);\r
-\r
-               if (lpsz != m_pchData)\r
-               {\r
-                       // fix up data and length\r
-                       int nDataLength = GetData()->nDataLength - (int)(DWORD_PTR)(lpsz - m_pchData);\r
-                       SecureHelper::memmove_x(m_pchData, (GetData()->nAllocLength + 1) * sizeof(TCHAR), lpsz, (nDataLength + 1) * sizeof(TCHAR));\r
-                       GetData()->nDataLength = nDataLength;\r
-               }\r
-       }\r
-\r
-       // remove continuous occcurrences of characters in passed string, starting from left\r
-       void TrimLeft(LPCTSTR lpszTargets)\r
-       {\r
-               // if we're not trimming anything, we're not doing any work\r
-               if (SafeStrlen(lpszTargets) == 0)\r
-                       return;\r
-\r
-               CopyBeforeWrite();\r
-               LPCTSTR lpsz = m_pchData;\r
-\r
-               while (*lpsz != _T('\0'))\r
-               {\r
-                       TCHAR* pNext = ::CharNext(lpsz);\r
-                       if(pNext > lpsz + 1)\r
-                       {\r
-                               if (_cstrchr_db(lpszTargets, *lpsz, *(lpsz + 1)) == NULL)\r
-                                       break;\r
-                       }\r
-                       else\r
-                       {\r
-                               if (_cstrchr(lpszTargets, *lpsz) == NULL)\r
-                                       break;\r
-                       }\r
-                       lpsz = pNext;\r
-               }\r
-\r
-               if (lpsz != m_pchData)\r
-               {\r
-                       // fix up data and length\r
-                       int nDataLength = GetData()->nDataLength - (int)(DWORD_PTR)(lpsz - m_pchData);\r
-                       SecureHelper::memmove_x(m_pchData, (GetData()->nAllocLength + 1) * sizeof(TCHAR), lpsz, (nDataLength + 1) * sizeof(TCHAR));\r
-                       GetData()->nDataLength = nDataLength;\r
-               }\r
-       }\r
-\r
-       // advanced manipulation\r
-       // replace occurrences of chOld with chNew\r
-       int Replace(TCHAR chOld, TCHAR chNew)\r
-       {\r
-               int nCount = 0;\r
-\r
-               // short-circuit the nop case\r
-               if (chOld != chNew)\r
-               {\r
-                       // otherwise modify each character that matches in the string\r
-                       CopyBeforeWrite();\r
-                       LPTSTR psz = m_pchData;\r
-                       LPTSTR pszEnd = psz + GetData()->nDataLength;\r
-                       while (psz < pszEnd)\r
-                       {\r
-                               // replace instances of the specified character only\r
-                               if (*psz == chOld)\r
-                               {\r
-                                       *psz = chNew;\r
-                                       nCount++;\r
-                               }\r
-                               psz = ::CharNext(psz);\r
-                       }\r
-               }\r
-               return nCount;\r
-       }\r
-\r
-       // replace occurrences of substring lpszOld with lpszNew;\r
-       // empty lpszNew removes instances of lpszOld\r
-       int Replace(LPCTSTR lpszOld, LPCTSTR lpszNew)\r
-       {\r
-               // can't have empty or NULL lpszOld\r
-\r
-               int nSourceLen = SafeStrlen(lpszOld);\r
-               if (nSourceLen == 0)\r
-                       return 0;\r
-               int nReplacementLen = SafeStrlen(lpszNew);\r
-\r
-               // loop once to figure out the size of the result string\r
-               int nCount = 0;\r
-               LPTSTR lpszStart = m_pchData;\r
-               LPTSTR lpszEnd = m_pchData + GetData()->nDataLength;\r
-               LPTSTR lpszTarget = NULL;\r
-               while (lpszStart < lpszEnd)\r
-               {\r
-                       while ((lpszTarget = (TCHAR*)_cstrstr(lpszStart, lpszOld)) != NULL)\r
-                       {\r
-                               nCount++;\r
-                               lpszStart = lpszTarget + nSourceLen;\r
-                       }\r
-                       lpszStart += lstrlen(lpszStart) + 1;\r
-               }\r
-\r
-               // if any changes were made, make them\r
-               if (nCount > 0)\r
-               {\r
-                       CopyBeforeWrite();\r
-\r
-                       // if the buffer is too small, just allocate a new buffer (slow but sure)\r
-                       int nOldLength = GetData()->nDataLength;\r
-                       int nNewLength =  nOldLength + (nReplacementLen - nSourceLen) * nCount;\r
-                       if (GetData()->nAllocLength < nNewLength || GetData()->nRefs > 1)\r
-                       {\r
-                               CStringData* pOldData = GetData();\r
-                               LPTSTR pstr = m_pchData;\r
-                               if(!AllocBuffer(nNewLength))\r
-                                       return -1;\r
-                               SecureHelper::memcpy_x(m_pchData, (nNewLength + 1) * sizeof(TCHAR), pstr, pOldData->nDataLength * sizeof(TCHAR));\r
-                               CString::Release(pOldData);\r
-                       }\r
-                       // else, we just do it in-place\r
-                       lpszStart = m_pchData;\r
-                       lpszEnd = m_pchData + GetData()->nDataLength;\r
-\r
-                       // loop again to actually do the work\r
-                       while (lpszStart < lpszEnd)\r
-                       {\r
-                               while ((lpszTarget = (TCHAR*)_cstrstr(lpszStart, lpszOld)) != NULL)\r
-                               {\r
-                                       int nBalance = nOldLength - ((int)(DWORD_PTR)(lpszTarget - m_pchData) + nSourceLen);\r
-                                       int cchBuffLen = GetData()->nAllocLength - (int)(DWORD_PTR)(lpszTarget - m_pchData);\r
-                                       SecureHelper::memmove_x(lpszTarget + nReplacementLen, (cchBuffLen - nReplacementLen + 1) * sizeof(TCHAR), lpszTarget + nSourceLen, nBalance * sizeof(TCHAR));\r
-                                       SecureHelper::memcpy_x(lpszTarget, (cchBuffLen + 1) * sizeof(TCHAR), lpszNew, nReplacementLen * sizeof(TCHAR));\r
-                                       lpszStart = lpszTarget + nReplacementLen;\r
-                                       lpszStart[nBalance] = _T('\0');\r
-                                       nOldLength += (nReplacementLen - nSourceLen);\r
-                               }\r
-                               lpszStart += lstrlen(lpszStart) + 1;\r
-                       }\r
-                       ATLASSERT(m_pchData[nNewLength] == _T('\0'));\r
-                       GetData()->nDataLength = nNewLength;\r
-               }\r
-\r
-               return nCount;\r
-       }\r
-\r
-       // remove occurrences of chRemove\r
-       int Remove(TCHAR chRemove)\r
-       {\r
-               CopyBeforeWrite();\r
-\r
-               LPTSTR pstrSource = m_pchData;\r
-               LPTSTR pstrDest = m_pchData;\r
-               LPTSTR pstrEnd = m_pchData + GetData()->nDataLength;\r
-\r
-               while (pstrSource < pstrEnd)\r
-               {\r
-                       if (*pstrSource != chRemove)\r
-                       {\r
-                               *pstrDest = *pstrSource;\r
-                               pstrDest = ::CharNext(pstrDest);\r
-                       }\r
-                       pstrSource = ::CharNext(pstrSource);\r
-               }\r
-               *pstrDest = _T('\0');\r
-               int nCount = (int)(DWORD_PTR)(pstrSource - pstrDest);\r
-               GetData()->nDataLength -= nCount;\r
-\r
-               return nCount;\r
-       }\r
-\r
-       // insert character at zero-based index; concatenates if index is past end of string\r
-       int Insert(int nIndex, TCHAR ch)\r
-       {\r
-               CopyBeforeWrite();\r
-\r
-               if (nIndex < 0)\r
-                       nIndex = 0;\r
-\r
-               int nNewLength = GetData()->nDataLength;\r
-               if (nIndex > nNewLength)\r
-                       nIndex = nNewLength;\r
-               nNewLength++;\r
-\r
-               if (GetData()->nAllocLength < nNewLength)\r
-               {\r
-                       CStringData* pOldData = GetData();\r
-                       LPTSTR pstr = m_pchData;\r
-                       if(!AllocBuffer(nNewLength))\r
-                               return -1;\r
-                       SecureHelper::memcpy_x(m_pchData, (nNewLength + 1) * sizeof(TCHAR), pstr, (pOldData->nDataLength + 1) * sizeof(TCHAR));\r
-                       CString::Release(pOldData);\r
-               }\r
-\r
-               // move existing bytes down\r
-               SecureHelper::memmove_x(m_pchData + nIndex + 1, (GetData()->nAllocLength - nIndex) * sizeof(TCHAR), m_pchData + nIndex, (nNewLength - nIndex) * sizeof(TCHAR));\r
-               m_pchData[nIndex] = ch;\r
-               GetData()->nDataLength = nNewLength;\r
-\r
-               return nNewLength;\r
-       }\r
-\r
-       // insert substring at zero-based index; concatenates if index is past end of string\r
-       int Insert(int nIndex, LPCTSTR pstr)\r
-       {\r
-               if (nIndex < 0)\r
-                       nIndex = 0;\r
-\r
-               int nInsertLength = SafeStrlen(pstr);\r
-               int nNewLength = GetData()->nDataLength;\r
-               if (nInsertLength > 0)\r
-               {\r
-                       CopyBeforeWrite();\r
-                       if (nIndex > nNewLength)\r
-                               nIndex = nNewLength;\r
-                       nNewLength += nInsertLength;\r
-\r
-                       if (GetData()->nAllocLength < nNewLength)\r
-                       {\r
-                               CStringData* pOldData = GetData();\r
-                               LPTSTR pstr = m_pchData;\r
-                               if(!AllocBuffer(nNewLength))\r
-                                       return -1;\r
-                               SecureHelper::memcpy_x(m_pchData, (nNewLength + 1) * sizeof(TCHAR), pstr, (pOldData->nDataLength + 1) * sizeof(TCHAR));\r
-                               CString::Release(pOldData);\r
-                       }\r
-\r
-                       // move existing bytes down\r
-                       SecureHelper::memmove_x(m_pchData + nIndex + nInsertLength, (GetData()->nAllocLength + 1 - nIndex - nInsertLength) * sizeof(TCHAR), m_pchData + nIndex, (nNewLength - nIndex - nInsertLength + 1) * sizeof(TCHAR));\r
-                       SecureHelper::memcpy_x(m_pchData + nIndex, (GetData()->nAllocLength + 1 - nIndex) * sizeof(TCHAR), pstr, nInsertLength * sizeof(TCHAR));\r
-                       GetData()->nDataLength = nNewLength;\r
-               }\r
-\r
-               return nNewLength;\r
-       }\r
-\r
-       // delete nCount characters starting at zero-based index\r
-       int Delete(int nIndex, int nCount = 1)\r
-       {\r
-               if (nIndex < 0)\r
-                       nIndex = 0;\r
-               int nLength = GetData()->nDataLength;\r
-               if (nCount > 0 && nIndex < nLength)\r
-               {\r
-                       if((nIndex + nCount) > nLength)\r
-                               nCount = nLength - nIndex;\r
-                       CopyBeforeWrite();\r
-                       int nBytesToCopy = nLength - (nIndex + nCount) + 1;\r
-\r
-                       SecureHelper::memmove_x(m_pchData + nIndex, (GetData()->nAllocLength + 1 - nIndex) * sizeof(TCHAR), m_pchData + nIndex + nCount, nBytesToCopy * sizeof(TCHAR));\r
-                       nLength -= nCount;\r
-                       GetData()->nDataLength = nLength;\r
-               }\r
-\r
-               return nLength;\r
-       }\r
-\r
-       // searching (return starting index, or -1 if not found)\r
-       // look for a single character match\r
-       int Find(TCHAR ch) const   // like "C" strchr\r
-       {\r
-               return Find(ch, 0);\r
-       }\r
-\r
-       int ReverseFind(TCHAR ch) const\r
-       {\r
-               // find last single character\r
-               LPCTSTR lpsz = _cstrrchr(m_pchData, (_TUCHAR)ch);\r
-\r
-               // return -1 if not found, distance from beginning otherwise\r
-               return (lpsz == NULL) ? -1 : (int)(lpsz - m_pchData);\r
-       }\r
-\r
-       int Find(TCHAR ch, int nStart) const   // starting at index\r
-       {\r
-               int nLength = GetData()->nDataLength;\r
-               if (nStart < 0 || nStart >= nLength)\r
-                       return -1;\r
-\r
-               // find first single character\r
-               LPCTSTR lpsz = _cstrchr(m_pchData + nStart, (_TUCHAR)ch);\r
-\r
-               // return -1 if not found and index otherwise\r
-               return (lpsz == NULL) ? -1 : (int)(lpsz - m_pchData);\r
-       }\r
-\r
-       int FindOneOf(LPCTSTR lpszCharSet) const\r
-       {\r
-               ATLASSERT(_IsValidString(lpszCharSet));\r
-               LPCTSTR lpsz = _cstrpbrk(m_pchData, lpszCharSet);\r
-               return (lpsz == NULL) ? -1 : (int)(lpsz - m_pchData);\r
-       }\r
-\r
-       // look for a specific sub-string\r
-       // find a sub-string (like strstr)\r
-       int Find(LPCTSTR lpszSub) const   // like "C" strstr\r
-       {\r
-               return Find(lpszSub, 0);\r
-       }\r
-\r
-       int Find(LPCTSTR lpszSub, int nStart) const   // starting at index\r
-       {\r
-               ATLASSERT(_IsValidString(lpszSub));\r
-\r
-               int nLength = GetData()->nDataLength;\r
-               if (nStart < 0 || nStart > nLength)\r
-                       return -1;\r
-\r
-               // find first matching substring\r
-               LPCTSTR lpsz = _cstrstr(m_pchData + nStart, lpszSub);\r
-\r
-               // return -1 for not found, distance from beginning otherwise\r
-               return (lpsz == NULL) ? -1 : (int)(lpsz - m_pchData);\r
-       }\r
-\r
-       // Concatentation for non strings\r
-       CString& Append(int n)\r
-       {\r
-               const int cchBuff = 12;\r
-               TCHAR szBuffer[cchBuff] = { 0 };\r
-               SecureHelper::wsprintf_x(szBuffer, cchBuff, _T("%d"), n);\r
-               ConcatInPlace(SafeStrlen(szBuffer), szBuffer);\r
-               return *this;\r
-       }\r
-\r
-       // simple formatting\r
-       // formatting (using wsprintf style formatting)\r
-       BOOL __cdecl Format(LPCTSTR lpszFormat, ...)\r
-       {\r
-               ATLASSERT(_IsValidString(lpszFormat));\r
-\r
-               va_list argList;\r
-               va_start(argList, lpszFormat);\r
-               BOOL bRet = FormatV(lpszFormat, argList);\r
-               va_end(argList);\r
-               return bRet;\r
-       }\r
-\r
-       BOOL __cdecl Format(UINT nFormatID, ...)\r
-       {\r
-               CString strFormat;\r
-               BOOL bRet = strFormat.LoadString(nFormatID);\r
-               ATLASSERT(bRet != 0);\r
-\r
-               va_list argList;\r
-               va_start(argList, nFormatID);\r
-               bRet = FormatV(strFormat, argList);\r
-               va_end(argList);\r
-               return bRet;\r
-       }\r
-\r
-       BOOL FormatV(LPCTSTR lpszFormat, va_list argList)\r
-       {\r
-               ATLASSERT(_IsValidString(lpszFormat));\r
-\r
-               enum _FormatModifiers\r
-               {\r
-                       FORCE_ANSI =    0x10000,\r
-                       FORCE_UNICODE = 0x20000,\r
-                       FORCE_INT64 =   0x40000\r
-               };\r
-\r
-               va_list argListSave = argList;\r
-\r
-               // make a guess at the maximum length of the resulting string\r
-               int nMaxLen = 0;\r
-               for (LPCTSTR lpsz = lpszFormat; *lpsz != _T('\0'); lpsz = ::CharNext(lpsz))\r
-               {\r
-                       // handle '%' character, but watch out for '%%'\r
-                       if (*lpsz != _T('%') || *(lpsz = ::CharNext(lpsz)) == _T('%'))\r
-                       {\r
-                               nMaxLen += (int)(::CharNext(lpsz) - lpsz);\r
-                               continue;\r
-                       }\r
-\r
-                       int nItemLen = 0;\r
-\r
-                       // handle '%' character with format\r
-                       int nWidth = 0;\r
-                       for (; *lpsz != _T('\0'); lpsz = ::CharNext(lpsz))\r
-                       {\r
-                               // check for valid flags\r
-                               if (*lpsz == _T('#'))\r
-                                       nMaxLen += 2;   // for '0x'\r
-                               else if (*lpsz == _T('*'))\r
-                                       nWidth = va_arg(argList, int);\r
-                               else if (*lpsz == _T('-') || *lpsz == _T('+') || *lpsz == _T('0') || *lpsz == _T(' '))\r
-                                       ;\r
-                               else // hit non-flag character\r
-                                       break;\r
-                       }\r
-                       // get width and skip it\r
-                       if (nWidth == 0)\r
-                       {\r
-                               // width indicated by\r
-                               nWidth = _cstrtoi(lpsz);\r
-                               for (; *lpsz != _T('\0') && _cstrisdigit(*lpsz); lpsz = ::CharNext(lpsz))\r
-                                       ;\r
-                       }\r
-                       ATLASSERT(nWidth >= 0);\r
-\r
-                       int nPrecision = 0;\r
-                       if (*lpsz == _T('.'))\r
-                       {\r
-                               // skip past '.' separator (width.precision)\r
-                               lpsz = ::CharNext(lpsz);\r
-\r
-                               // get precision and skip it\r
-                               if (*lpsz == _T('*'))\r
-                               {\r
-                                       nPrecision = va_arg(argList, int);\r
-                                       lpsz = ::CharNext(lpsz);\r
-                               }\r
-                               else\r
-                               {\r
-                                       nPrecision = _cstrtoi(lpsz);\r
-                                       for (; *lpsz != _T('\0') && _cstrisdigit(*lpsz); lpsz = ::CharNext(lpsz))\r
-                                               ;\r
-                               }\r
-                               ATLASSERT(nPrecision >= 0);\r
-                       }\r
-\r
-                       // should be on type modifier or specifier\r
-                       int nModifier = 0;\r
-                       if(lpsz[0] == _T('I') && lpsz[1] == _T('6') && lpsz[2] == _T('4'))\r
-                       {\r
-                               lpsz += 3;\r
-                               nModifier = FORCE_INT64;\r
-                       }\r
-                       else\r
-                       {\r
-                               switch (*lpsz)\r
-                               {\r
-                               // modifiers that affect size\r
-                               case _T('h'):\r
-                                       nModifier = FORCE_ANSI;\r
-                                       lpsz = ::CharNext(lpsz);\r
-                                       break;\r
-                               case _T('l'):\r
-                                       nModifier = FORCE_UNICODE;\r
-                                       lpsz = ::CharNext(lpsz);\r
-                                       break;\r
-\r
-                               // modifiers that do not affect size\r
-                               case _T('F'):\r
-                               case _T('N'):\r
-                               case _T('L'):\r
-                                       lpsz = ::CharNext(lpsz);\r
-                                       break;\r
-                               }\r
-                       }\r
-\r
-                       // now should be on specifier\r
-                       switch (*lpsz | nModifier)\r
-                       {\r
-                       // single characters\r
-                       case _T('c'):\r
-                       case _T('C'):\r
-                               nItemLen = 2;\r
-                               va_arg(argList, TCHAR);\r
-                               break;\r
-                       case _T('c') | FORCE_ANSI:\r
-                       case _T('C') | FORCE_ANSI:\r
-                               nItemLen = 2;\r
-                               va_arg(argList, char);\r
-                               break;\r
-                       case _T('c') | FORCE_UNICODE:\r
-                       case _T('C') | FORCE_UNICODE:\r
-                               nItemLen = 2;\r
-                               va_arg(argList, WCHAR);\r
-                               break;\r
-\r
-                       // strings\r
-                       case _T('s'):\r
-                       {\r
-                               LPCTSTR pstrNextArg = va_arg(argList, LPCTSTR);\r
-                               if (pstrNextArg == NULL)\r
-                               {\r
-                                       nItemLen = 6;  // "(null)"\r
-                               }\r
-                               else\r
-                               {\r
-                                       nItemLen = lstrlen(pstrNextArg);\r
-                                       nItemLen = max(1, nItemLen);\r
-                               }\r
-                               break;\r
-                       }\r
-\r
-                       case _T('S'):\r
-                       {\r
-#ifndef _UNICODE\r
-                               LPWSTR pstrNextArg = va_arg(argList, LPWSTR);\r
-                               if (pstrNextArg == NULL)\r
-                               {\r
-                                       nItemLen = 6;  // "(null)"\r
-                               }\r
-                               else\r
-                               {\r
-                                       nItemLen = (int)wcslen(pstrNextArg);\r
-                                       nItemLen = max(1, nItemLen);\r
-                               }\r
-#else // _UNICODE\r
-                               LPCSTR pstrNextArg = va_arg(argList, LPCSTR);\r
-                               if (pstrNextArg == NULL)\r
-                               {\r
-                                       nItemLen = 6; // "(null)"\r
-                               }\r
-                               else\r
-                               {\r
-#if defined(_WIN32_WCE) && (_ATL_VER >= 0x0800)\r
-                                       nItemLen = ATL::lstrlenA(pstrNextArg);\r
-#else\r
-                                       nItemLen = lstrlenA(pstrNextArg);\r
-#endif\r
-                                       nItemLen = max(1, nItemLen);\r
-                               }\r
-#endif // _UNICODE\r
-                               break;\r
-                       }\r
-\r
-                       case _T('s') | FORCE_ANSI:\r
-                       case _T('S') | FORCE_ANSI:\r
-                       {\r
-                               LPCSTR pstrNextArg = va_arg(argList, LPCSTR);\r
-                               if (pstrNextArg == NULL)\r
-                               {\r
-                                       nItemLen = 6; // "(null)"\r
-                               }\r
-                               else\r
-                               {\r
-#if defined(_WIN32_WCE) && (_ATL_VER >= 0x0800)\r
-                                       nItemLen = ATL::lstrlenA(pstrNextArg);\r
-#else\r
-                                       nItemLen = lstrlenA(pstrNextArg);\r
-#endif\r
-                                       nItemLen = max(1, nItemLen);\r
-                               }\r
-                               break;\r
-                       }\r
-\r
-                       case _T('s') | FORCE_UNICODE:\r
-                       case _T('S') | FORCE_UNICODE:\r
-                       {\r
-                               LPWSTR pstrNextArg = va_arg(argList, LPWSTR);\r
-                               if (pstrNextArg == NULL)\r
-                               {\r
-                                       nItemLen = 6; // "(null)"\r
-                               }\r
-                               else\r
-                               {\r
-                                       nItemLen = (int)wcslen(pstrNextArg);\r
-                                       nItemLen = max(1, nItemLen);\r
-                               }\r
-                               break;\r
-                       }\r
-                       }\r
-\r
-                       // adjust nItemLen for strings\r
-                       if (nItemLen != 0)\r
-                       {\r
-                               nItemLen = max(nItemLen, nWidth);\r
-                               if (nPrecision != 0)\r
-                                       nItemLen = min(nItemLen, nPrecision);\r
-                       }\r
-                       else\r
-                       {\r
-                               switch (*lpsz)\r
-                               {\r
-                               // integers\r
-                               case _T('d'):\r
-                               case _T('i'):\r
-                               case _T('u'):\r
-                               case _T('x'):\r
-                               case _T('X'):\r
-                               case _T('o'):\r
-                                       if (nModifier & FORCE_INT64)\r
-                                               va_arg(argList, __int64);\r
-                                       else\r
-                                               va_arg(argList, int);\r
-                                       nItemLen = 32;\r
-                                       nItemLen = max(nItemLen, nWidth + nPrecision);\r
-                                       break;\r
-\r
-#ifndef _ATL_USE_CSTRING_FLOAT\r
-                               case _T('e'):\r
-                               case _T('E'):\r
-                               case _T('f'):\r
-                               case _T('g'):\r
-                               case _T('G'):\r
-                                       ATLASSERT(!"Floating point (%%e, %%E, %%f, %%g, and %%G) is not supported by the WTL::CString class.");\r
-#ifndef _DEBUG\r
-                                       ::OutputDebugString(_T("Floating point (%%e, %%f, %%g, and %%G) is not supported by the WTL::CString class."));\r
-#ifndef _WIN32_WCE\r
-                                       ::DebugBreak();\r
-#else // CE specific\r
-                                       DebugBreak();\r
-#endif // _WIN32_WCE\r
-#endif // !_DEBUG\r
-                                       break;\r
-#else // _ATL_USE_CSTRING_FLOAT\r
-                               case _T('e'):\r
-                               case _T('E'):\r
-                               case _T('g'):\r
-                               case _T('G'):\r
-                                       va_arg(argList, double);\r
-                                       nItemLen = 128;\r
-                                       nItemLen = max(nItemLen, nWidth + nPrecision);\r
-                                       break;\r
-                               case _T('f'):\r
-                                       {\r
-                                               double f = va_arg(argList, double);\r
-                                               // 312 == strlen("-1+(309 zeroes).")\r
-                                               // 309 zeroes == max precision of a double\r
-                                               // 6 == adjustment in case precision is not specified,\r
-                                               //   which means that the precision defaults to 6\r
-                                               int cchLen = max(nWidth, 312 + nPrecision + 6);\r
-                                               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-                                               LPTSTR pszTemp = buff.Allocate(cchLen);\r
-                                               if(pszTemp != NULL)\r
-                                               {\r
-                                                       SecureHelper::sprintf_x(pszTemp, cchLen, _T("%*.*f"), nWidth, nPrecision + 6, f);\r
-                                                       nItemLen = (int)_tcslen(pszTemp);\r
-                                               }\r
-                                               else\r
-                                               {\r
-                                                       nItemLen = cchLen;\r
-                                               }\r
-                                       }\r
-                                       break;\r
-#endif // _ATL_USE_CSTRING_FLOAT\r
-\r
-                               case _T('p'):\r
-                                       va_arg(argList, void*);\r
-                                       nItemLen = 32;\r
-                                       nItemLen = max(nItemLen, nWidth + nPrecision);\r
-                                       break;\r
-\r
-                               // no output\r
-                               case _T('n'):\r
-                                       va_arg(argList, int*);\r
-                                       break;\r
-\r
-                               default:\r
-                                       ATLASSERT(FALSE);  // unknown formatting option\r
-                               }\r
-                       }\r
-\r
-                       // adjust nMaxLen for output nItemLen\r
-                       nMaxLen += nItemLen;\r
-               }\r
-\r
-               if(GetBuffer(nMaxLen) == NULL)\r
-                       return FALSE;\r
-#ifndef _ATL_USE_CSTRING_FLOAT\r
-               int nRet = SecureHelper::wvsprintf_x(m_pchData, GetAllocLength() + 1, lpszFormat, argListSave);\r
-#else // _ATL_USE_CSTRING_FLOAT\r
-               int nRet = SecureHelper::vsprintf_x(m_pchData, GetAllocLength() + 1, lpszFormat, argListSave);\r
-#endif // _ATL_USE_CSTRING_FLOAT\r
-               nRet;   // ref\r
-               ATLASSERT(nRet <= GetAllocLength());\r
-               ReleaseBuffer();\r
-\r
-               va_end(argListSave);\r
-               return TRUE;\r
-       }\r
-\r
-       // formatting for localization (uses FormatMessage API)\r
-       // formatting (using FormatMessage style formatting)\r
-       BOOL __cdecl FormatMessage(LPCTSTR lpszFormat, ...)\r
-       {\r
-               // format message into temporary buffer lpszTemp\r
-               va_list argList;\r
-               va_start(argList, lpszFormat);\r
-               LPTSTR lpszTemp;\r
-               BOOL bRet = TRUE;\r
-\r
-               if (::FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER,\r
-                               lpszFormat, 0, 0, (LPTSTR)&lpszTemp, 0, &argList) == 0 || lpszTemp == NULL)\r
-                       bRet = FALSE;\r
-\r
-               // assign lpszTemp into the resulting string and free the temporary\r
-               *this = lpszTemp;\r
-               LocalFree(lpszTemp);\r
-               va_end(argList);\r
-               return bRet;\r
-       }\r
-\r
-       BOOL __cdecl FormatMessage(UINT nFormatID, ...)\r
-       {\r
-               // get format string from string table\r
-               CString strFormat;\r
-               BOOL bRetTmp = strFormat.LoadString(nFormatID);\r
-               bRetTmp;   // ref\r
-               ATLASSERT(bRetTmp != 0);\r
-\r
-               // format message into temporary buffer lpszTemp\r
-               va_list argList;\r
-               va_start(argList, nFormatID);\r
-               LPTSTR lpszTemp;\r
-               BOOL bRet = TRUE;\r
-\r
-               if (::FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER,\r
-                               strFormat, 0, 0, (LPTSTR)&lpszTemp, 0, &argList) == 0 || lpszTemp == NULL)\r
-                       bRet = FALSE;\r
-\r
-               // assign lpszTemp into the resulting string and free lpszTemp\r
-               *this = lpszTemp;\r
-               LocalFree(lpszTemp);\r
-               va_end(argList);\r
-               return bRet;\r
-       }\r
-\r
-       // Windows support\r
-       BOOL LoadString(UINT nID)   // load from string resource (255 chars max.)\r
-       {\r
-#ifdef _UNICODE\r
-               const int CHAR_FUDGE = 1;   // one TCHAR unused is good enough\r
-#else\r
-               const int CHAR_FUDGE = 2;   // two BYTES unused for case of DBC last char\r
-#endif\r
-\r
-               // try fixed buffer first (to avoid wasting space in the heap)\r
-               TCHAR szTemp[256];\r
-               int nCount =  sizeof(szTemp) / sizeof(szTemp[0]);\r
-               int nLen = _LoadString(nID, szTemp, nCount);\r
-               if (nCount - nLen > CHAR_FUDGE)\r
-               {\r
-                       *this = szTemp;\r
-                       return (nLen > 0);\r
-               }\r
-\r
-               // try buffer size of 512, then larger size until entire string is retrieved\r
-               int nSize = 256;\r
-               do\r
-               {\r
-                       nSize += 256;\r
-                       LPTSTR lpstr = GetBuffer(nSize - 1);\r
-                       if(lpstr == NULL)\r
-                       {\r
-                               nLen = 0;\r
-                               break;\r
-                       }\r
-                       nLen = _LoadString(nID, lpstr, nSize);\r
-               } while (nSize - nLen <= CHAR_FUDGE);\r
-               ReleaseBuffer();\r
-\r
-               return (nLen > 0);\r
-       }\r
-\r
-#ifndef _UNICODE\r
-       // ANSI <-> OEM support (convert string in place)\r
-       void AnsiToOem()\r
-       {\r
-               CopyBeforeWrite();\r
-               ::AnsiToOem(m_pchData, m_pchData);\r
-       }\r
-\r
-       void OemToAnsi()\r
-       {\r
-               CopyBeforeWrite();\r
-               ::OemToAnsi(m_pchData, m_pchData);\r
-       }\r
-#endif\r
-\r
-#ifndef _ATL_NO_COM\r
-       // OLE BSTR support (use for OLE automation)\r
-       BSTR AllocSysString() const\r
-       {\r
-#if defined(_UNICODE) || defined(OLE2ANSI)\r
-               BSTR bstr = ::SysAllocStringLen(m_pchData, GetData()->nDataLength);\r
-#else\r
-               int nLen = MultiByteToWideChar(CP_ACP, 0, m_pchData,\r
-                       GetData()->nDataLength, NULL, NULL);\r
-               BSTR bstr = ::SysAllocStringLen(NULL, nLen);\r
-               if(bstr != NULL)\r
-                       MultiByteToWideChar(CP_ACP, 0, m_pchData, GetData()->nDataLength, bstr, nLen);\r
-#endif\r
-               return bstr;\r
-       }\r
-\r
-       BSTR SetSysString(BSTR* pbstr) const\r
-       {\r
-#if defined(_UNICODE) || defined(OLE2ANSI)\r
-               ::SysReAllocStringLen(pbstr, m_pchData, GetData()->nDataLength);\r
-#else\r
-               int nLen = MultiByteToWideChar(CP_ACP, 0, m_pchData,\r
-                       GetData()->nDataLength, NULL, NULL);\r
-               if(::SysReAllocStringLen(pbstr, NULL, nLen))\r
-                       MultiByteToWideChar(CP_ACP, 0, m_pchData, GetData()->nDataLength, *pbstr, nLen);\r
-#endif\r
-               ATLASSERT(*pbstr != NULL);\r
-               return *pbstr;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-\r
-       // Access to string implementation buffer as "C" character array\r
-       LPTSTR GetBuffer(int nMinBufLength)\r
-       {\r
-               ATLASSERT(nMinBufLength >= 0);\r
-\r
-               if (GetData()->nRefs > 1 || nMinBufLength > GetData()->nAllocLength)\r
-               {\r
-                       // we have to grow the buffer\r
-                       CStringData* pOldData = GetData();\r
-                       int nOldLen = GetData()->nDataLength;   // AllocBuffer will tromp it\r
-                       if (nMinBufLength < nOldLen)\r
-                               nMinBufLength = nOldLen;\r
-\r
-                       if(!AllocBuffer(nMinBufLength))\r
-                               return NULL;\r
-\r
-                       SecureHelper::memcpy_x(m_pchData, (nMinBufLength + 1) * sizeof(TCHAR), pOldData->data(), (nOldLen + 1) * sizeof(TCHAR));\r
-                       GetData()->nDataLength = nOldLen;\r
-                       CString::Release(pOldData);\r
-               }\r
-               ATLASSERT(GetData()->nRefs <= 1);\r
-\r
-               // return a pointer to the character storage for this string\r
-               ATLASSERT(m_pchData != NULL);\r
-               return m_pchData;\r
-       }\r
-\r
-       void ReleaseBuffer(int nNewLength = -1)\r
-       {\r
-               CopyBeforeWrite();   // just in case GetBuffer was not called\r
-\r
-               if (nNewLength == -1)\r
-                       nNewLength = lstrlen(m_pchData);   // zero terminated\r
-\r
-               ATLASSERT(nNewLength <= GetData()->nAllocLength);\r
-               GetData()->nDataLength = nNewLength;\r
-               m_pchData[nNewLength] = _T('\0');\r
-       }\r
-\r
-       LPTSTR GetBufferSetLength(int nNewLength)\r
-       {\r
-               ATLASSERT(nNewLength >= 0);\r
-\r
-               if(GetBuffer(nNewLength) == NULL)\r
-                       return NULL;\r
-\r
-               GetData()->nDataLength = nNewLength;\r
-               m_pchData[nNewLength] = _T('\0');\r
-               return m_pchData;\r
-       }\r
-\r
-       void FreeExtra()\r
-       {\r
-               ATLASSERT(GetData()->nDataLength <= GetData()->nAllocLength);\r
-               if (GetData()->nDataLength != GetData()->nAllocLength)\r
-               {\r
-                       CStringData* pOldData = GetData();\r
-                       if(AllocBuffer(GetData()->nDataLength))\r
-                       {\r
-                               SecureHelper::memcpy_x(m_pchData, (GetData()->nAllocLength + 1) * sizeof(TCHAR), pOldData->data(), pOldData->nDataLength * sizeof(TCHAR));\r
-                               ATLASSERT(m_pchData[GetData()->nDataLength] == _T('\0'));\r
-                               CString::Release(pOldData);\r
-                       }\r
-               }\r
-               ATLASSERT(GetData() != NULL);\r
-       }\r
-\r
-       // Use LockBuffer/UnlockBuffer to turn refcounting off\r
-       LPTSTR LockBuffer()\r
-       {\r
-               LPTSTR lpsz = GetBuffer(0);\r
-               if(lpsz != NULL)\r
-                       GetData()->nRefs = -1;\r
-               return lpsz;\r
-       }\r
-\r
-       void UnlockBuffer()\r
-       {\r
-               ATLASSERT(GetData()->nRefs == -1);\r
-               if (GetData() != _atltmpDataNil)\r
-                       GetData()->nRefs = 1;\r
-       }\r
-\r
-// Implementation\r
-public:\r
-       ~CString()   //  free any attached data\r
-       {\r
-               if (GetData() != _atltmpDataNil)\r
-               {\r
-                       if (InterlockedDecrement(&GetData()->nRefs) <= 0)\r
-                               delete[] (BYTE*)GetData();\r
-               }\r
-       }\r
-\r
-       int GetAllocLength() const\r
-       {\r
-               return GetData()->nAllocLength;\r
-       }\r
-\r
-       static BOOL __stdcall _IsValidString(LPCTSTR lpsz, int /*nLength*/ = -1)\r
-       {\r
-               return (lpsz != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-protected:\r
-       LPTSTR m_pchData;   // pointer to ref counted string data\r
-\r
-       // implementation helpers\r
-       CStringData* GetData() const\r
-       {\r
-               ATLASSERT(m_pchData != NULL);\r
-               return ((CStringData*)m_pchData) - 1;\r
-       }\r
-\r
-       void Init()\r
-       {\r
-               m_pchData = _GetEmptyString().m_pchData;\r
-       }\r
-\r
-       BOOL AllocCopy(CString& dest, int nCopyLen, int nCopyIndex, int nExtraLen) const\r
-       {\r
-               // will clone the data attached to this string\r
-               // allocating 'nExtraLen' characters\r
-               // Places results in uninitialized string 'dest'\r
-               // Will copy the part or all of original data to start of new string\r
-\r
-               BOOL bRet = FALSE;\r
-               int nNewLen = nCopyLen + nExtraLen;\r
-               if (nNewLen == 0)\r
-               {\r
-                       dest.Init();\r
-                       bRet = TRUE;\r
-               }\r
-               else if(nNewLen >= nCopyLen)\r
-               {\r
-                       if(dest.AllocBuffer(nNewLen))\r
-                       {\r
-                               SecureHelper::memcpy_x(dest.m_pchData, (nNewLen + 1) * sizeof(TCHAR), m_pchData + nCopyIndex, nCopyLen * sizeof(TCHAR));\r
-                               bRet = TRUE;\r
-                       }\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-       // always allocate one extra character for '\0' termination\r
-       // assumes [optimistically] that data length will equal allocation length\r
-       BOOL AllocBuffer(int nLen)\r
-       {\r
-               ATLASSERT(nLen >= 0);\r
-               ATLASSERT(nLen <= INT_MAX - 1);   // max size (enough room for 1 extra)\r
-\r
-               if (nLen == 0)\r
-               {\r
-                       Init();\r
-               }\r
-               else\r
-               {\r
-                       CStringData* pData = NULL;\r
-                       ATLTRY(pData = (CStringData*)new BYTE[sizeof(CStringData) + (nLen + 1) * sizeof(TCHAR)]);\r
-                       if(pData == NULL)\r
-                               return FALSE;\r
-\r
-                       pData->nRefs = 1;\r
-                       pData->data()[nLen] = _T('\0');\r
-                       pData->nDataLength = nLen;\r
-                       pData->nAllocLength = nLen;\r
-                       m_pchData = pData->data();\r
-               }\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       // Assignment operators\r
-       //  All assign a new value to the string\r
-       //      (a) first see if the buffer is big enough\r
-       //      (b) if enough room, copy on top of old buffer, set size and type\r
-       //      (c) otherwise free old string data, and create a new one\r
-       //\r
-       //  All routines return the new string (but as a 'const CString&' so that\r
-       //      assigning it again will cause a copy, eg: s1 = s2 = "hi there".\r
-       //\r
-       void AssignCopy(int nSrcLen, LPCTSTR lpszSrcData)\r
-       {\r
-               if(AllocBeforeWrite(nSrcLen))\r
-               {\r
-                       SecureHelper::memcpy_x(m_pchData, (nSrcLen + 1) * sizeof(TCHAR), lpszSrcData, nSrcLen * sizeof(TCHAR));\r
-                       GetData()->nDataLength = nSrcLen;\r
-                       m_pchData[nSrcLen] = _T('\0');\r
-               }\r
-       }\r
-\r
-       // Concatenation\r
-       // NOTE: "operator +" is done as friend functions for simplicity\r
-       //      There are three variants:\r
-       //          CString + CString\r
-       // and for ? = TCHAR, LPCTSTR\r
-       //          CString + ?\r
-       //          ? + CString\r
-       BOOL ConcatCopy(int nSrc1Len, LPCTSTR lpszSrc1Data, int nSrc2Len, LPCTSTR lpszSrc2Data)\r
-       {\r
-               // -- master concatenation routine\r
-               // Concatenate two sources\r
-               // -- assume that 'this' is a new CString object\r
-\r
-               BOOL bRet = TRUE;\r
-               int nNewLen = nSrc1Len + nSrc2Len;\r
-               if(nNewLen < nSrc1Len || nNewLen < nSrc2Len)\r
-               {\r
-                       bRet = FALSE;\r
-               }\r
-               else if(nNewLen != 0)\r
-               {\r
-                       bRet = AllocBuffer(nNewLen);\r
-                       if (bRet)\r
-                       {\r
-                               SecureHelper::memcpy_x(m_pchData, (nNewLen + 1) * sizeof(TCHAR), lpszSrc1Data, nSrc1Len * sizeof(TCHAR));\r
-                               SecureHelper::memcpy_x(m_pchData + nSrc1Len, (nNewLen + 1 - nSrc1Len) * sizeof(TCHAR), lpszSrc2Data, nSrc2Len * sizeof(TCHAR));\r
-                       }\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       void ConcatInPlace(int nSrcLen, LPCTSTR lpszSrcData)\r
-       {\r
-               //  -- the main routine for += operators\r
-\r
-               // concatenating an empty string is a no-op!\r
-               if (nSrcLen == 0)\r
-                       return;\r
-\r
-               // if the buffer is too small, or we have a width mis-match, just\r
-               //   allocate a new buffer (slow but sure)\r
-               if (GetData()->nRefs > 1 || GetData()->nDataLength + nSrcLen > GetData()->nAllocLength)\r
-               {\r
-                       // we have to grow the buffer, use the ConcatCopy routine\r
-                       CStringData* pOldData = GetData();\r
-                       if (ConcatCopy(GetData()->nDataLength, m_pchData, nSrcLen, lpszSrcData))\r
-                       {\r
-                               ATLASSERT(pOldData != NULL);\r
-                               CString::Release(pOldData);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       // fast concatenation when buffer big enough\r
-                       SecureHelper::memcpy_x(m_pchData + GetData()->nDataLength, (GetData()->nAllocLength + 1) * sizeof(TCHAR), lpszSrcData, nSrcLen * sizeof(TCHAR));\r
-                       GetData()->nDataLength += nSrcLen;\r
-                       ATLASSERT(GetData()->nDataLength <= GetData()->nAllocLength);\r
-                       m_pchData[GetData()->nDataLength] = _T('\0');\r
-               }\r
-       }\r
-\r
-       void CopyBeforeWrite()\r
-       {\r
-               if (GetData()->nRefs > 1)\r
-               {\r
-                       CStringData* pData = GetData();\r
-                       Release();\r
-                       if(AllocBuffer(pData->nDataLength))\r
-                               SecureHelper::memcpy_x(m_pchData, (GetData()->nAllocLength + 1) * sizeof(TCHAR), pData->data(), (pData->nDataLength + 1) * sizeof(TCHAR));\r
-               }\r
-               ATLASSERT(GetData()->nRefs <= 1);\r
-       }\r
-\r
-       BOOL AllocBeforeWrite(int nLen)\r
-       {\r
-               BOOL bRet = TRUE;\r
-               if (GetData()->nRefs > 1 || nLen > GetData()->nAllocLength)\r
-               {\r
-                       Release();\r
-                       bRet = AllocBuffer(nLen);\r
-               }\r
-               ATLASSERT(GetData()->nRefs <= 1);\r
-               return bRet;\r
-       }\r
-\r
-       void Release()\r
-       {\r
-               if (GetData() != _atltmpDataNil)\r
-               {\r
-                       ATLASSERT(GetData()->nRefs != 0);\r
-                       if (InterlockedDecrement(&GetData()->nRefs) <= 0)\r
-                               delete[] (BYTE*)GetData();\r
-                       Init();\r
-               }\r
-       }\r
-\r
-       static void PASCAL Release(CStringData* pData)\r
-       {\r
-               if (pData != _atltmpDataNil)\r
-               {\r
-                       ATLASSERT(pData->nRefs != 0);\r
-                       if (InterlockedDecrement(&pData->nRefs) <= 0)\r
-                               delete[] (BYTE*)pData;\r
-               }\r
-       }\r
-\r
-       static int PASCAL SafeStrlen(LPCTSTR lpsz)\r
-       {\r
-               return (lpsz == NULL) ? 0 : lstrlen(lpsz);\r
-       }\r
-\r
-       static int __stdcall _LoadString(UINT nID, LPTSTR lpszBuf, UINT nMaxBuf)\r
-       {\r
-#ifdef _DEBUG\r
-               // LoadString without annoying warning from the Debug kernel if the\r
-               //  segment containing the string is not present\r
-               if (::FindResource(ModuleHelper::GetResourceInstance(), MAKEINTRESOURCE((nID >> 4) + 1), RT_STRING) == NULL)\r
-               {\r
-                       lpszBuf[0] = _T('\0');\r
-                       return 0;   // not found\r
-               }\r
-#endif // _DEBUG\r
-\r
-               int nLen = ::LoadString(ModuleHelper::GetResourceInstance(), nID, lpszBuf, nMaxBuf);\r
-               if (nLen == 0)\r
-                       lpszBuf[0] = _T('\0');\r
-\r
-               return nLen;\r
-       }\r
-\r
-       static const CString& __stdcall _GetEmptyString()\r
-       {\r
-               return *(CString*)&_atltmpPchNil;\r
-       }\r
-\r
-// CString conversion helpers\r
-       static int __cdecl _wcstombsz(char* mbstr, const wchar_t* wcstr, size_t count)\r
-       {\r
-               if (count == 0 && mbstr != NULL)\r
-                       return 0;\r
-\r
-               int result = ::WideCharToMultiByte(CP_ACP, 0, wcstr, -1, mbstr, (int)count, NULL, NULL);\r
-               ATLASSERT(mbstr == NULL || result <= (int)count);\r
-               if (result > 0)\r
-                       mbstr[result - 1] = 0;\r
-               return result;\r
-       }\r
-\r
-       static int __cdecl _mbstowcsz(wchar_t* wcstr, const char* mbstr, size_t count)\r
-       {\r
-               if (count == 0 && wcstr != NULL)\r
-                       return 0;\r
-\r
-               int result = ::MultiByteToWideChar(CP_ACP, 0, mbstr, -1, wcstr, (int)count);\r
-               ATLASSERT(wcstr == NULL || result <= (int)count);\r
-               if (result > 0)\r
-                       wcstr[result - 1] = 0;\r
-               return result;\r
-       }\r
-\r
-// Helpers to avoid CRT startup code\r
-#ifdef _ATL_MIN_CRT\r
-       static const TCHAR* _cstrchr(const TCHAR* p, TCHAR ch)\r
-       {\r
-               // strchr for '\0' should succeed\r
-               while (*p != 0)\r
-               {\r
-                       if (*p == ch)\r
-                               break;\r
-                       p = ::CharNext(p);\r
-               }\r
-               return (*p == ch) ? p : NULL;\r
-       }\r
-\r
-       static const TCHAR* _cstrrchr(const TCHAR* p, TCHAR ch)\r
-       {\r
-               const TCHAR* lpsz = NULL;\r
-               while (*p != 0)\r
-               {\r
-                       if (*p == ch)\r
-                               lpsz = p;\r
-                       p = ::CharNext(p);\r
-               }\r
-               return lpsz;\r
-       }\r
-\r
-       static TCHAR* _cstrrev(TCHAR* pStr)\r
-       {\r
-               // optimize NULL, zero-length, and single-char case\r
-               if ((pStr == NULL) || (pStr[0] == _T('\0')) || (pStr[1] == _T('\0')))\r
-                       return pStr;\r
-\r
-               TCHAR* p = pStr;\r
-\r
-               while (*p != 0) \r
-               {\r
-                       TCHAR* pNext = ::CharNext(p);\r
-                       if(pNext > p + 1)\r
-                       {\r
-                               char p1 = *(char*)p;\r
-                               *(char*)p = *(char*)(p + 1);\r
-                               *(char*)(p + 1) = p1;\r
-                       }\r
-                       p = pNext;\r
-               }\r
-\r
-               p--;\r
-               TCHAR* q = pStr;\r
-\r
-               while (q < p)\r
-               {\r
-                       TCHAR t = *q;\r
-                       *q = *p;\r
-                       *p = t;\r
-                       q++;\r
-                       p--;\r
-               }\r
-               return pStr;\r
-       }\r
-\r
-       static const TCHAR* _cstrstr(const TCHAR* pStr, const TCHAR* pCharSet)\r
-       {\r
-               int nLen = lstrlen(pCharSet);\r
-               if (nLen == 0)\r
-                       return (TCHAR*)pStr;\r
-\r
-               const TCHAR* pRet = NULL;\r
-               const TCHAR* pCur = pStr;\r
-               while((pCur = _cstrchr(pCur, *pCharSet)) != NULL)\r
-               {\r
-                       if(memcmp(pCur, pCharSet, nLen * sizeof(TCHAR)) == 0)\r
-                       {\r
-                               pRet = pCur;\r
-                               break;\r
-                       }\r
-                       pCur = ::CharNext(pCur);\r
-               }\r
-               return pRet;\r
-       }\r
-\r
-       static int _cstrspn(const TCHAR* pStr, const TCHAR* pCharSet)\r
-       {\r
-               int nRet = 0;\r
-               const TCHAR* p = pStr;\r
-               while (*p != 0)\r
-               {\r
-                       const TCHAR* pNext = ::CharNext(p);\r
-                       if(pNext > p + 1)\r
-                       {\r
-                               if(_cstrchr_db(pCharSet, *p, *(p + 1)) == NULL)\r
-                                       break;\r
-                               nRet += 2;\r
-                       }\r
-                       else\r
-                       {\r
-                               if(_cstrchr(pCharSet, *p) == NULL)\r
-                                       break;\r
-                               nRet++;\r
-                       }\r
-                       p = pNext;\r
-               }\r
-               return nRet;\r
-       }\r
-\r
-       static int _cstrcspn(const TCHAR* pStr, const TCHAR* pCharSet)\r
-       {\r
-               int nRet = 0;\r
-               TCHAR* p = (TCHAR*)pStr;\r
-               while (*p != 0)\r
-               {\r
-                       TCHAR* pNext = ::CharNext(p);\r
-                       if(pNext > p + 1)\r
-                       {\r
-                               if(_cstrchr_db(pCharSet, *p, *(p + 1)) != NULL)\r
-                                       break;\r
-                               nRet += 2;\r
-                       }\r
-                       else\r
-                       {\r
-                               if(_cstrchr(pCharSet, *p) != NULL)\r
-                                       break;\r
-                               nRet++;\r
-                       }\r
-                       p = pNext;\r
-               }\r
-               return nRet;\r
-       }\r
-\r
-       static const TCHAR* _cstrpbrk(const TCHAR* p, const TCHAR* lpszCharSet)\r
-       {\r
-               int n = _cstrcspn(p, lpszCharSet);\r
-               return (p[n] != 0) ? &p[n] : NULL;\r
-       }\r
-\r
-       static int _cstrisdigit(TCHAR ch)\r
-       {\r
-               WORD type;\r
-               GetStringTypeEx(GetThreadLocale(), CT_CTYPE1, &ch, 1, &type);\r
-               return (type & C1_DIGIT) == C1_DIGIT;\r
-       }\r
-\r
-       static int _cstrisspace(TCHAR ch)\r
-       {\r
-               WORD type;\r
-               GetStringTypeEx(GetThreadLocale(), CT_CTYPE1, &ch, 1, &type);\r
-               return (type & C1_SPACE) == C1_SPACE;\r
-       }\r
-\r
-       static int _cstrcmp(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               return lstrcmp(pstrOne, pstrOther);\r
-       }\r
-\r
-       static int _cstrcmpi(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               return lstrcmpi(pstrOne, pstrOther);\r
-       }\r
-\r
-       static int _cstrcoll(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               int nRet = CompareString(GetThreadLocale(), 0, pstrOne, -1, pstrOther, -1);\r
-               ATLASSERT(nRet != 0);\r
-               return nRet - 2;   // convert to strcmp convention\r
-       }\r
-\r
-       static int _cstrcolli(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               int nRet = CompareString(GetThreadLocale(), NORM_IGNORECASE, pstrOne, -1, pstrOther, -1);\r
-               ATLASSERT(nRet != 0);\r
-               return nRet - 2;   // convert to strcmp convention\r
-       }\r
-\r
-       static int _cstrtoi(const TCHAR* nptr)\r
-       {\r
-               int c;       // current char\r
-               int total;   // current total\r
-               int sign;    // if '-', then negative, otherwise positive\r
-\r
-               while (_cstrisspace(*nptr))\r
-                       ++nptr;\r
-\r
-               c = (int)(_TUCHAR)*nptr++;\r
-               sign = c;   // save sign indication\r
-               if (c == _T('-') || c == _T('+'))\r
-                       c = (int)(_TUCHAR)*nptr++;   // skip sign\r
-\r
-               total = 0;\r
-\r
-               while (_cstrisdigit((TCHAR)c))\r
-               {\r
-                       total = 10 * total + (c - '0');   // accumulate digit\r
-                       c = (int)(_TUCHAR)*nptr++;        // get next char\r
-               }\r
-\r
-               if (sign == '-')\r
-                       return -total;\r
-               else\r
-                       return total;   // return result, negated if necessary\r
-       }\r
-#else // !_ATL_MIN_CRT\r
-       static const TCHAR* _cstrchr(const TCHAR* p, TCHAR ch)\r
-       {\r
-               return _tcschr(p, ch);\r
-       }\r
-\r
-       static const TCHAR* _cstrrchr(const TCHAR* p, TCHAR ch)\r
-       {\r
-               return _tcsrchr(p, ch);\r
-       }\r
-\r
-       static TCHAR* _cstrrev(TCHAR* pStr)\r
-       {\r
-               return _tcsrev(pStr);\r
-       }\r
-\r
-       static const TCHAR* _cstrstr(const TCHAR* pStr, const TCHAR* pCharSet)\r
-       {\r
-               return _tcsstr(pStr, pCharSet);\r
-       }\r
-\r
-       static int _cstrspn(const TCHAR* pStr, const TCHAR* pCharSet)\r
-       {\r
-               return (int)_tcsspn(pStr, pCharSet);\r
-       }\r
-\r
-       static int _cstrcspn(const TCHAR* pStr, const TCHAR* pCharSet)\r
-       {\r
-               return (int)_tcscspn(pStr, pCharSet);\r
-       }\r
-\r
-       static const TCHAR* _cstrpbrk(const TCHAR* p, const TCHAR* lpszCharSet)\r
-       {\r
-               return _tcspbrk(p, lpszCharSet);\r
-       }\r
-\r
-       static int _cstrisdigit(TCHAR ch)\r
-       {\r
-               return _istdigit(ch);\r
-       }\r
-\r
-       static int _cstrisspace(TCHAR ch)\r
-       {\r
-               return _istspace((_TUCHAR)ch);\r
-       }\r
-\r
-       static int _cstrcmp(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               return _tcscmp(pstrOne, pstrOther);\r
-       }\r
-\r
-       static int _cstrcmpi(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               return _tcsicmp(pstrOne, pstrOther);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       static int _cstrcoll(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               return _tcscoll(pstrOne, pstrOther);\r
-       }\r
-\r
-       static int _cstrcolli(const TCHAR* pstrOne, const TCHAR* pstrOther)\r
-       {\r
-               return _tcsicoll(pstrOne, pstrOther);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       static int _cstrtoi(const TCHAR* nptr)\r
-       {\r
-               return _ttoi(nptr);\r
-       }\r
-#endif // !_ATL_MIN_CRT\r
-\r
-       static const TCHAR* _cstrchr_db(const TCHAR* p, TCHAR ch1, TCHAR ch2)\r
-       {\r
-               const TCHAR* lpsz = NULL;\r
-               while (*p != 0)\r
-               {\r
-                       if (*p == ch1 && *(p + 1) == ch2)\r
-                       {\r
-                               lpsz = p;\r
-                               break;\r
-                       }\r
-                       p = ::CharNext(p);\r
-               }\r
-               return lpsz;\r
-       }\r
-};\r
-\r
-\r
-// Compare helpers\r
-\r
-inline bool __stdcall operator ==(const CString& s1, const CString& s2)\r
-{ return s1.Compare(s2) == 0; }\r
-\r
-inline bool __stdcall operator ==(const CString& s1, LPCTSTR s2)\r
-{ return s1.Compare(s2) == 0; }\r
-\r
-inline bool __stdcall operator ==(LPCTSTR s1, const CString& s2)\r
-{ return s2.Compare(s1) == 0; }\r
-\r
-inline bool __stdcall operator !=(const CString& s1, const CString& s2)\r
-{ return s1.Compare(s2) != 0; }\r
-\r
-inline bool __stdcall operator !=(const CString& s1, LPCTSTR s2)\r
-{ return s1.Compare(s2) != 0; }\r
-\r
-inline bool __stdcall operator !=(LPCTSTR s1, const CString& s2)\r
-{ return s2.Compare(s1) != 0; }\r
-\r
-inline bool __stdcall operator <(const CString& s1, const CString& s2)\r
-{ return s1.Compare(s2) < 0; }\r
-\r
-inline bool __stdcall operator <(const CString& s1, LPCTSTR s2)\r
-{ return s1.Compare(s2) < 0; }\r
-\r
-inline bool __stdcall operator <(LPCTSTR s1, const CString& s2)\r
-{ return s2.Compare(s1) > 0; }\r
-\r
-inline bool __stdcall operator >(const CString& s1, const CString& s2)\r
-{ return s1.Compare(s2) > 0; }\r
-\r
-inline bool __stdcall operator >(const CString& s1, LPCTSTR s2)\r
-{ return s1.Compare(s2) > 0; }\r
-\r
-inline bool __stdcall operator >(LPCTSTR s1, const CString& s2)\r
-{ return s2.Compare(s1) < 0; }\r
-\r
-inline bool __stdcall operator <=(const CString& s1, const CString& s2)\r
-{ return s1.Compare(s2) <= 0; }\r
-\r
-inline bool __stdcall operator <=(const CString& s1, LPCTSTR s2)\r
-{ return s1.Compare(s2) <= 0; }\r
-\r
-inline bool __stdcall operator <=(LPCTSTR s1, const CString& s2)\r
-{ return s2.Compare(s1) >= 0; }\r
-\r
-inline bool __stdcall operator >=(const CString& s1, const CString& s2)\r
-{ return s1.Compare(s2) >= 0; }\r
-\r
-inline bool __stdcall operator >=(const CString& s1, LPCTSTR s2)\r
-{ return s1.Compare(s2) >= 0; }\r
-\r
-inline bool __stdcall operator >=(LPCTSTR s1, const CString& s2)\r
-{ return s2.Compare(s1) <= 0; }\r
-\r
-\r
-// CString "operator +" functions\r
-\r
-inline CString __stdcall operator +(const CString& string1, const CString& string2)\r
-{\r
-       CString s;\r
-       s.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData, string2.GetData()->nDataLength, string2.m_pchData);\r
-       return s;\r
-}\r
-\r
-inline CString __stdcall operator +(const CString& string, TCHAR ch)\r
-{\r
-       CString s;\r
-       s.ConcatCopy(string.GetData()->nDataLength, string.m_pchData, 1, &ch);\r
-       return s;\r
-}\r
-\r
-inline CString __stdcall operator +(TCHAR ch, const CString& string)\r
-{\r
-       CString s;\r
-       s.ConcatCopy(1, &ch, string.GetData()->nDataLength, string.m_pchData);\r
-       return s;\r
-}\r
-\r
-#ifdef _UNICODE\r
-inline CString __stdcall operator +(const CString& string, char ch)\r
-{\r
-       return string + (TCHAR)ch;\r
-}\r
-\r
-inline CString __stdcall operator +(char ch, const CString& string)\r
-{\r
-       return (TCHAR)ch + string;\r
-}\r
-#endif // _UNICODE\r
-\r
-inline CString __stdcall operator +(const CString& string, LPCTSTR lpsz)\r
-{\r
-       ATLASSERT(lpsz == NULL || CString::_IsValidString(lpsz));\r
-       CString s;\r
-       s.ConcatCopy(string.GetData()->nDataLength, string.m_pchData, CString::SafeStrlen(lpsz), lpsz);\r
-       return s;\r
-}\r
-\r
-inline CString __stdcall operator +(LPCTSTR lpsz, const CString& string)\r
-{\r
-       ATLASSERT(lpsz == NULL || CString::_IsValidString(lpsz));\r
-       CString s;\r
-       s.ConcatCopy(CString::SafeStrlen(lpsz), lpsz, string.GetData()->nDataLength, string.m_pchData);\r
-       return s;\r
-}\r
-\r
-#endif // !_WTL_NO_CSTRING\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRecentDocumentList - MRU List Support\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-#ifndef _WTL_MRUEMPTY_TEXT\r
-  #define _WTL_MRUEMPTY_TEXT   _T("(empty)")\r
-#endif\r
-\r
-// forward declaration\r
-inline bool AtlCompactPath(LPTSTR lpstrOut, LPCTSTR lpstrIn, int cchLen);\r
-\r
-template <class T, int t_cchItemLen = MAX_PATH, int t_nFirstID = ID_FILE_MRU_FIRST, int t_nLastID = ID_FILE_MRU_LAST>\r
-class CRecentDocumentListBase\r
-{\r
-public:\r
-// Declarations\r
-       struct _DocEntry\r
-       {\r
-               TCHAR szDocName[t_cchItemLen];\r
-               bool operator ==(const _DocEntry& de) const\r
-               { return (lstrcmpi(szDocName, de.szDocName) == 0); }\r
-       };\r
-\r
-       enum\r
-       {\r
-               m_nMaxEntries_Min = 2,\r
-               m_nMaxEntries_Max = t_nLastID - t_nFirstID + 1,\r
-               m_cchMaxItemLen_Min = 6,\r
-               m_cchMaxItemLen_Max = t_cchItemLen,\r
-               m_cchItemNameLen = 11\r
-       };\r
-\r
-// Data members\r
-       ATL::CSimpleArray<_DocEntry> m_arrDocs;\r
-       int m_nMaxEntries;   // default is 4\r
-       HMENU m_hMenu;\r
-\r
-       TCHAR m_szNoEntries[t_cchItemLen];\r
-\r
-       int m_cchMaxItemLen;\r
-\r
-// Constructor\r
-       CRecentDocumentListBase() : m_hMenu(NULL), m_nMaxEntries(4), m_cchMaxItemLen(-1)\r
-       {\r
-               // These ASSERTs verify values of the template arguments\r
-               ATLASSERT(t_cchItemLen > m_cchMaxItemLen_Min);\r
-               ATLASSERT(m_nMaxEntries_Max > m_nMaxEntries_Min);\r
-       }\r
-\r
-// Attributes\r
-       HMENU GetMenuHandle() const\r
-       {\r
-               return m_hMenu;\r
-       }\r
-\r
-       void SetMenuHandle(HMENU hMenu)\r
-       {\r
-               ATLASSERT(hMenu == NULL || ::IsMenu(hMenu));\r
-               m_hMenu = hMenu;\r
-               if(m_hMenu == NULL || (::GetMenuString(m_hMenu, t_nFirstID, m_szNoEntries, t_cchItemLen, MF_BYCOMMAND) == 0))\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT;   // avoid level 4 warning\r
-                       SecureHelper::strncpy_x(m_szNoEntries, _countof(m_szNoEntries), pT->GetMRUEmptyText(), _TRUNCATE);\r
-               }\r
-       }\r
-\r
-       int GetMaxEntries() const\r
-       {\r
-               return m_nMaxEntries;\r
-       }\r
-\r
-       void SetMaxEntries(int nMaxEntries)\r
-       {\r
-               ATLASSERT(nMaxEntries >= m_nMaxEntries_Min && nMaxEntries <= m_nMaxEntries_Max);\r
-               if(nMaxEntries < m_nMaxEntries_Min)\r
-                       nMaxEntries = m_nMaxEntries_Min;\r
-               else if(nMaxEntries > m_nMaxEntries_Max)\r
-                       nMaxEntries = m_nMaxEntries_Max;\r
-               m_nMaxEntries = nMaxEntries;\r
-       }\r
-\r
-       int GetMaxItemLength() const\r
-       {\r
-               return m_cchMaxItemLen;\r
-       }\r
-\r
-       void SetMaxItemLength(int cchMaxLen)\r
-       {\r
-               ATLASSERT((cchMaxLen >= m_cchMaxItemLen_Min && cchMaxLen <= m_cchMaxItemLen_Max) || cchMaxLen == -1);\r
-               if(cchMaxLen != -1)\r
-               {\r
-                       if(cchMaxLen < m_cchMaxItemLen_Min)\r
-                               cchMaxLen = m_cchMaxItemLen_Min;\r
-                       else if(cchMaxLen > m_cchMaxItemLen_Max)\r
-                               cchMaxLen = m_cchMaxItemLen_Max;\r
-               }\r
-               m_cchMaxItemLen = cchMaxLen;\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateMenu();\r
-       }\r
-\r
-// Operations\r
-       BOOL AddToList(LPCTSTR lpstrDocName)\r
-       {\r
-               _DocEntry de;\r
-               errno_t nRet = SecureHelper::strncpy_x(de.szDocName, _countof(de.szDocName), lpstrDocName, _TRUNCATE);\r
-               if(nRet != 0 && nRet != STRUNCATE)\r
-                       return FALSE;\r
-\r
-               for(int i = 0; i < m_arrDocs.GetSize(); i++)\r
-               {\r
-                       if(lstrcmpi(m_arrDocs[i].szDocName, lpstrDocName) == 0)\r
-                       {\r
-                               m_arrDocs.RemoveAt(i);\r
-                               break;\r
-                       }\r
-               }\r
-\r
-               if(m_arrDocs.GetSize() == m_nMaxEntries)\r
-                       m_arrDocs.RemoveAt(0);\r
-\r
-               BOOL bRet = m_arrDocs.Add(de);\r
-               if(bRet)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       bRet = pT->UpdateMenu();\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       // This function is deprecated because it is not safe. \r
-       // Use the version below that accepts the buffer length.\r
-#if (_MSC_VER >= 1300)\r
-       __declspec(deprecated)\r
-#endif\r
-       BOOL GetFromList(int /*nItemID*/, LPTSTR /*lpstrDocName*/)\r
-       {\r
-               ATLASSERT(FALSE);\r
-               return FALSE;\r
-       }\r
-\r
-       BOOL GetFromList(int nItemID, LPTSTR lpstrDocName, int cchLength)\r
-       {\r
-               int nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\r
-               if(nIndex < 0 || nIndex >= m_arrDocs.GetSize())\r
-                       return FALSE;\r
-               if(lstrlen(m_arrDocs[nIndex].szDocName) >= cchLength)\r
-                       return FALSE;\r
-               SecureHelper::strcpy_x(lpstrDocName, cchLength, m_arrDocs[nIndex].szDocName);\r
-\r
-               return TRUE;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       BOOL GetFromList(int nItemID, _CSTRING_NS::CString& strDocName)\r
-       {\r
-               int nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\r
-               if(nIndex < 0 || nIndex >= m_arrDocs.GetSize())\r
-                       return FALSE;\r
-               strDocName = m_arrDocs[nIndex].szDocName;\r
-               return TRUE;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       BOOL RemoveFromList(int nItemID)\r
-       {\r
-               int nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\r
-               BOOL bRet = m_arrDocs.RemoveAt(nIndex);\r
-               if(bRet)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       bRet = pT->UpdateMenu();\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       BOOL MoveToTop(int nItemID)\r
-       {\r
-               int nIndex = m_arrDocs.GetSize() - (nItemID - t_nFirstID) - 1;\r
-               if(nIndex < 0 || nIndex >= m_arrDocs.GetSize())\r
-                       return FALSE;\r
-               _DocEntry de;\r
-               de = m_arrDocs[nIndex];\r
-               m_arrDocs.RemoveAt(nIndex);\r
-               BOOL bRet = m_arrDocs.Add(de);\r
-               if(bRet)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       bRet = pT->UpdateMenu();\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       BOOL ReadFromRegistry(LPCTSTR lpstrRegKey)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATL::CRegKey rkParent;\r
-               ATL::CRegKey rk;\r
-\r
-               LONG lRet = rkParent.Open(HKEY_CURRENT_USER, lpstrRegKey);\r
-               if(lRet != ERROR_SUCCESS)\r
-                       return FALSE;\r
-               lRet = rk.Open(rkParent, pT->GetRegKeyName());\r
-               if(lRet != ERROR_SUCCESS)\r
-                       return FALSE;\r
-\r
-               DWORD dwRet = 0;\r
-#if (_ATL_VER >= 0x0700)\r
-               lRet = rk.QueryDWORDValue(pT->GetRegCountName(), dwRet);\r
-#else\r
-               lRet = rk.QueryValue(dwRet, pT->GetRegCountName());\r
-#endif\r
-               if(lRet != ERROR_SUCCESS)\r
-                       return FALSE;\r
-               SetMaxEntries(dwRet);\r
-\r
-               m_arrDocs.RemoveAll();\r
-\r
-               TCHAR szRetString[t_cchItemLen] = { 0 };\r
-               _DocEntry de;\r
-\r
-               for(int nItem = m_nMaxEntries; nItem > 0; nItem--)\r
-               {\r
-                       TCHAR szBuff[m_cchItemNameLen] = { 0 };\r
-                       SecureHelper::wsprintf_x(szBuff, m_cchItemNameLen, pT->GetRegItemName(), nItem);\r
-#if (_ATL_VER >= 0x0700)\r
-                       ULONG ulCount = t_cchItemLen;\r
-                       lRet = rk.QueryStringValue(szBuff, szRetString, &ulCount);\r
-#else\r
-                       DWORD dwCount = t_cchItemLen * sizeof(TCHAR);\r
-                       lRet = rk.QueryValue(szRetString, szBuff, &dwCount);\r
-#endif\r
-                       if(lRet == ERROR_SUCCESS)\r
-                       {\r
-                               SecureHelper::strcpy_x(de.szDocName, _countof(de.szDocName), szRetString);\r
-                               m_arrDocs.Add(de);\r
-                       }\r
-               }\r
-\r
-               rk.Close();\r
-               rkParent.Close();\r
-\r
-               return pT->UpdateMenu();\r
-       }\r
-\r
-       BOOL WriteToRegistry(LPCTSTR lpstrRegKey)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               ATL::CRegKey rkParent;\r
-               ATL::CRegKey rk;\r
-\r
-               LONG lRet = rkParent.Create(HKEY_CURRENT_USER, lpstrRegKey);\r
-               if(lRet != ERROR_SUCCESS)\r
-                       return FALSE;\r
-               lRet = rk.Create(rkParent, pT->GetRegKeyName());\r
-               if(lRet != ERROR_SUCCESS)\r
-                       return FALSE;\r
-\r
-#if (_ATL_VER >= 0x0700)\r
-               lRet = rk.SetDWORDValue(pT->GetRegCountName(), m_nMaxEntries);\r
-#else\r
-               lRet = rk.SetValue(m_nMaxEntries, pT->GetRegCountName());\r
-#endif\r
-               ATLASSERT(lRet == ERROR_SUCCESS);\r
-\r
-               // set new values\r
-               int nItem;\r
-               for(nItem = m_arrDocs.GetSize(); nItem > 0; nItem--)\r
-               {\r
-                       TCHAR szBuff[m_cchItemNameLen] = { 0 };\r
-                       SecureHelper::wsprintf_x(szBuff, m_cchItemNameLen, pT->GetRegItemName(), nItem);\r
-                       TCHAR szDocName[t_cchItemLen] = { 0 };\r
-                       GetFromList(t_nFirstID + nItem - 1, szDocName, t_cchItemLen);\r
-#if (_ATL_VER >= 0x0700)\r
-                       lRet = rk.SetStringValue(szBuff, szDocName);\r
-#else\r
-                       lRet = rk.SetValue(szDocName, szBuff);\r
-#endif\r
-                       ATLASSERT(lRet == ERROR_SUCCESS);\r
-               }\r
-\r
-               // delete unused keys\r
-               for(nItem = m_arrDocs.GetSize() + 1; nItem < m_nMaxEntries_Max; nItem++)\r
-               {\r
-                       TCHAR szBuff[m_cchItemNameLen] = { 0 };\r
-                       SecureHelper::wsprintf_x(szBuff, m_cchItemNameLen, pT->GetRegItemName(), nItem);\r
-                       rk.DeleteValue(szBuff);\r
-               }\r
-\r
-               rk.Close();\r
-               rkParent.Close();\r
-\r
-               return TRUE;\r
-       }\r
-\r
-// Implementation\r
-       BOOL UpdateMenu()\r
-       {\r
-               if(m_hMenu == NULL)\r
-                       return FALSE;\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-\r
-               int nItems = ::GetMenuItemCount(m_hMenu);\r
-               int nInsertPoint;\r
-               for(nInsertPoint = 0; nInsertPoint < nItems; nInsertPoint++)\r
-               {\r
-                       CMenuItemInfo mi;\r
-                       mi.fMask = MIIM_ID;\r
-                       ::GetMenuItemInfo(m_hMenu, nInsertPoint, TRUE, &mi);\r
-                       if (mi.wID == t_nFirstID)\r
-                               break;\r
-               }\r
-               ATLASSERT(nInsertPoint < nItems && "You need a menu item with an ID = t_nFirstID");\r
-\r
-               int nItem;\r
-               for(nItem = t_nFirstID; nItem < t_nFirstID + m_nMaxEntries; nItem++)\r
-               {\r
-                       // keep the first one as an insertion point\r
-                       if (nItem != t_nFirstID)\r
-                               ::DeleteMenu(m_hMenu, nItem, MF_BYCOMMAND);\r
-               }\r
-\r
-               TCHAR szItemText[t_cchItemLen + 6] = { 0 };   // add space for &, 2 digits, and a space\r
-               int nSize = m_arrDocs.GetSize();\r
-               nItem = 0;\r
-               if(nSize > 0)\r
-               {\r
-                       for(nItem = 0; nItem < nSize; nItem++)\r
-                       {\r
-                               if(m_cchMaxItemLen == -1)\r
-                               {\r
-                                       SecureHelper::wsprintf_x(szItemText, t_cchItemLen + 6, _T("&%i %s"), nItem + 1, m_arrDocs[nSize - 1 - nItem].szDocName);\r
-                               }\r
-                               else\r
-                               {\r
-                                       TCHAR szBuff[t_cchItemLen] = { 0 };\r
-                                       T* pT = static_cast<T*>(this);\r
-                                       pT;   // avoid level 4 warning\r
-                                       bool bRet = pT->CompactDocumentName(szBuff, m_arrDocs[nSize - 1 - nItem].szDocName, m_cchMaxItemLen);\r
-                                       bRet;   // avoid level 4 warning\r
-                                       ATLASSERT(bRet);\r
-                                       SecureHelper::wsprintf_x(szItemText, t_cchItemLen + 6, _T("&%i %s"), nItem + 1, szBuff);\r
-                               }\r
-                               ::InsertMenu(m_hMenu, nInsertPoint + nItem, MF_BYPOSITION | MF_STRING, t_nFirstID + nItem, szItemText);\r
-                       }\r
-               }\r
-               else    // empty\r
-               {\r
-                       ::InsertMenu(m_hMenu, nInsertPoint, MF_BYPOSITION | MF_STRING, t_nFirstID, m_szNoEntries);\r
-                       ::EnableMenuItem(m_hMenu, t_nFirstID, MF_GRAYED);\r
-                       nItem++;\r
-               }\r
-               ::DeleteMenu(m_hMenu, nInsertPoint + nItem, MF_BYPOSITION);\r
-\r
-               return TRUE;\r
-       }\r
-\r
-// Overrideables\r
-       // override to provide a different method of compacting document names\r
-       static bool CompactDocumentName(LPTSTR lpstrOut, LPCTSTR lpstrIn, int cchLen)\r
-       {\r
-               return AtlCompactPath(lpstrOut, lpstrIn, cchLen);\r
-       }\r
-\r
-       static LPCTSTR GetRegKeyName()\r
-       {\r
-               return _T("Recent Document List");\r
-       }\r
-\r
-       static LPCTSTR GetRegCountName()\r
-       {\r
-               return _T("DocumentCount");\r
-       }\r
-\r
-       static LPCTSTR GetRegItemName()\r
-       {\r
-               // Note: This string is a format string used with wsprintf().\r
-               // Resulting formatted string must be m_cchItemNameLen or less \r
-               // characters long, including the terminating null character.\r
-               return _T("Document%i");\r
-       }\r
-\r
-       static LPCTSTR GetMRUEmptyText()\r
-       {\r
-               return _WTL_MRUEMPTY_TEXT;\r
-       }\r
-};\r
-\r
-class CRecentDocumentList : public CRecentDocumentListBase<CRecentDocumentList>\r
-{\r
-public:\r
-// nothing here\r
-};\r
-\r
-#endif // _WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFindFile - file search helper class\r
-\r
-class CFindFile\r
-{\r
-public:\r
-// Data members\r
-       WIN32_FIND_DATA m_fd;\r
-       TCHAR m_lpszRoot[MAX_PATH];\r
-       TCHAR m_chDirSeparator;\r
-       HANDLE m_hFind;\r
-       BOOL m_bFound;\r
-\r
-// Constructor/destructor\r
-       CFindFile() : m_hFind(NULL), m_chDirSeparator(_T('\\')), m_bFound(FALSE)\r
-       { }\r
-\r
-       ~CFindFile()\r
-       {\r
-               Close();\r
-       }\r
-\r
-// Attributes\r
-       ULONGLONG GetFileSize() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               ULARGE_INTEGER nFileSize = { 0 };\r
-\r
-               if(m_bFound)\r
-               {\r
-                       nFileSize.LowPart = m_fd.nFileSizeLow;\r
-                       nFileSize.HighPart = m_fd.nFileSizeHigh;\r
-               }\r
-               else\r
-               {\r
-                       nFileSize.QuadPart = 0;\r
-               }\r
-\r
-               return nFileSize.QuadPart;\r
-       }\r
-\r
-       BOOL GetFileName(LPTSTR lpstrFileName, int cchLength) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-               if(lstrlen(m_fd.cFileName) >= cchLength)\r
-                       return FALSE;\r
-\r
-               if(m_bFound)\r
-                       SecureHelper::strcpy_x(lpstrFileName, cchLength, m_fd.cFileName);\r
-\r
-               return m_bFound;\r
-       }\r
-\r
-       BOOL GetFilePath(LPTSTR lpstrFilePath, int cchLength) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               int nLen = lstrlen(m_lpszRoot);\r
-#ifndef _WIN32_WCE\r
-               ATLASSERT(nLen > 0);\r
-               if(nLen == 0)\r
-                       return FALSE;\r
-\r
-               bool bAddSep = (m_lpszRoot[nLen - 1] != _T('\\') && m_lpszRoot[nLen - 1] !=_T('/'));\r
-#else // CE specific\r
-               // allow diskless devices (nLen == 0)\r
-               bool bAddSep = ((nLen == 0) || (m_lpszRoot[nLen - 1] != _T('\\') && m_lpszRoot[nLen - 1] !=_T('/')));\r
-#endif // _WIN32_WCE\r
-\r
-               if((lstrlen(m_lpszRoot) + (bAddSep ?  1 : 0)) >= cchLength)\r
-                       return FALSE;\r
-\r
-               SecureHelper::strcpy_x(lpstrFilePath, cchLength, m_lpszRoot);\r
-\r
-               if(bAddSep)\r
-               {\r
-                       TCHAR szSeparator[2] = { m_chDirSeparator, 0 };\r
-                       SecureHelper::strcat_x(lpstrFilePath, cchLength, szSeparator);\r
-               }\r
-\r
-               SecureHelper::strcat_x(lpstrFilePath, cchLength, m_fd.cFileName);\r
-\r
-               return TRUE;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetFileTitle(LPTSTR lpstrFileTitle, int cchLength) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               TCHAR szBuff[MAX_PATH] = { 0 };\r
-               if(!GetFileName(szBuff, MAX_PATH))\r
-                       return FALSE;\r
-\r
-               if(lstrlen(szBuff) >= cchLength || cchLength < 1)\r
-                       return FALSE;\r
-\r
-               // find the last dot\r
-               LPTSTR pstrDot  = (LPTSTR)_cstrrchr(szBuff, _T('.'));\r
-               if(pstrDot != NULL)\r
-                       *pstrDot = 0;\r
-\r
-               SecureHelper::strcpy_x(lpstrFileTitle, cchLength, szBuff);\r
-\r
-               return TRUE;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL GetFileURL(LPTSTR lpstrFileURL, int cchLength) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               TCHAR szBuff[MAX_PATH] = { 0 };\r
-               if(!GetFilePath(szBuff, MAX_PATH))\r
-                       return FALSE;\r
-               LPCTSTR lpstrFileURLPrefix = _T("file://");\r
-               if(lstrlen(szBuff) + lstrlen(lpstrFileURLPrefix) >= cchLength)\r
-                       return FALSE;\r
-               SecureHelper::strcpy_x(lpstrFileURL, cchLength, lpstrFileURLPrefix);\r
-               SecureHelper::strcat_x(lpstrFileURL, cchLength, szBuff);\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL GetRoot(LPTSTR lpstrRoot, int cchLength) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-               if(lstrlen(m_lpszRoot) >= cchLength)\r
-                       return FALSE;\r
-\r
-               SecureHelper::strcpy_x(lpstrRoot, cchLength, m_lpszRoot);\r
-\r
-               return TRUE;\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       _CSTRING_NS::CString GetFileName() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               _CSTRING_NS::CString ret;\r
-\r
-               if(m_bFound)\r
-                       ret = m_fd.cFileName;\r
-               return ret;\r
-       }\r
-\r
-       _CSTRING_NS::CString GetFilePath() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               _CSTRING_NS::CString strResult = m_lpszRoot;\r
-               int nLen = strResult.GetLength();\r
-#ifndef _WIN32_WCE\r
-               ATLASSERT(nLen > 0);\r
-               if(nLen == 0)\r
-                       return strResult;\r
-\r
-               if((strResult[nLen - 1] != _T('\\')) && (strResult[nLen - 1] != _T('/')))\r
-#else // CE specific\r
-               // allow diskless devices (nLen == 0)\r
-               if((nLen == 0) || ((strResult[nLen - 1] != _T('\\')) && (strResult[nLen - 1] != _T('/'))))\r
-#endif // _WIN32_WCE\r
-                       strResult += m_chDirSeparator;\r
-               strResult += GetFileName();\r
-               return strResult;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       _CSTRING_NS::CString GetFileTitle() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               _CSTRING_NS::CString strResult;\r
-               GetFileTitle(strResult.GetBuffer(MAX_PATH), MAX_PATH);\r
-               strResult.ReleaseBuffer();\r
-\r
-               return strResult;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       _CSTRING_NS::CString GetFileURL() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               _CSTRING_NS::CString strResult("file://");\r
-               strResult += GetFilePath();\r
-               return strResult;\r
-       }\r
-\r
-       _CSTRING_NS::CString GetRoot() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               _CSTRING_NS::CString str = m_lpszRoot;\r
-               return str;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       BOOL GetLastWriteTime(FILETIME* pTimeStamp) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-               ATLASSERT(pTimeStamp != NULL);\r
-\r
-               if(m_bFound && pTimeStamp != NULL)\r
-               {\r
-                       *pTimeStamp = m_fd.ftLastWriteTime;\r
-                       return TRUE;\r
-               }\r
-\r
-               return FALSE;\r
-       }\r
-\r
-       BOOL GetLastAccessTime(FILETIME* pTimeStamp) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-               ATLASSERT(pTimeStamp != NULL);\r
-\r
-               if(m_bFound && pTimeStamp != NULL)\r
-               {\r
-                       *pTimeStamp = m_fd.ftLastAccessTime;\r
-                       return TRUE;\r
-               }\r
-\r
-               return FALSE;\r
-       }\r
-\r
-       BOOL GetCreationTime(FILETIME* pTimeStamp) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               if(m_bFound && pTimeStamp != NULL)\r
-               {\r
-                       *pTimeStamp = m_fd.ftCreationTime;\r
-                       return TRUE;\r
-               }\r
-\r
-               return FALSE;\r
-       }\r
-\r
-       BOOL MatchesMask(DWORD dwMask) const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               if(m_bFound)\r
-                       return ((m_fd.dwFileAttributes & dwMask) != 0);\r
-\r
-               return FALSE;\r
-       }\r
-\r
-       BOOL IsDots() const\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               // return TRUE if the file name is "." or ".." and\r
-               // the file is a directory\r
-\r
-               BOOL bResult = FALSE;\r
-               if(m_bFound && IsDirectory())\r
-               {\r
-                       if(m_fd.cFileName[0] == _T('.') && (m_fd.cFileName[1] == _T('\0') || (m_fd.cFileName[1] == _T('.') && m_fd.cFileName[2] == _T('\0'))))\r
-                               bResult = TRUE;\r
-               }\r
-\r
-               return bResult;\r
-       }\r
-\r
-       BOOL IsReadOnly() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_READONLY);\r
-       }\r
-\r
-       BOOL IsDirectory() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_DIRECTORY);\r
-       }\r
-\r
-       BOOL IsCompressed() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_COMPRESSED);\r
-       }\r
-\r
-       BOOL IsSystem() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_SYSTEM);\r
-       }\r
-\r
-       BOOL IsHidden() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_HIDDEN);\r
-       }\r
-\r
-       BOOL IsTemporary() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_TEMPORARY);\r
-       }\r
-\r
-       BOOL IsNormal() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_NORMAL);\r
-       }\r
-\r
-       BOOL IsArchived() const\r
-       {\r
-               return MatchesMask(FILE_ATTRIBUTE_ARCHIVE);\r
-       }\r
-\r
-// Operations\r
-       BOOL FindFile(LPCTSTR pstrName = NULL)\r
-       {\r
-               Close();\r
-\r
-               if(pstrName == NULL)\r
-               {\r
-                       pstrName = _T("*.*");\r
-               }\r
-               else if(lstrlen(pstrName) >= MAX_PATH)\r
-               {\r
-                       ATLASSERT(FALSE);\r
-                       return FALSE;\r
-               }\r
-\r
-               SecureHelper::strcpy_x(m_fd.cFileName, _countof(m_fd.cFileName), pstrName);\r
-\r
-               m_hFind = ::FindFirstFile(pstrName, &m_fd);\r
-\r
-               if(m_hFind == INVALID_HANDLE_VALUE)\r
-                       return FALSE;\r
-\r
-#ifndef _WIN32_WCE\r
-               bool bFullPath = (::GetFullPathName(pstrName, MAX_PATH, m_lpszRoot, NULL) != 0);\r
-#else // CE specific\r
-               errno_t nRet = SecureHelper::strncpy_x(m_lpszRoot, _countof(m_lpszRoot), pstrName, _TRUNCATE);\r
-               bool bFullPath = (nRet == 0 || nRet == STRUNCATE);\r
-#endif // _WIN32_WCE\r
-\r
-               // passed name isn't a valid path but was found by the API\r
-               ATLASSERT(bFullPath);\r
-               if(!bFullPath)\r
-               {\r
-                       Close();\r
-                       ::SetLastError(ERROR_INVALID_NAME);\r
-                       return FALSE;\r
-               }\r
-               else\r
-               {\r
-                       // find the last forward or backward whack\r
-                       LPTSTR pstrBack  = (LPTSTR)_cstrrchr(m_lpszRoot, _T('\\'));\r
-                       LPTSTR pstrFront = (LPTSTR)_cstrrchr(m_lpszRoot, _T('/'));\r
-\r
-                       if(pstrFront != NULL || pstrBack != NULL)\r
-                       {\r
-                               if(pstrFront == NULL)\r
-                                       pstrFront = m_lpszRoot;\r
-                               if(pstrBack == NULL)\r
-                                       pstrBack = m_lpszRoot;\r
-\r
-                               // from the start to the last whack is the root\r
-\r
-                               if(pstrFront >= pstrBack)\r
-                                       *pstrFront = _T('\0');\r
-                               else\r
-                                       *pstrBack = _T('\0');\r
-                       }\r
-               }\r
-\r
-               m_bFound = TRUE;\r
-\r
-               return TRUE;\r
-       }\r
-\r
-       BOOL FindNextFile()\r
-       {\r
-               ATLASSERT(m_hFind != NULL);\r
-\r
-               if(m_hFind == NULL)\r
-                       return FALSE;\r
-\r
-               if(!m_bFound)\r
-                       return FALSE;\r
-\r
-               m_bFound = ::FindNextFile(m_hFind, &m_fd);\r
-\r
-               return m_bFound;\r
-       }\r
-\r
-       void Close()\r
-       {\r
-               m_bFound = FALSE;\r
-\r
-               if(m_hFind != NULL && m_hFind != INVALID_HANDLE_VALUE)\r
-               {\r
-                       ::FindClose(m_hFind);\r
-                       m_hFind = NULL;\r
-               }\r
-       }\r
-\r
-// Helper\r
-       static const TCHAR* _cstrrchr(const TCHAR* p, TCHAR ch)\r
-       {\r
-#ifdef _ATL_MIN_CRT\r
-               const TCHAR* lpsz = NULL;\r
-               while (*p != 0)\r
-               {\r
-                       if (*p == ch)\r
-                               lpsz = p;\r
-                       p = ::CharNext(p);\r
-               }\r
-               return lpsz;\r
-#else // !_ATL_MIN_CRT\r
-               return _tcsrchr(p, ch);\r
-#endif // !_ATL_MIN_CRT\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Global functions for loading resources\r
-\r
-inline HACCEL AtlLoadAccelerators(ATL::_U_STRINGorID table)\r
-{\r
-       return ::LoadAccelerators(ModuleHelper::GetResourceInstance(), table.m_lpstr);\r
-}\r
-\r
-inline HMENU AtlLoadMenu(ATL::_U_STRINGorID menu)\r
-{\r
-       return ::LoadMenu(ModuleHelper::GetResourceInstance(), menu.m_lpstr);\r
-}\r
-\r
-inline HBITMAP AtlLoadBitmap(ATL::_U_STRINGorID bitmap)\r
-{\r
-       return ::LoadBitmap(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr);\r
-}\r
-\r
-#ifdef OEMRESOURCE\r
-inline HBITMAP AtlLoadSysBitmap(ATL::_U_STRINGorID bitmap)\r
-{\r
-#ifdef _DEBUG\r
-       WORD wID = (WORD)bitmap.m_lpstr;\r
-       ATLASSERT(wID >= 32734 && wID <= 32767);\r
-#endif // _DEBUG\r
-       return ::LoadBitmap(NULL, bitmap.m_lpstr);\r
-}\r
-#endif // OEMRESOURCE\r
-\r
-inline HCURSOR AtlLoadCursor(ATL::_U_STRINGorID cursor)\r
-{\r
-       return ::LoadCursor(ModuleHelper::GetResourceInstance(), cursor.m_lpstr);\r
-}\r
-\r
-inline HCURSOR AtlLoadSysCursor(LPCTSTR lpCursorName)\r
-{\r
-#if (WINVER >= 0x0500)\r
-       ATLASSERT(lpCursorName == IDC_ARROW || lpCursorName == IDC_IBEAM || lpCursorName == IDC_WAIT ||\r
-               lpCursorName == IDC_CROSS || lpCursorName == IDC_UPARROW || lpCursorName == IDC_SIZE ||\r
-               lpCursorName == IDC_ICON || lpCursorName == IDC_SIZENWSE || lpCursorName == IDC_SIZENESW ||\r
-               lpCursorName == IDC_SIZEWE || lpCursorName == IDC_SIZENS || lpCursorName == IDC_SIZEALL ||\r
-               lpCursorName == IDC_NO || lpCursorName == IDC_APPSTARTING || lpCursorName == IDC_HELP ||\r
-               lpCursorName == IDC_HAND);\r
-#else // !(WINVER >= 0x0500)\r
-       ATLASSERT(lpCursorName == IDC_ARROW || lpCursorName == IDC_IBEAM || lpCursorName == IDC_WAIT ||\r
-               lpCursorName == IDC_CROSS || lpCursorName == IDC_UPARROW || lpCursorName == IDC_SIZE ||\r
-               lpCursorName == IDC_ICON || lpCursorName == IDC_SIZENWSE || lpCursorName == IDC_SIZENESW ||\r
-               lpCursorName == IDC_SIZEWE || lpCursorName == IDC_SIZENS || lpCursorName == IDC_SIZEALL ||\r
-               lpCursorName == IDC_NO || lpCursorName == IDC_APPSTARTING || lpCursorName == IDC_HELP);\r
-#endif // !(WINVER >= 0x0500)\r
-       return ::LoadCursor(NULL, lpCursorName);\r
-}\r
-\r
-inline HICON AtlLoadIcon(ATL::_U_STRINGorID icon)\r
-{\r
-       return ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\r
-}\r
-\r
-#ifndef _WIN32_WCE\r
-inline HICON AtlLoadSysIcon(LPCTSTR lpIconName)\r
-{\r
-#if (WINVER >= 0x0600)\r
-       ATLASSERT(lpIconName == IDI_APPLICATION || lpIconName == IDI_ASTERISK || lpIconName == IDI_EXCLAMATION ||\r
-                 lpIconName == IDI_HAND || lpIconName == IDI_QUESTION || lpIconName == IDI_WINLOGO ||\r
-                 lpIconName == IDI_SHIELD);\r
-#else // !(WINVER >= 0x0600)\r
-       ATLASSERT(lpIconName == IDI_APPLICATION || lpIconName == IDI_ASTERISK || lpIconName == IDI_EXCLAMATION ||\r
-                 lpIconName == IDI_HAND || lpIconName == IDI_QUESTION || lpIconName == IDI_WINLOGO);\r
-#endif // !(WINVER >= 0x0600)\r
-       return ::LoadIcon(NULL, lpIconName);\r
-}\r
-#endif // !_WIN32_WCE\r
-\r
-inline HBITMAP AtlLoadBitmapImage(ATL::_U_STRINGorID bitmap, UINT fuLoad = LR_DEFAULTCOLOR)\r
-{\r
-       return (HBITMAP)::LoadImage(ModuleHelper::GetResourceInstance(), bitmap.m_lpstr, IMAGE_BITMAP, 0, 0, fuLoad);\r
-}\r
-\r
-inline HCURSOR AtlLoadCursorImage(ATL::_U_STRINGorID cursor, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\r
-{\r
-       return (HCURSOR)::LoadImage(ModuleHelper::GetResourceInstance(), cursor.m_lpstr, IMAGE_CURSOR, cxDesired, cyDesired, fuLoad);\r
-}\r
-\r
-inline HICON AtlLoadIconImage(ATL::_U_STRINGorID icon, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\r
-{\r
-       return (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), icon.m_lpstr, IMAGE_ICON, cxDesired, cyDesired, fuLoad);\r
-}\r
-\r
-#ifdef OEMRESOURCE\r
-inline HBITMAP AtlLoadSysBitmapImage(WORD wBitmapID, UINT fuLoad = LR_DEFAULTCOLOR)\r
-{\r
-       ATLASSERT(wBitmapID >= 32734 && wBitmapID <= 32767);\r
-       ATLASSERT((fuLoad & LR_LOADFROMFILE) == 0);   // this one doesn't load from a file\r
-       return (HBITMAP)::LoadImage(NULL, MAKEINTRESOURCE(wBitmapID), IMAGE_BITMAP, 0, 0, fuLoad);\r
-}\r
-#endif // OEMRESOURCE\r
-\r
-inline HCURSOR AtlLoadSysCursorImage(ATL::_U_STRINGorID cursor, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\r
-{\r
-#ifdef _DEBUG\r
-       WORD wID = (WORD)cursor.m_lpstr;\r
-       ATLASSERT((wID >= 32512 && wID <= 32516) || (wID >= 32640 && wID <= 32648) || (wID == 32650) || (wID == 32651));\r
-       ATLASSERT((fuLoad & LR_LOADFROMFILE) == 0);   // this one doesn't load from a file\r
-#endif // _DEBUG\r
-       return (HCURSOR)::LoadImage(NULL, cursor.m_lpstr, IMAGE_CURSOR, cxDesired, cyDesired, fuLoad);\r
-}\r
-\r
-inline HICON AtlLoadSysIconImage(ATL::_U_STRINGorID icon, UINT fuLoad = LR_DEFAULTCOLOR | LR_DEFAULTSIZE, int cxDesired = 0, int cyDesired = 0)\r
-{\r
-#ifdef _DEBUG\r
-       WORD wID = (WORD)icon.m_lpstr;\r
-       ATLASSERT(wID >= 32512 && wID <= 32517);\r
-       ATLASSERT((fuLoad & LR_LOADFROMFILE) == 0);   // this one doesn't load from a file\r
-#endif // _DEBUG\r
-       return (HICON)::LoadImage(NULL, icon.m_lpstr, IMAGE_ICON, cxDesired, cyDesired, fuLoad);\r
-}\r
-\r
-#if (_ATL_VER < 0x0700)\r
-inline int AtlLoadString(UINT uID, LPTSTR lpBuffer, int nBufferMax)\r
-{\r
-       return ::LoadString(_Module.GetResourceInstance(), uID, lpBuffer, nBufferMax);\r
-}\r
-#endif // (_ATL_VER < 0x0700)\r
-\r
-#ifdef _WIN32_WCE // CE only direct access to the resource\r
-inline LPCTSTR AtlLoadString(UINT uID)\r
-{\r
-       LPCTSTR s = (LPCTSTR)::LoadString(ModuleHelper::GetResourceInstance(), uID, NULL, 0);\r
-#ifdef DEBUG // Check for null-termination\r
-       if(s != NULL)\r
-               // Note: RC -n <file.rc> compiles null-terminated resource strings\r
-               ATLASSERT(s[*((WORD*)s -1) - 1] == L'\0');\r
-#endif\r
-       return s;\r
-}\r
-#endif // _WIN32_WCE\r
-\r
-inline bool AtlLoadString(UINT uID, BSTR& bstrText)\r
-{\r
-       USES_CONVERSION;\r
-       ATLASSERT(bstrText == NULL);\r
-\r
-       LPTSTR lpstrText = NULL;\r
-       int nRes = 0;\r
-       for(int nLen = 256; ; nLen *= 2)\r
-       {\r
-               ATLTRY(lpstrText = new TCHAR[nLen]);\r
-               if(lpstrText == NULL)\r
-                       break;\r
-               nRes = ::LoadString(ModuleHelper::GetResourceInstance(), uID, lpstrText, nLen);\r
-               if(nRes < nLen - 1)\r
-                       break;\r
-               delete [] lpstrText;\r
-               lpstrText = NULL;\r
-       }\r
-\r
-       if(lpstrText != NULL)\r
-       {\r
-               if(nRes != 0)\r
-                       bstrText = ::SysAllocString(T2OLE(lpstrText));\r
-               delete [] lpstrText;\r
-       }\r
-\r
-       return (bstrText != NULL) ? true : false;\r
-}\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Global functions for stock GDI objects\r
-\r
-inline HPEN AtlGetStockPen(int nPen)\r
-{\r
-#if (_WIN32_WINNT >= 0x0500) && !defined(_WIN32_WCE)\r
-       ATLASSERT(nPen == WHITE_PEN || nPen == BLACK_PEN || nPen == NULL_PEN || nPen == DC_PEN);\r
-#else\r
-       ATLASSERT(nPen == WHITE_PEN || nPen == BLACK_PEN || nPen == NULL_PEN);\r
-#endif\r
-       return (HPEN)::GetStockObject(nPen);\r
-}\r
-\r
-inline HBRUSH AtlGetStockBrush(int nBrush)\r
-{\r
-#if (_WIN32_WINNT >= 0x0500) && !defined(_WIN32_WCE)\r
-       ATLASSERT((nBrush >= WHITE_BRUSH && nBrush <= HOLLOW_BRUSH) || nBrush == DC_BRUSH);\r
-#else\r
-       ATLASSERT(nBrush >= WHITE_BRUSH && nBrush <= HOLLOW_BRUSH);\r
-#endif\r
-       return (HBRUSH)::GetStockObject(nBrush);\r
-}\r
-\r
-inline HFONT AtlGetStockFont(int nFont)\r
-{\r
-#ifndef _WIN32_WCE\r
-       ATLASSERT((nFont >= OEM_FIXED_FONT && nFont <= SYSTEM_FIXED_FONT) || nFont == DEFAULT_GUI_FONT);\r
-#else // CE specific\r
-       ATLASSERT(nFont == SYSTEM_FONT);\r
-#endif // _WIN32_WCE\r
-       return (HFONT)::GetStockObject(nFont);\r
-}\r
-\r
-inline HPALETTE AtlGetStockPalette(int nPalette)\r
-{\r
-       ATLASSERT(nPalette == DEFAULT_PALETTE); // the only one supported\r
-       return (HPALETTE)::GetStockObject(nPalette);\r
-}\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Global function for compacting a path by replacing parts with ellipsis\r
-\r
-// helper for multi-byte character sets\r
-inline bool _IsDBCSTrailByte(LPCTSTR lpstr, int nChar)\r
-{\r
-#ifndef _UNICODE\r
-       int i = nChar;\r
-       for( ; i > 0; i--)\r
-       {\r
-               if(!::IsDBCSLeadByte(lpstr[i - 1]))\r
-                       break;\r
-       }\r
-       return ((nChar > 0) && (((nChar - i) & 1) != 0));\r
-#else // _UNICODE\r
-       lpstr; nChar;\r
-       return false;\r
-#endif // _UNICODE\r
-}\r
-\r
-inline bool AtlCompactPath(LPTSTR lpstrOut, LPCTSTR lpstrIn, int cchLen)\r
-{\r
-       ATLASSERT(lpstrOut != NULL);\r
-       ATLASSERT(lpstrIn != NULL);\r
-       ATLASSERT(cchLen > 0);\r
-\r
-       LPCTSTR szEllipsis = _T("...");\r
-       const int cchEndEllipsis = 3;\r
-       const int cchMidEllipsis = 4;\r
-\r
-       if(lstrlen(lpstrIn) < cchLen)\r
-       {\r
-               SecureHelper::strcpy_x(lpstrOut, cchLen, lpstrIn);\r
-               return true;\r
-       }\r
-\r
-       lpstrOut[0] = 0;\r
-\r
-       // check if the separator is a slash or a backslash\r
-       TCHAR chSlash = _T('\\');\r
-       for(LPTSTR lpstr = (LPTSTR)lpstrIn; *lpstr != 0; lpstr = ::CharNext(lpstr))\r
-       {\r
-               if((*lpstr == _T('/')) || (*lpstr == _T('\\')))\r
-                       chSlash = *lpstr;\r
-       }\r
-\r
-       // find the filename portion of the path\r
-       LPCTSTR lpstrFileName = lpstrIn;\r
-       for(LPCTSTR pPath = lpstrIn; *pPath; pPath = ::CharNext(pPath))\r
-       {\r
-               if((pPath[0] == _T('\\') || pPath[0] == _T(':') || pPath[0] == _T('/'))\r
-                               && pPath[1] && pPath[1] != _T('\\') && pPath[1] != _T('/'))\r
-                       lpstrFileName = pPath + 1;\r
-       }\r
-       int cchFileName = lstrlen(lpstrFileName);\r
-\r
-       // handle just the filename without a path\r
-       if(lpstrFileName == lpstrIn && cchLen > cchEndEllipsis)\r
-       {\r
-               bool bRet = (SecureHelper::strncpy_x(lpstrOut, cchLen, lpstrIn, cchLen - cchEndEllipsis - 1) == 0);\r
-               if(bRet)\r
-               {\r
-#ifndef _UNICODE\r
-                       if(_IsDBCSTrailByte(lpstrIn, cchLen - cchEndEllipsis))\r
-                               lpstrOut[cchLen - cchEndEllipsis - 1] = 0;\r
-#endif // _UNICODE\r
-                       SecureHelper::strcat_x(lpstrOut, cchLen, szEllipsis);\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       // handle just ellipsis\r
-       if((cchLen < (cchMidEllipsis + cchEndEllipsis)))\r
-       {\r
-               for(int i = 0; i < cchLen - 1; i++)\r
-                       lpstrOut[i] = ((i + 1) == cchMidEllipsis) ? chSlash : _T('.');\r
-               lpstrOut[cchLen - 1] = 0;\r
-               return true;\r
-       }\r
-\r
-       // calc how much we have to copy\r
-       int cchToCopy = cchLen - (cchMidEllipsis + cchFileName) - 1;\r
-\r
-       if(cchToCopy < 0)\r
-               cchToCopy = 0;\r
-\r
-#ifndef _UNICODE\r
-       if(cchToCopy > 0 && _IsDBCSTrailByte(lpstrIn, cchToCopy))\r
-               cchToCopy--;\r
-#endif // _UNICODE\r
-\r
-       bool bRet = (SecureHelper::strncpy_x(lpstrOut, cchLen, lpstrIn, cchToCopy) == 0);\r
-       if(!bRet)\r
-               return false;\r
-\r
-       // add ellipsis\r
-       SecureHelper::strcat_x(lpstrOut, cchLen, szEllipsis);\r
-       if(!bRet)\r
-               return false;\r
-       TCHAR szSlash[2] = { chSlash, 0 };\r
-       SecureHelper::strcat_x(lpstrOut, cchLen, szSlash);\r
-       if(!bRet)\r
-               return false;\r
-\r
-       // add filename (and ellipsis, if needed)\r
-       if(cchLen > (cchMidEllipsis + cchFileName))\r
-       {\r
-               SecureHelper::strcat_x(lpstrOut, cchLen, lpstrFileName);\r
-       }\r
-       else\r
-       {\r
-               cchToCopy = cchLen - cchMidEllipsis - cchEndEllipsis - 1;\r
-#ifndef _UNICODE\r
-               if(cchToCopy > 0 && _IsDBCSTrailByte(lpstrFileName, cchToCopy))\r
-                       cchToCopy--;\r
-#endif // _UNICODE\r
-               bRet = (SecureHelper::strncpy_x(&lpstrOut[cchMidEllipsis], cchLen - cchMidEllipsis, lpstrFileName, cchToCopy) == 0);\r
-               if(bRet)\r
-                       SecureHelper::strcat_x(lpstrOut, cchLen, szEllipsis);\r
-       }\r
-\r
-       return bRet;\r
-}\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLMISC_H__\r
diff --git a/WTL80/include/atlprint.h b/WTL80/include/atlprint.h
deleted file mode 100644 (file)
index fed9a3f..0000000
+++ /dev/null
@@ -1,1113 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLPRINT_H__\r
-#define __ATLPRINT_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifdef _WIN32_WCE\r
-       #error atlprint.h is not supported on Windows CE\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlprint.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atlprint.h requires atlwin.h to be included first\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CPrinterInfo<t_nInfo>\r
-// CPrinterT<t_bManaged>\r
-// CDevModeT<t_bManaged>\r
-// CPrinterDC\r
-// CPrintJobInfo\r
-// CPrintJob\r
-// CPrintPreview\r
-// CPrintPreviewWindowImpl<T, TBase, TWinTraits>\r
-// CPrintPreviewWindow\r
-// CZoomPrintPreviewWindowImpl<T, TBase, TWinTraits>\r
-// CZoomPrintPreviewWindow\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrinterInfo - This class wraps all of the PRINTER_INFO_* structures\r
-//                and provided by ::GetPrinter.\r
-\r
-template <unsigned int t_nInfo>\r
-class _printer_info\r
-{\r
-public:\r
-       typedef void infotype;\r
-};\r
-\r
-template <> class _printer_info<1> { public: typedef PRINTER_INFO_1 infotype; };\r
-template <> class _printer_info<2> { public: typedef PRINTER_INFO_2 infotype; };\r
-template <> class _printer_info<3> { public: typedef PRINTER_INFO_3 infotype; };\r
-template <> class _printer_info<4> { public: typedef PRINTER_INFO_4 infotype; };\r
-template <> class _printer_info<5> { public: typedef PRINTER_INFO_5 infotype; };\r
-template <> class _printer_info<6> { public: typedef PRINTER_INFO_6 infotype; };\r
-template <> class _printer_info<7> { public: typedef PRINTER_INFO_7 infotype; };\r
-// these are not in the old (vc6.0) headers\r
-#ifdef _ATL_USE_NEW_PRINTER_INFO\r
-template <> class _printer_info<8> { public: typedef PRINTER_INFO_8 infotype; };\r
-template <> class _printer_info<9> { public: typedef PRINTER_INFO_9 infotype; };\r
-#endif // _ATL_USE_NEW_PRINTER_INFO\r
-\r
-\r
-template <unsigned int t_nInfo>\r
-class CPrinterInfo\r
-{\r
-public:\r
-// Data members\r
-       typename _printer_info<t_nInfo>::infotype* m_pi;\r
-\r
-// Constructor/destructor\r
-       CPrinterInfo() : m_pi(NULL)\r
-       { }\r
-\r
-       CPrinterInfo(HANDLE hPrinter) : m_pi(NULL)\r
-       {\r
-               GetPrinterInfo(hPrinter);\r
-       }\r
-\r
-       ~CPrinterInfo()\r
-       {\r
-               Cleanup();\r
-       }\r
-\r
-// Operations\r
-       bool GetPrinterInfo(HANDLE hPrinter)\r
-       {\r
-               Cleanup();\r
-               return GetPrinterInfoHelper(hPrinter, (BYTE**)&m_pi, t_nInfo);\r
-       }\r
-\r
-// Implementation\r
-       void Cleanup()\r
-       {\r
-               delete [] (BYTE*)m_pi;\r
-               m_pi = NULL;\r
-       }\r
-\r
-       static bool GetPrinterInfoHelper(HANDLE hPrinter, BYTE** pi, int nIndex)\r
-       {\r
-               ATLASSERT(pi != NULL);\r
-               DWORD dw = 0;\r
-               BYTE* pb = NULL;\r
-               ::GetPrinter(hPrinter, nIndex, NULL, 0, &dw);\r
-               if (dw > 0)\r
-               {\r
-                       ATLTRY(pb = new BYTE[dw]);\r
-                       if (pb != NULL)\r
-                       {\r
-                               memset(pb, 0, dw);\r
-                               DWORD dwNew;\r
-                               if (!::GetPrinter(hPrinter, nIndex, pb, dw, &dwNew))\r
-                               {\r
-                                       delete [] pb;\r
-                                       pb = NULL;\r
-                               }\r
-                       }\r
-               }\r
-               *pi = pb;\r
-               return (pb != NULL);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrinter - Wrapper class for a HANDLE to a printer\r
-\r
-template <bool t_bManaged>\r
-class CPrinterT\r
-{\r
-public:\r
-// Data members\r
-       HANDLE m_hPrinter;\r
-\r
-// Constructor/destructor\r
-       CPrinterT(HANDLE hPrinter = NULL) : m_hPrinter(hPrinter)\r
-       { }\r
-\r
-       ~CPrinterT()\r
-       {\r
-               ClosePrinter();\r
-       }\r
-\r
-// Operations\r
-       CPrinterT& operator =(HANDLE hPrinter)\r
-       {\r
-               if (hPrinter != m_hPrinter)\r
-               {\r
-                       ClosePrinter();\r
-                       m_hPrinter = hPrinter;\r
-               }\r
-               return *this;\r
-       }\r
-\r
-       bool IsNull() const { return (m_hPrinter == NULL); }\r
-\r
-       bool OpenPrinter(HANDLE hDevNames, const DEVMODE* pDevMode = NULL)\r
-       {\r
-               bool b = false;\r
-               DEVNAMES* pdn = (DEVNAMES*)::GlobalLock(hDevNames);\r
-               if (pdn != NULL)\r
-               {\r
-                       LPTSTR lpszPrinterName = (LPTSTR)pdn + pdn->wDeviceOffset;\r
-                       b = OpenPrinter(lpszPrinterName, pDevMode);\r
-                       ::GlobalUnlock(hDevNames);\r
-               }\r
-               return b;\r
-       }\r
-\r
-       bool OpenPrinter(LPCTSTR lpszPrinterName, const DEVMODE* pDevMode = NULL)\r
-       {\r
-               ClosePrinter();\r
-               PRINTER_DEFAULTS pdefs = { NULL, (DEVMODE*)pDevMode, PRINTER_ACCESS_USE };\r
-               ::OpenPrinter((LPTSTR) lpszPrinterName, &m_hPrinter, (pDevMode == NULL) ? NULL : &pdefs);\r
-\r
-               return (m_hPrinter != NULL);\r
-       }\r
-\r
-       bool OpenPrinter(LPCTSTR lpszPrinterName, PRINTER_DEFAULTS* pprintdefs)\r
-       {\r
-               ClosePrinter();\r
-               ::OpenPrinter((LPTSTR) lpszPrinterName, &m_hPrinter, pprintdefs);\r
-               return (m_hPrinter != NULL);\r
-       }\r
-\r
-       bool OpenDefaultPrinter(const DEVMODE* pDevMode = NULL)\r
-       {\r
-               ClosePrinter();\r
-               const int cchBuff = 512;\r
-               TCHAR buffer[cchBuff];\r
-               buffer[0] = 0;\r
-               ::GetProfileString(_T("windows"), _T("device"), _T(",,,"), buffer, cchBuff);\r
-               int nLen = lstrlen(buffer);\r
-               if (nLen != 0)\r
-               {\r
-                       LPTSTR lpsz = buffer;\r
-                       while (*lpsz)\r
-                       {\r
-                               if (*lpsz == _T(','))\r
-                               {\r
-                                       *lpsz = 0;\r
-                                       break;\r
-                               }\r
-                               lpsz = CharNext(lpsz);\r
-                       }\r
-                       PRINTER_DEFAULTS pdefs = { NULL, (DEVMODE*)pDevMode, PRINTER_ACCESS_USE };\r
-                       ::OpenPrinter(buffer, &m_hPrinter, (pDevMode == NULL) ? NULL : &pdefs);\r
-               }\r
-               return m_hPrinter != NULL;\r
-       }\r
-\r
-       void ClosePrinter()\r
-       {\r
-               if (m_hPrinter != NULL)\r
-               {\r
-                       if (t_bManaged)\r
-                               ::ClosePrinter(m_hPrinter);\r
-                       m_hPrinter = NULL;\r
-               }\r
-       }\r
-\r
-       bool PrinterProperties(HWND hWnd = NULL)\r
-       {\r
-               if (hWnd == NULL)\r
-                       hWnd = ::GetActiveWindow();\r
-               return !!::PrinterProperties(hWnd, m_hPrinter);\r
-       }\r
-\r
-       HANDLE CopyToHDEVNAMES() const\r
-       {\r
-               HANDLE h = NULL;\r
-               CPrinterInfo<5> pinfon5;\r
-               CPrinterInfo<2> pinfon2;\r
-               LPTSTR lpszPrinterName = NULL;\r
-               // Some printers fail for PRINTER_INFO_5 in some situations\r
-               if (pinfon5.GetPrinterInfo(m_hPrinter))\r
-                       lpszPrinterName = pinfon5.m_pi->pPrinterName;\r
-               else if (pinfon2.GetPrinterInfo(m_hPrinter))\r
-                       lpszPrinterName = pinfon2.m_pi->pPrinterName;\r
-               if (lpszPrinterName != NULL)\r
-               {\r
-                       int nLen = sizeof(DEVNAMES) + (lstrlen(lpszPrinterName) + 1) * sizeof(TCHAR);\r
-                       h = ::GlobalAlloc(GMEM_MOVEABLE, nLen);\r
-                       BYTE* pv = (BYTE*)::GlobalLock(h);\r
-                       DEVNAMES* pdev = (DEVNAMES*)pv;\r
-                       if (pv != NULL)\r
-                       {\r
-                               memset(pv, 0, nLen);\r
-                               pdev->wDeviceOffset = sizeof(DEVNAMES) / sizeof(TCHAR);\r
-                               pv = pv + sizeof(DEVNAMES); // now points to end\r
-                               SecureHelper::strcpy_x((LPTSTR)pv, lstrlen(lpszPrinterName) + 1, lpszPrinterName);\r
-                               ::GlobalUnlock(h);\r
-                       }\r
-               }\r
-               return h;\r
-       }\r
-\r
-       HDC CreatePrinterDC(const DEVMODE* pdm = NULL) const\r
-       {\r
-               CPrinterInfo<5> pinfo5;\r
-               CPrinterInfo<2> pinfo2;\r
-               HDC hDC = NULL;\r
-               LPTSTR lpszPrinterName = NULL;\r
-               // Some printers fail for PRINTER_INFO_5 in some situations\r
-               if (pinfo5.GetPrinterInfo(m_hPrinter))\r
-                       lpszPrinterName = pinfo5.m_pi->pPrinterName;\r
-               else if (pinfo2.GetPrinterInfo(m_hPrinter))\r
-                       lpszPrinterName = pinfo2.m_pi->pPrinterName;\r
-               if (lpszPrinterName != NULL)\r
-                       hDC = ::CreateDC(NULL, lpszPrinterName, NULL, pdm);\r
-               return hDC;\r
-       }\r
-\r
-       HDC CreatePrinterIC(const DEVMODE* pdm = NULL) const\r
-       {\r
-               CPrinterInfo<5> pinfo5;\r
-               CPrinterInfo<2> pinfo2;\r
-               HDC hDC = NULL;\r
-               LPTSTR lpszPrinterName = NULL;\r
-               // Some printers fail for PRINTER_INFO_5 in some situations\r
-               if (pinfo5.GetPrinterInfo(m_hPrinter))\r
-                       lpszPrinterName = pinfo5.m_pi->pPrinterName;\r
-               else if (pinfo2.GetPrinterInfo(m_hPrinter))\r
-                       lpszPrinterName = pinfo2.m_pi->pPrinterName;\r
-               if (lpszPrinterName != NULL)\r
-                       hDC = ::CreateIC(NULL, lpszPrinterName, NULL, pdm);\r
-               return hDC;\r
-       }\r
-\r
-       void Attach(HANDLE hPrinter)\r
-       {\r
-               ClosePrinter();\r
-               m_hPrinter = hPrinter;\r
-       }\r
-\r
-       HANDLE Detach()\r
-       {\r
-               HANDLE hPrinter = m_hPrinter;\r
-               m_hPrinter = NULL;\r
-               return hPrinter;\r
-       }\r
-\r
-       operator HANDLE() const { return m_hPrinter; }\r
-};\r
-\r
-typedef CPrinterT<false>   CPrinterHandle;\r
-typedef CPrinterT<true>    CPrinter;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDevMode - Wrapper class for DEVMODE\r
-\r
-template <bool t_bManaged>\r
-class CDevModeT\r
-{\r
-public:\r
-// Data members\r
-       HANDLE m_hDevMode;\r
-       DEVMODE* m_pDevMode;\r
-\r
-// Constructor/destructor\r
-       CDevModeT(HANDLE hDevMode = NULL) : m_hDevMode(hDevMode)\r
-       {\r
-               m_pDevMode = (m_hDevMode != NULL) ? (DEVMODE*)::GlobalLock(m_hDevMode) : NULL;\r
-       }\r
-\r
-       ~CDevModeT()\r
-       {\r
-               Cleanup();\r
-       }\r
-\r
-// Operations\r
-       CDevModeT<t_bManaged>& operator =(HANDLE hDevMode)\r
-       {\r
-               Attach(hDevMode);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HANDLE hDevModeNew)\r
-       {\r
-               Cleanup();\r
-               m_hDevMode = hDevModeNew;\r
-               m_pDevMode = (m_hDevMode != NULL) ? (DEVMODE*)::GlobalLock(m_hDevMode) : NULL;\r
-       }\r
-\r
-       HANDLE Detach()\r
-       {\r
-               if (m_hDevMode != NULL)\r
-                       ::GlobalUnlock(m_hDevMode);\r
-               HANDLE hDevMode = m_hDevMode;\r
-               m_hDevMode = NULL;\r
-               return hDevMode;\r
-       }\r
-\r
-       bool IsNull() const { return (m_hDevMode == NULL); }\r
-\r
-       bool CopyFromPrinter(HANDLE hPrinter)\r
-       {\r
-               CPrinterInfo<2> pinfo;\r
-               bool b = pinfo.GetPrinterInfo(hPrinter);\r
-               if (b)\r
-                b = CopyFromDEVMODE(pinfo.m_pi->pDevMode);\r
-               return b;\r
-       }\r
-\r
-       bool CopyFromDEVMODE(const DEVMODE* pdm)\r
-       {\r
-               if (pdm == NULL)\r
-                       return false;\r
-               int nSize = pdm->dmSize + pdm->dmDriverExtra;\r
-               HANDLE h = ::GlobalAlloc(GMEM_MOVEABLE, nSize);\r
-               if (h != NULL)\r
-               {\r
-                       void* p = ::GlobalLock(h);\r
-                       SecureHelper::memcpy_x(p, nSize, pdm, nSize);\r
-                       ::GlobalUnlock(h);\r
-               }\r
-               Attach(h);\r
-               return (h != NULL);\r
-       }\r
-\r
-       bool CopyFromHDEVMODE(HANDLE hdm)\r
-       {\r
-               bool b = false;\r
-               if (hdm != NULL)\r
-               {\r
-                       DEVMODE* pdm = (DEVMODE*)::GlobalLock(hdm);\r
-                       b = CopyFromDEVMODE(pdm);\r
-                       ::GlobalUnlock(hdm);\r
-               }\r
-               return b;\r
-       }\r
-\r
-       HANDLE CopyToHDEVMODE()\r
-       {\r
-               if ((m_hDevMode == NULL) || (m_pDevMode == NULL))\r
-                       return NULL;\r
-               int nSize = m_pDevMode->dmSize + m_pDevMode->dmDriverExtra;\r
-               HANDLE h = ::GlobalAlloc(GMEM_MOVEABLE, nSize);\r
-               if (h != NULL)\r
-               {\r
-                       void* p = ::GlobalLock(h);\r
-                       SecureHelper::memcpy_x(p, nSize, m_pDevMode, nSize);\r
-                       ::GlobalUnlock(h);\r
-               }\r
-               return h;\r
-       }\r
-\r
-       // If this devmode was for another printer, this will create a new devmode\r
-       // based on the existing devmode, but retargeted at the new printer\r
-       bool UpdateForNewPrinter(HANDLE hPrinter)\r
-       {\r
-               bool bRet = false;\r
-               LONG nLen = ::DocumentProperties(NULL, hPrinter, NULL, NULL, NULL, 0);\r
-               CTempBuffer<DEVMODE, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               DEVMODE* pdm = buff.AllocateBytes(nLen);\r
-               if(pdm != NULL)\r
-               {\r
-                       memset(pdm, 0, nLen);\r
-                       LONG l = ::DocumentProperties(NULL, hPrinter, NULL, pdm, m_pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER);\r
-                       if (l == IDOK)\r
-                               bRet = CopyFromDEVMODE(pdm);\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-       bool DocumentProperties(HANDLE hPrinter, HWND hWnd = NULL)\r
-       {\r
-               CPrinterInfo<1> pi;\r
-               pi.GetPrinterInfo(hPrinter);\r
-               if (hWnd == NULL)\r
-                       hWnd = ::GetActiveWindow();\r
-\r
-               bool bRet = false;\r
-               LONG nLen = ::DocumentProperties(hWnd, hPrinter, pi.m_pi->pName, NULL, NULL, 0);\r
-               CTempBuffer<DEVMODE, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               DEVMODE* pdm = buff.AllocateBytes(nLen);\r
-               if(pdm != NULL)\r
-               {\r
-                       memset(pdm, 0, nLen);\r
-                       LONG l = ::DocumentProperties(hWnd, hPrinter, pi.m_pi->pName, pdm, m_pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER | DM_PROMPT);\r
-                       if (l == IDOK)\r
-                               bRet = CopyFromDEVMODE(pdm);\r
-               }\r
-\r
-               return bRet;\r
-       }\r
-\r
-       operator HANDLE() const { return m_hDevMode; }\r
-\r
-       operator DEVMODE*() const { return m_pDevMode; }\r
-\r
-// Implementation\r
-       void Cleanup()\r
-       {\r
-               if (m_hDevMode != NULL)\r
-               {\r
-                       ::GlobalUnlock(m_hDevMode);\r
-                       if(t_bManaged)\r
-                               ::GlobalFree(m_hDevMode);\r
-                       m_hDevMode = NULL;\r
-               }\r
-       }\r
-};\r
-\r
-typedef CDevModeT<false>   CDevModeHandle;\r
-typedef CDevModeT<true>    CDevMode;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrinterDC\r
-\r
-class CPrinterDC : public CDC\r
-{\r
-public:\r
-// Constructors/destructor\r
-       CPrinterDC()\r
-       {\r
-               CPrinter printer;\r
-               printer.OpenDefaultPrinter();\r
-               Attach(printer.CreatePrinterDC());\r
-               ATLASSERT(m_hDC != NULL);\r
-       }\r
-\r
-       CPrinterDC(HANDLE hPrinter, const DEVMODE* pdm = NULL)\r
-       {\r
-               CPrinterHandle p;\r
-               p.Attach(hPrinter);\r
-               Attach(p.CreatePrinterDC(pdm));\r
-               ATLASSERT(m_hDC != NULL);\r
-       }\r
-\r
-       ~CPrinterDC()\r
-       {\r
-               DeleteDC();\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrintJob - Wraps a set of tasks for a specific printer (StartDoc/EndDoc)\r
-//             Handles aborting, background printing\r
-\r
-// Defines callbacks used by CPrintJob (not a COM interface)\r
-class ATL_NO_VTABLE IPrintJobInfo\r
-{\r
-public:\r
-       virtual void BeginPrintJob(HDC hDC) = 0;                // allocate handles needed, etc.\r
-       virtual void EndPrintJob(HDC hDC, bool bAborted) = 0;   // free handles, etc.\r
-       virtual void PrePrintPage(UINT nPage, HDC hDC) = 0;\r
-       virtual bool PrintPage(UINT nPage, HDC hDC) = 0;\r
-       virtual void PostPrintPage(UINT nPage, HDC hDC) = 0;\r
-       // If you want per page devmodes, return the DEVMODE* to use for nPage.\r
-       // You can optimize by only returning a new DEVMODE* when it is different\r
-       // from the one for nLastPage, otherwise return NULL.\r
-       // When nLastPage==0, the current DEVMODE* will be the default passed to\r
-       // StartPrintJob.\r
-       // Note: During print preview, nLastPage will always be "0".\r
-       virtual DEVMODE* GetNewDevModeForPage(UINT nLastPage, UINT nPage) = 0;\r
-       virtual bool IsValidPage(UINT nPage) = 0;\r
-};\r
-\r
-// Provides a default implementatin for IPrintJobInfo\r
-// Typically, MI'd into a document or view class\r
-class ATL_NO_VTABLE CPrintJobInfo : public IPrintJobInfo\r
-{\r
-public:\r
-       virtual void BeginPrintJob(HDC /*hDC*/)   // allocate handles needed, etc\r
-       {\r
-       }\r
-\r
-       virtual void EndPrintJob(HDC /*hDC*/, bool /*bAborted*/)   // free handles, etc\r
-       {\r
-       }\r
-\r
-       virtual void PrePrintPage(UINT /*nPage*/, HDC hDC)\r
-       {\r
-               m_nPJState = ::SaveDC(hDC);\r
-       }\r
-\r
-       virtual bool PrintPage(UINT /*nPage*/, HDC /*hDC*/) = 0;\r
-\r
-       virtual void PostPrintPage(UINT /*nPage*/, HDC hDC)\r
-       {\r
-               RestoreDC(hDC, m_nPJState);\r
-       }\r
-\r
-       virtual DEVMODE* GetNewDevModeForPage(UINT /*nLastPage*/, UINT /*nPage*/)\r
-       {\r
-               return NULL;\r
-       }\r
-\r
-       virtual bool IsValidPage(UINT /*nPage*/)\r
-       {\r
-               return true;\r
-       }\r
-\r
-// Implementation - data\r
-       int m_nPJState;\r
-};\r
-\r
-\r
-class CPrintJob\r
-{\r
-public:\r
-// Data members\r
-       CPrinterHandle m_printer;\r
-       IPrintJobInfo* m_pInfo;\r
-       DEVMODE* m_pDefDevMode;\r
-       DOCINFO m_docinfo;\r
-       int m_nJobID;\r
-       bool m_bCancel;\r
-       bool m_bComplete;\r
-       unsigned long m_nStartPage;\r
-       unsigned long m_nEndPage;\r
-\r
-// Constructor/destructor\r
-       CPrintJob() : m_nJobID(0), m_bCancel(false), m_bComplete(true)\r
-       { }\r
-\r
-       ~CPrintJob()\r
-       {\r
-               ATLASSERT(IsJobComplete()); // premature destruction?\r
-       }\r
-\r
-// Operations\r
-       bool IsJobComplete() const\r
-       {\r
-               return m_bComplete;\r
-       }\r
-\r
-       bool StartPrintJob(bool bBackground, HANDLE hPrinter, DEVMODE* pDefaultDevMode,\r
-                       IPrintJobInfo* pInfo, LPCTSTR lpszDocName, \r
-                       unsigned long nStartPage, unsigned long nEndPage,\r
-                       bool bPrintToFile = false, LPCTSTR lpstrOutputFile = NULL)\r
-       {\r
-               ATLASSERT(m_bComplete); // previous job not done yet?\r
-               if (pInfo == NULL)\r
-                       return false;\r
-\r
-               memset(&m_docinfo, 0, sizeof(m_docinfo));\r
-               m_docinfo.cbSize = sizeof(m_docinfo);\r
-               m_docinfo.lpszDocName = lpszDocName;\r
-               m_pInfo = pInfo;\r
-               m_nStartPage = nStartPage;\r
-               m_nEndPage = nEndPage;\r
-               m_printer.Attach(hPrinter);\r
-               m_pDefDevMode = pDefaultDevMode;\r
-               m_bComplete = false;\r
-\r
-               if(bPrintToFile)\r
-                       m_docinfo.lpszOutput = (lpstrOutputFile != NULL) ? lpstrOutputFile : _T("FILE:");\r
-\r
-               if (!bBackground)\r
-               {\r
-                       m_bComplete = true;\r
-                       return StartHelper();\r
-               }\r
-\r
-               // Create a thread and return\r
-               DWORD dwThreadID = 0;\r
-#if !defined(_ATL_MIN_CRT) && defined(_MT)\r
-               HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, (UINT (WINAPI*)(void*))StartProc, this, 0, (UINT*)&dwThreadID);\r
-#else\r
-               HANDLE hThread = ::CreateThread(NULL, 0, StartProc, (void*)this, 0, &dwThreadID);\r
-#endif\r
-               if (hThread == NULL)\r
-                       return false;\r
-\r
-               ::CloseHandle(hThread);\r
-\r
-               return true;\r
-       }\r
-\r
-// Implementation\r
-       static DWORD WINAPI StartProc(void* p)\r
-       {\r
-               CPrintJob* pThis = (CPrintJob*)p;\r
-               pThis->StartHelper();\r
-               pThis->m_bComplete = true;\r
-               return 0;\r
-       }\r
-\r
-       bool StartHelper()\r
-       {\r
-               CDC dcPrinter;\r
-               dcPrinter.Attach(m_printer.CreatePrinterDC(m_pDefDevMode));\r
-               if (dcPrinter.IsNull())\r
-                       return false;\r
-                       \r
-               m_nJobID = ::StartDoc(dcPrinter, &m_docinfo);\r
-               if (m_nJobID <= 0)\r
-                       return false;\r
-\r
-               m_pInfo->BeginPrintJob(dcPrinter);\r
-\r
-               // print all the pages now\r
-               unsigned long nLastPage = 0;\r
-               for (unsigned long nPage = m_nStartPage; nPage <= m_nEndPage; nPage++)\r
-               {\r
-                       if (!m_pInfo->IsValidPage(nPage))\r
-                               break;\r
-                       DEVMODE* pdm = m_pInfo->GetNewDevModeForPage(nLastPage, nPage);\r
-                       if (pdm != NULL)\r
-                               dcPrinter.ResetDC(pdm);\r
-                       dcPrinter.StartPage();\r
-                       m_pInfo->PrePrintPage(nPage, dcPrinter);\r
-                       if (!m_pInfo->PrintPage(nPage, dcPrinter))\r
-                               m_bCancel = true;\r
-                       m_pInfo->PostPrintPage(nPage, dcPrinter);\r
-                       dcPrinter.EndPage();\r
-                       if (m_bCancel)\r
-                               break;\r
-                       nLastPage = nPage;\r
-               }\r
-\r
-               m_pInfo->EndPrintJob(dcPrinter, m_bCancel);\r
-               if (m_bCancel)\r
-                       ::AbortDoc(dcPrinter);\r
-               else\r
-                       ::EndDoc(dcPrinter);\r
-               m_nJobID = 0;\r
-               return true;\r
-       }\r
-\r
-       // Cancels a print job. Can be called asynchronously.\r
-       void CancelPrintJob()\r
-       {\r
-               m_bCancel = true;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrintPreview - Adds print preview support to an existing window\r
-\r
-class CPrintPreview\r
-{\r
-public:\r
-// Data members\r
-       IPrintJobInfo* m_pInfo;\r
-       CPrinterHandle m_printer;\r
-       CEnhMetaFile m_meta;\r
-       DEVMODE* m_pDefDevMode;\r
-       DEVMODE* m_pCurDevMode;\r
-       SIZE m_sizeCurPhysOffset;\r
-\r
-// Constructor\r
-       CPrintPreview() : m_pInfo(NULL), m_pDefDevMode(NULL), m_pCurDevMode(NULL)\r
-       {\r
-               m_sizeCurPhysOffset.cx = 0;\r
-               m_sizeCurPhysOffset.cy = 0;\r
-       }\r
-\r
-// Operations\r
-       void SetPrintPreviewInfo(HANDLE hPrinter, DEVMODE* pDefaultDevMode, IPrintJobInfo* pji)\r
-       {\r
-               m_printer.Attach(hPrinter);\r
-               m_pDefDevMode = pDefaultDevMode;\r
-               m_pInfo = pji;\r
-               m_nCurPage = 0;\r
-               m_pCurDevMode = NULL;\r
-       }\r
-\r
-       void SetEnhMetaFile(HENHMETAFILE hEMF)\r
-       {\r
-               m_meta = hEMF;\r
-       }\r
-\r
-       void SetPage(int nPage)\r
-       {\r
-               if (!m_pInfo->IsValidPage(nPage))\r
-                       return;\r
-               m_nCurPage = nPage;\r
-               m_pCurDevMode = m_pInfo->GetNewDevModeForPage(0, nPage);\r
-               if (m_pCurDevMode == NULL)\r
-                       m_pCurDevMode = m_pDefDevMode;\r
-               CDC dcPrinter = m_printer.CreatePrinterDC(m_pCurDevMode);\r
-\r
-               int iWidth = dcPrinter.GetDeviceCaps(PHYSICALWIDTH); \r
-               int iHeight = dcPrinter.GetDeviceCaps(PHYSICALHEIGHT); \r
-               int nLogx = dcPrinter.GetDeviceCaps(LOGPIXELSX);\r
-               int nLogy = dcPrinter.GetDeviceCaps(LOGPIXELSY);\r
-\r
-               RECT rcMM = { 0, 0, ::MulDiv(iWidth, 2540, nLogx), ::MulDiv(iHeight, 2540, nLogy) };\r
-\r
-               m_sizeCurPhysOffset.cx = dcPrinter.GetDeviceCaps(PHYSICALOFFSETX);\r
-               m_sizeCurPhysOffset.cy = dcPrinter.GetDeviceCaps(PHYSICALOFFSETY);\r
-               \r
-               CEnhMetaFileDC dcMeta(dcPrinter, &rcMM);\r
-               m_pInfo->PrePrintPage(nPage, dcMeta);\r
-               m_pInfo->PrintPage(nPage, dcMeta);\r
-               m_pInfo->PostPrintPage(nPage, dcMeta);\r
-               m_meta.Attach(dcMeta.Close());\r
-       }\r
-\r
-       void GetPageRect(RECT& rc, LPRECT prc)\r
-       {\r
-               int x1 = rc.right-rc.left;\r
-               int y1 = rc.bottom - rc.top;\r
-               if ((x1 < 0) || (y1 < 0))\r
-                       return;\r
-\r
-               CEnhMetaFileInfo emfinfo(m_meta);\r
-               ENHMETAHEADER* pmh = emfinfo.GetEnhMetaFileHeader();\r
-\r
-               // Compute whether we are OK vertically or horizontally\r
-               int x2 = pmh->szlDevice.cx;\r
-               int y2 = pmh->szlDevice.cy;\r
-               int y1p = MulDiv(x1, y2, x2);\r
-               int x1p = MulDiv(y1, x2, y2);\r
-               ATLASSERT((x1p <= x1) || (y1p <= y1));\r
-               if (x1p <= x1)\r
-               {\r
-                       prc->left = rc.left + (x1 - x1p) / 2;\r
-                       prc->right = prc->left + x1p;\r
-                       prc->top = rc.top;\r
-                       prc->bottom = rc.bottom;\r
-               }\r
-               else\r
-               {\r
-                       prc->left = rc.left;\r
-                       prc->right = rc.right;\r
-                       prc->top = rc.top + (y1 - y1p) / 2;\r
-                       prc->bottom = prc->top + y1p;\r
-               }\r
-       }\r
-\r
-// Painting helpers\r
-       void DoPaint(CDCHandle dc)\r
-       {\r
-               // this one is not used\r
-       }\r
-\r
-       void DoPaint(CDCHandle dc, RECT& rc)\r
-       {\r
-               CEnhMetaFileInfo emfinfo(m_meta);\r
-               ENHMETAHEADER* pmh = emfinfo.GetEnhMetaFileHeader();\r
-               int nOffsetX = MulDiv(m_sizeCurPhysOffset.cx, rc.right-rc.left, pmh->szlDevice.cx);\r
-               int nOffsetY = MulDiv(m_sizeCurPhysOffset.cy, rc.bottom-rc.top, pmh->szlDevice.cy);\r
-\r
-               dc.OffsetWindowOrg(-nOffsetX, -nOffsetY);\r
-               dc.PlayMetaFile(m_meta, &rc);\r
-       }\r
-\r
-// Implementation - data\r
-       int m_nCurPage;\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CPrintPreviewWindow - Implements a print preview window\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CPrintPreviewWindowImpl : public ATL::CWindowImpl<T, TBase, TWinTraits>, public CPrintPreview\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(NULL, CS_VREDRAW | CS_HREDRAW, -1)\r
-\r
-       enum { m_cxOffset = 10, m_cyOffset = 10 };\r
-\r
-// Constructor\r
-       CPrintPreviewWindowImpl() : m_nMaxPage(0), m_nMinPage(0)\r
-       { }\r
-\r
-// Operations\r
-       void SetPrintPreviewInfo(HANDLE hPrinter, DEVMODE* pDefaultDevMode, \r
-               IPrintJobInfo* pji, int nMinPage, int nMaxPage)\r
-       {\r
-               CPrintPreview::SetPrintPreviewInfo(hPrinter, pDefaultDevMode, pji);\r
-               m_nMinPage = nMinPage;\r
-               m_nMaxPage = nMaxPage;\r
-       }\r
-\r
-       bool NextPage()\r
-       {\r
-               if (m_nCurPage == m_nMaxPage)\r
-                       return false;\r
-               SetPage(m_nCurPage + 1);\r
-               Invalidate();\r
-               return true;\r
-       }\r
-\r
-       bool PrevPage()\r
-       {\r
-               if (m_nCurPage == m_nMinPage)\r
-                       return false;\r
-               if (m_nCurPage == 0)\r
-                       return false;\r
-               SetPage(m_nCurPage - 1);\r
-               Invalidate();\r
-               return true;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CPrintPreviewWindowImpl)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEraseBkgnd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no need for the background\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               RECT rc = { 0 };\r
-\r
-               if(wParam != NULL)\r
-               {\r
-                       pT->DoPrePaint((HDC)wParam, rc);\r
-                       pT->DoPaint((HDC)wParam, rc);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(m_hWnd);\r
-                       pT->DoPrePaint(dc.m_hDC, rc);\r
-                       pT->DoPaint(dc.m_hDC, rc);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-// Painting helper\r
-       void DoPrePaint(CDCHandle dc, RECT& rc)\r
-       {\r
-               RECT rcClient = { 0 };\r
-               GetClientRect(&rcClient);\r
-               RECT rcArea = rcClient;\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               ::InflateRect(&rcArea, -pT->m_cxOffset, -pT->m_cyOffset);\r
-               if (rcArea.left > rcArea.right)\r
-                       rcArea.right = rcArea.left;\r
-               if (rcArea.top > rcArea.bottom)\r
-                       rcArea.bottom = rcArea.top;\r
-               GetPageRect(rcArea, &rc);\r
-               CRgn rgn1, rgn2;\r
-               rgn1.CreateRectRgnIndirect(&rc);\r
-               rgn2.CreateRectRgnIndirect(&rcClient);\r
-               rgn2.CombineRgn(rgn1, RGN_DIFF);\r
-               dc.SelectClipRgn(rgn2);\r
-               dc.FillRect(&rcClient, COLOR_BTNSHADOW);\r
-               dc.SelectClipRgn(NULL);\r
-               dc.FillRect(&rc, (HBRUSH)::GetStockObject(WHITE_BRUSH));\r
-       }\r
-\r
-// Implementation - data\r
-       int m_nMinPage;\r
-       int m_nMaxPage;\r
-};\r
-\r
-\r
-class CPrintPreviewWindow : public CPrintPreviewWindowImpl<CPrintPreviewWindow>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_PrintPreview"), CS_VREDRAW | CS_HREDRAW, -1)\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CZoomPrintPreviewWindowImpl - Implements print preview window with zooming\r
-\r
-#ifdef __ATLSCRL_H__\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CZoomPrintPreviewWindowImpl : public CPrintPreviewWindowImpl< T, TBase, TWinTraits >, public CZoomScrollImpl< T >\r
-{\r
-public:\r
-       bool m_bSized;\r
-\r
-       CZoomPrintPreviewWindowImpl()  \r
-       {\r
-               SetScrollExtendedStyle(SCRL_DISABLENOSCROLL);\r
-               InitZoom();\r
-       }\r
-\r
-       // should be called to reset data members before recreating window \r
-       void InitZoom()\r
-       {\r
-               m_bSized = false;       \r
-               m_nZoomMode = ZOOMMODE_OFF;\r
-               m_fZoomScaleMin = 1.0;\r
-               m_fZoomScale = 1.0;\r
-       }\r
-\r
-       BEGIN_MSG_MAP(CZoomPrintPreviewWindowImpl)\r
-               MESSAGE_HANDLER(WM_SETCURSOR, CZoomScrollImpl< T >::OnSetCursor)\r
-               MESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, CScrollImpl< T >::OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, CZoomScrollImpl< T >::OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, CZoomScrollImpl< T >::OnMouseMove)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, CZoomScrollImpl< T >::OnLButtonUp)\r
-               MESSAGE_HANDLER(WM_CAPTURECHANGED, CZoomScrollImpl< T >::OnCaptureChanged)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\r
-       END_MSG_MAP()\r
-       \r
-       LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               SIZE sizeClient = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};\r
-               POINT ptOffset = m_ptOffset;\r
-               SIZE sizeAll = m_sizeAll;\r
-               SetScrollSize(sizeClient);\r
-               if(sizeAll.cx > 0)\r
-                       ptOffset.x = ::MulDiv(ptOffset.x, m_sizeAll.cx, sizeAll.cx);\r
-               if(sizeAll.cy > 0)\r
-                       ptOffset.y = ::MulDiv(ptOffset.y, m_sizeAll.cy, sizeAll.cy);\r
-               SetScrollOffset(ptOffset);\r
-               CScrollImpl< T >::OnSize(uMsg, wParam, lParam, bHandled);\r
-               if(!m_bSized)\r
-               {\r
-                       m_bSized = true;\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->ShowScrollBar(SB_HORZ, TRUE);\r
-                       pT->ShowScrollBar(SB_VERT, TRUE);\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEraseBkgnd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               RECT rc = { 0 };\r
-\r
-               if(wParam != NULL)\r
-               {\r
-                       CDCHandle dc = (HDC)wParam;\r
-                       int nMapModeSav = dc.GetMapMode();\r
-                       dc.SetMapMode(MM_ANISOTROPIC);\r
-                       SIZE szWindowExt = { 0, 0 };\r
-                       dc.SetWindowExt(m_sizeLogAll, &szWindowExt);\r
-                       SIZE szViewportExt = { 0, 0 };\r
-                       dc.SetViewportExt(m_sizeAll, &szViewportExt);\r
-                       POINT ptViewportOrg = { 0, 0 };\r
-                       dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y, &ptViewportOrg);\r
-\r
-                       pT->DoPrePaint(dc, rc);\r
-                       pT->DoPaint(dc, rc);\r
-\r
-                       dc.SetMapMode(nMapModeSav);\r
-                       dc.SetWindowExt(szWindowExt);\r
-                       dc.SetViewportExt(szViewportExt);\r
-                       dc.SetViewportOrg(ptViewportOrg);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       pT->PrepareDC(dc.m_hDC);\r
-                       pT->DoPrePaint(dc.m_hDC, rc);\r
-                       pT->DoPaint(dc.m_hDC, rc);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       // Painting helpers\r
-       void DoPaint(CDCHandle dc)\r
-       {\r
-               // this one is not used\r
-       }\r
-\r
-       void DoPrePaint(CDCHandle dc, RECT& rc)\r
-       {\r
-               RECT rcClient;\r
-               GetClientRect(&rcClient);\r
-               RECT rcArea = rcClient;\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               ::InflateRect(&rcArea, -pT->m_cxOffset, -pT->m_cyOffset);\r
-               if (rcArea.left > rcArea.right)\r
-                       rcArea.right = rcArea.left;\r
-               if (rcArea.top > rcArea.bottom)\r
-                       rcArea.bottom = rcArea.top;\r
-               GetPageRect(rcArea, &rc);\r
-               HBRUSH hbrOld = dc.SelectBrush(::GetSysColorBrush(COLOR_BTNSHADOW));\r
-               dc.PatBlt(rcClient.left, rcClient.top, rc.left - rcClient.left, rcClient.bottom - rcClient.top, PATCOPY);\r
-               dc.PatBlt(rc.left, rcClient.top, rc.right - rc.left, rc.top - rcClient.top, PATCOPY);\r
-               dc.PatBlt(rc.right, rcClient.top, rcClient.right - rc.right, rcClient.bottom - rcClient.top, PATCOPY);\r
-               dc.PatBlt(rc.left, rc.bottom, rc.right - rc.left, rcClient.bottom - rc.bottom, PATCOPY);\r
-               dc.SelectBrush((HBRUSH)::GetStockObject(WHITE_BRUSH));\r
-               dc.PatBlt(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);\r
-               dc.SelectBrush(::GetSysColorBrush(COLOR_3DDKSHADOW));\r
-               dc.PatBlt(rc.right, rc.top + 4, 4, rc.bottom - rc.top, PATCOPY);\r
-               dc.PatBlt(rc.left + 4, rc.bottom, rc.right - rc.left, 4, PATCOPY);\r
-               dc.SelectBrush(hbrOld);\r
-       }\r
-\r
-       void DoPaint(CDCHandle dc, RECT& rc)\r
-       {\r
-               CEnhMetaFileInfo emfinfo(m_meta);\r
-               ENHMETAHEADER* pmh = emfinfo.GetEnhMetaFileHeader();\r
-               int nOffsetX = MulDiv(m_sizeCurPhysOffset.cx, rc.right-rc.left, pmh->szlDevice.cx);\r
-               int nOffsetY = MulDiv(m_sizeCurPhysOffset.cy, rc.bottom-rc.top, pmh->szlDevice.cy);\r
-\r
-               dc.OffsetWindowOrg(-nOffsetX, -nOffsetY);\r
-               dc.PlayMetaFile(m_meta, &rc);\r
-       }\r
-};\r
-\r
-class CZoomPrintPreviewWindow : public CZoomPrintPreviewWindowImpl<CZoomPrintPreviewWindow>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_ZoomPrintPreview"), CS_VREDRAW | CS_HREDRAW, -1)\r
-};\r
-\r
-#endif // __ATLSCRL_H__\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLPRINT_H__\r
diff --git a/WTL80/include/atlres.h b/WTL80/include/atlres.h
deleted file mode 100644 (file)
index ae05887..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLRES_H__\r
-#define __ATLRES_H__\r
-\r
-#pragma once\r
-\r
-#if defined(_WIN32_WCE) && !defined(__ATLRESCE_H__)\r
-       #error Use atlresCE.h instead of atlres.h for Windows CE\r
-#endif\r
-\r
-\r
-#ifdef RC_INVOKED\r
-#ifndef _INC_WINDOWS\r
-\r
-  #define _INC_WINDOWS\r
-\r
-  #ifndef _WIN32_WCE\r
-    #define VS_VERSION_INFO     1\r
-\r
-    #ifdef APSTUDIO_INVOKED\r
-      #define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols\r
-    #endif // APSTUDIO_INVOKED\r
-\r
-    #ifndef WINVER\r
-      #define WINVER 0x0400   // default to Windows Version 4.0\r
-    #endif // !WINVER\r
-\r
-    #include <winresrc.h>\r
-\r
-    // operation messages sent to DLGINIT\r
-    #define LB_ADDSTRING    (WM_USER+1)\r
-    #define CB_ADDSTRING    (WM_USER+3)\r
-  #endif // !_WIN32_WCE\r
-\r
-  #ifdef APSTUDIO_INVOKED\r
-    #undef APSTUDIO_HIDDEN_SYMBOLS\r
-  #endif // APSTUDIO_INVOKED\r
-\r
-  #ifdef IDC_STATIC\r
-    #undef IDC_STATIC\r
-  #endif // IDC_STATIC\r
-  #define IDC_STATIC      (-1)\r
-\r
-#endif // !_INC_WINDOWS\r
-#endif // RC_INVOKED\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-  #define APSTUDIO_HIDDEN_SYMBOLS\r
-#endif // APSTUDIO_INVOKED\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// ATL resource types\r
-\r
-#ifndef RC_INVOKED\r
-  #define RT_DLGINIT  MAKEINTRESOURCE(240)\r
-  #define RT_TOOLBAR  MAKEINTRESOURCE(241)\r
-#endif // RC_INVOKED\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-  #undef APSTUDIO_HIDDEN_SYMBOLS\r
-#endif // APSTUDIO_INVOKED\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Standard window components\r
-\r
-#define ID_SEPARATOR                    0       // special separator value\r
-#define ID_DEFAULT_PANE                 0       // default status bar pane\r
-\r
-#ifndef RC_INVOKED  // code only\r
-// standard control bars (IDW = window ID)\r
-  #define ATL_IDW_TOOLBAR               0xE800  // main Toolbar for window\r
-  #define ATL_IDW_STATUS_BAR            0xE801  // Status bar window\r
-  #define ATL_IDW_COMMAND_BAR           0xE802  // Command bar window\r
-\r
-// parts of a frame window\r
-  #define ATL_IDW_CLIENT                0xE900\r
-  #define ATL_IDW_PANE_FIRST            0xE900  // first pane (256 max)\r
-  #define ATL_IDW_PANE_LAST             0xE9FF\r
-  #define ATL_IDW_HSCROLL_FIRST         0xEA00  // first Horz scrollbar (16 max)\r
-  #define ATL_IDW_VSCROLL_FIRST         0xEA10  // first Vert scrollbar (16 max)\r
-\r
-  #define ATL_IDW_SIZE_BOX              0xEA20  // size box for splitters\r
-  #define ATL_IDW_PANE_SAVE             0xEA21  // to shift ATL_IDW_PANE_FIRST\r
-\r
-// bands for a rebar\r
-  #define ATL_IDW_BAND_FIRST            0xEB00\r
-  #define ATL_IDW_BAND_LAST             0xEBFF\r
-#endif // !RC_INVOKED\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Standard Commands\r
-\r
-// File commands\r
-#define ID_FILE_NEW                     0xE100\r
-#define ID_FILE_OPEN                    0xE101\r
-#define ID_FILE_CLOSE                   0xE102\r
-#define ID_FILE_SAVE                    0xE103\r
-#define ID_FILE_SAVE_AS                 0xE104\r
-#define ID_FILE_PAGE_SETUP              0xE105\r
-#define ID_FILE_PRINT_SETUP             0xE106\r
-#define ID_FILE_PRINT                   0xE107\r
-#define ID_FILE_PRINT_DIRECT            0xE108\r
-#define ID_FILE_PRINT_PREVIEW           0xE109\r
-#define ID_FILE_UPDATE                  0xE10A\r
-#define ID_FILE_SAVE_COPY_AS            0xE10B\r
-#define ID_FILE_SEND_MAIL               0xE10C\r
-\r
-#define ID_FILE_MRU_FIRST               0xE110\r
-#define ID_FILE_MRU_FILE1               0xE110          // range - 16 max\r
-#define ID_FILE_MRU_FILE2               0xE111\r
-#define ID_FILE_MRU_FILE3               0xE112\r
-#define ID_FILE_MRU_FILE4               0xE113\r
-#define ID_FILE_MRU_FILE5               0xE114\r
-#define ID_FILE_MRU_FILE6               0xE115\r
-#define ID_FILE_MRU_FILE7               0xE116\r
-#define ID_FILE_MRU_FILE8               0xE117\r
-#define ID_FILE_MRU_FILE9               0xE118\r
-#define ID_FILE_MRU_FILE10              0xE119\r
-#define ID_FILE_MRU_FILE11              0xE11A\r
-#define ID_FILE_MRU_FILE12              0xE11B\r
-#define ID_FILE_MRU_FILE13              0xE11C\r
-#define ID_FILE_MRU_FILE14              0xE11D\r
-#define ID_FILE_MRU_FILE15              0xE11E\r
-#define ID_FILE_MRU_FILE16              0xE11F\r
-#define ID_FILE_MRU_LAST                0xE11F\r
-\r
-// Edit commands\r
-#define ID_EDIT_CLEAR                   0xE120\r
-#define ID_EDIT_CLEAR_ALL               0xE121\r
-#define ID_EDIT_COPY                    0xE122\r
-#define ID_EDIT_CUT                     0xE123\r
-#define ID_EDIT_FIND                    0xE124\r
-#define ID_EDIT_PASTE                   0xE125\r
-#define ID_EDIT_PASTE_LINK              0xE126\r
-#define ID_EDIT_PASTE_SPECIAL           0xE127\r
-#define ID_EDIT_REPEAT                  0xE128\r
-#define ID_EDIT_REPLACE                 0xE129\r
-#define ID_EDIT_SELECT_ALL              0xE12A\r
-#define ID_EDIT_UNDO                    0xE12B\r
-#define ID_EDIT_REDO                    0xE12C\r
-\r
-// Window commands\r
-#define ID_WINDOW_NEW                   0xE130\r
-#define ID_WINDOW_ARRANGE               0xE131\r
-#define ID_WINDOW_CASCADE               0xE132\r
-#define ID_WINDOW_TILE_HORZ             0xE133\r
-#define ID_WINDOW_TILE_VERT             0xE134\r
-#define ID_WINDOW_SPLIT                 0xE135\r
-#ifndef RC_INVOKED      // code only\r
-  #define ATL_IDM_WINDOW_FIRST          0xE130\r
-  #define ATL_IDM_WINDOW_LAST           0xE13F\r
-  #define ATL_IDM_FIRST_MDICHILD        0xFF00  // window list starts here\r
-  #define ATL_IDM_LAST_MDICHILD         0xFFFD\r
-#endif // !RC_INVOKED\r
-// TabView\r
-#define ID_WINDOW_TABFIRST              0xFF00 // = ATL_IDM_FIRST_MDICHILD\r
-#define ID_WINDOW_TABLAST               0xFFFD\r
-#define ID_WINDOW_SHOWTABLIST           0xFFFE\r
-\r
-// Help and App commands\r
-#define ID_APP_ABOUT                    0xE140\r
-#define ID_APP_EXIT                     0xE141\r
-#define ID_HELP_INDEX                   0xE142\r
-#define ID_HELP_FINDER                  0xE143\r
-#define ID_HELP_USING                   0xE144\r
-#define ID_CONTEXT_HELP                 0xE145      // shift-F1\r
-// special commands for processing help\r
-#define ID_HELP                         0xE146      // first attempt for F1\r
-#define ID_DEFAULT_HELP                 0xE147      // last attempt\r
-\r
-// Misc\r
-#define ID_NEXT_PANE                    0xE150\r
-#define ID_PREV_PANE                    0xE151\r
-#define ID_PANE_CLOSE                   0xE152\r
-\r
-// Format\r
-#define ID_FORMAT_FONT                  0xE160\r
-\r
-// Scroll\r
-#define ID_SCROLL_UP                    0xE170\r
-#define ID_SCROLL_DOWN                  0xE171\r
-#define ID_SCROLL_PAGE_UP               0xE172\r
-#define ID_SCROLL_PAGE_DOWN             0xE173\r
-#define ID_SCROLL_TOP                   0xE174\r
-#define ID_SCROLL_BOTTOM                0xE175\r
-#define ID_SCROLL_LEFT                  0xE176\r
-#define ID_SCROLL_RIGHT                 0xE177\r
-#define ID_SCROLL_PAGE_LEFT             0xE178\r
-#define ID_SCROLL_PAGE_RIGHT            0xE179\r
-#define ID_SCROLL_ALL_LEFT              0xE17A\r
-#define ID_SCROLL_ALL_RIGHT             0xE17B\r
-\r
-// OLE commands\r
-#define ID_OLE_INSERT_NEW               0xE200\r
-#define ID_OLE_EDIT_LINKS               0xE201\r
-#define ID_OLE_EDIT_CONVERT             0xE202\r
-#define ID_OLE_EDIT_CHANGE_ICON         0xE203\r
-#define ID_OLE_EDIT_PROPERTIES          0xE204\r
-#define ID_OLE_VERB_FIRST               0xE210     // range - 16 max\r
-#ifndef RC_INVOKED      // code only\r
-  #define ID_OLE_VERB_LAST              0xE21F\r
-#endif // !RC_INVOKED\r
-\r
-// View commands (same number used as IDW used for toolbar and status bar)\r
-#define ID_VIEW_TOOLBAR                 0xE800\r
-#define ID_VIEW_STATUS_BAR              0xE801\r
-#define ID_VIEW_REFRESH                 0xE803\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Standard control IDs\r
-\r
-#ifdef IDC_STATIC\r
-  #undef IDC_STATIC\r
-#endif // IDC_STATIC\r
-#define IDC_STATIC              (-1)     // all static controls\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Standard string error/warnings\r
-\r
-// idle status bar message\r
-#define ATL_IDS_IDLEMESSAGE             0xE001\r
-\r
-#ifndef RC_INVOKED      // code only\r
-  #define ATL_IDS_SCFIRST               0xEF00\r
-#endif // !RC_INVOKED\r
-\r
-#define ATL_IDS_SCSIZE                  0xEF00\r
-#define ATL_IDS_SCMOVE                  0xEF01\r
-#define ATL_IDS_SCMINIMIZE              0xEF02\r
-#define ATL_IDS_SCMAXIMIZE              0xEF03\r
-#define ATL_IDS_SCNEXTWINDOW            0xEF04\r
-#define ATL_IDS_SCPREVWINDOW            0xEF05\r
-#define ATL_IDS_SCCLOSE                 0xEF06\r
-#define ATL_IDS_SCRESTORE               0xEF12\r
-#define ATL_IDS_SCTASKLIST              0xEF13\r
-\r
-#define ATL_IDS_MDICHILD                0xEF1F\r
-#define ATL_IDS_MRU_FILE                0xEFDA\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Misc. control IDs\r
-\r
-// Property Sheet control id's (determined with Spy++)\r
-#define ID_APPLY_NOW                    0x3021\r
-#define ID_WIZBACK                      0x3023\r
-#define ID_WIZNEXT                      0x3024\r
-#define ID_WIZFINISH                    0x3025\r
-#define ATL_IDC_TAB_CONTROL             0x3020\r
-\r
-#endif // __ATLRES_H__\r
diff --git a/WTL80/include/atlresce.h b/WTL80/include/atlresce.h
deleted file mode 100644 (file)
index 64346b1..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLRESCE_H__\r
-#define __ATLRESCE_H__\r
-\r
-#pragma once\r
-\r
-#ifndef _WIN32_WCE\r
-       #error atlresCE.h is only for Windows CE\r
-#endif\r
-\r
-\r
-#ifdef RC_INVOKED\r
-#ifndef _INC_WINDOWS\r
-\r
-  #define VS_VERSION_INFO     1\r
-\r
-  #ifdef APSTUDIO_INVOKED\r
-    #define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols\r
-  #endif // APSTUDIO_INVOKED\r
-\r
-  #ifndef WINVER\r
-    #define WINVER 0x0400   // default to Windows Version 4.0\r
-  #endif // !WINVER\r
-\r
-  #if !defined(WCEOLE_ENABLE_DIALOGEX)\r
-    #define DIALOGEX DIALOG DISCARDABLE\r
-  #endif\r
-\r
-  #include <commctrl.h>\r
-  #define  SHMENUBAR RCDATA\r
-\r
-  #if defined(SHELLSDK_MODULES_AYGSHELL)\r
-    #include <aygshell.h> \r
-  #else\r
-    #define NOMENU                 0xFFFF\r
-    #define IDS_SHNEW              1\r
-    #define IDM_SHAREDNEW          10\r
-    #define IDM_SHAREDNEWDEFAULT   11\r
-  #endif\r
-  #ifndef I_IMAGENONE\r
-       #define I_IMAGENONE            (-2)\r
-  #endif\r
-\r
-  #include <windows.h>\r
-\r
-#endif // !_INC_WINDOWS\r
-#endif // RC_INVOKED\r
-\r
-#include "atlres.h"\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-       #undef APSTUDIO_HIDDEN_SYMBOLS\r
-#endif // APSTUDIO_INVOKED\r
-\r
-// Visual Studio dialog editor bug fix\r
-#ifndef DS_FIXEDSYS \r
-       #define DS_FIXEDSYS 0\r
-#endif\r
-\r
-#define IDC_INFOSTATIC 0xFFFE   // == IDC_STATIC -1\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Smartphone and PPC 2005 Resource IDs\r
-\r
-// Command and associated string resource IDs\r
-#define ID_MENU_OK                      0xE790\r
-#define ID_MENU_CANCEL                  0xE791\r
-#define ID_MENU                                                        0xE792\r
-#define ID_ACTION                                              0xE793\r
-#define ID_VIEW_FULLSCREEN              0xE802\r
-\r
-// MenuBar resource IDs\r
-#define ATL_IDM_MENU_DONE               0xE701\r
-#define ATL_IDM_MENU_CANCEL             0xE702\r
-#define ATL_IDM_MENU_DONECANCEL         0xE703\r
-\r
-// Default device MenuBar control ID and MenuBar resource ID\r
-#define ATL_IDW_MENU_BAR                               0xE802  \r
-\r
-// SmartPhone spinned controls ID offset for CSpinCtrl\r
-#define ATL_IDW_SPIN_ID                 9999\r
-\r
-#endif // __ATLRESCE_H__\r
diff --git a/WTL80/include/atlscrl.h b/WTL80/include/atlscrl.h
deleted file mode 100644 (file)
index 9eb32ed..0000000
+++ /dev/null
@@ -1,2015 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLSCRL_H__\r
-#define __ATLSCRL_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlscrl.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atlscrl.h requires atlwin.h to be included first\r
-#endif\r
-\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-  #include <zmouse.h>\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-\r
-#ifndef GET_WHEEL_DELTA_WPARAM\r
-  #define GET_WHEEL_DELTA_WPARAM(wParam)  ((short)HIWORD(wParam))\r
-#endif\r
-\r
-#ifndef WM_MOUSEHWHEEL\r
-  #define WM_MOUSEHWHEEL                  0x020E\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CScrollImpl<T>\r
-// CScrollWindowImpl<T, TBase, TWinTraits>\r
-// CMapScrollImpl<T>\r
-// CMapScrollWindowImpl<T, TBase, TWinTraits>\r
-// CFSBWindowT<TBase>\r
-// CZoomScrollImpl<T>\r
-// CZoomScrollWindowImpl<T, TBase, TWinTraits>\r
-// CScrollContainerImpl<T, TBase, TWinTraits>\r
-// CScrollContainer\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CScrollImpl - Provides scrolling support to any window\r
-\r
-// Scroll extended styles\r
-#define SCRL_SCROLLCHILDREN    0x00000001\r
-#define SCRL_ERASEBACKGROUND   0x00000002\r
-#define SCRL_NOTHUMBTRACKING   0x00000004\r
-#if (WINVER >= 0x0500)\r
-#define SCRL_SMOOTHSCROLL      0x00000008\r
-#endif // (WINVER >= 0x0500)\r
-#define SCRL_DISABLENOSCROLLV  0x00000010\r
-#define SCRL_DISABLENOSCROLLH  0x00000020\r
-#define SCRL_DISABLENOSCROLL   (SCRL_DISABLENOSCROLLV | SCRL_DISABLENOSCROLLH)\r
-\r
-\r
-template <class T>\r
-class CScrollImpl\r
-{\r
-public:\r
-       enum { uSCROLL_FLAGS = SW_INVALIDATE };\r
-\r
-       POINT m_ptOffset;\r
-       SIZE m_sizeAll;\r
-       SIZE m_sizeLine;\r
-       SIZE m_sizePage;\r
-       SIZE m_sizeClient;\r
-       int m_zDelta;              // current wheel value\r
-       int m_nWheelLines;         // number of lines to scroll on wheel\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-       // Note that this message must be forwarded from a top level window\r
-       UINT m_uMsgMouseWheel;     // MSH_MOUSEWHEEL\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-       int m_zHDelta;              // current horizontal wheel value\r
-       int m_nHWheelChars;         // number of chars to scroll on horizontal wheel\r
-       UINT m_uScrollFlags;\r
-       DWORD m_dwExtendedStyle;   // scroll specific extended styles\r
-\r
-// Constructor\r
-       CScrollImpl() : m_zDelta(0), m_nWheelLines(3), \r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-                       m_uMsgMouseWheel(0U), \r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-                       m_zHDelta(0), m_nHWheelChars(3), \r
-                       m_uScrollFlags(0U), m_dwExtendedStyle(0)\r
-       {\r
-               m_ptOffset.x = 0;\r
-               m_ptOffset.y = 0;\r
-               m_sizeAll.cx = 0;\r
-               m_sizeAll.cy = 0;\r
-               m_sizePage.cx = 0;\r
-               m_sizePage.cy = 0;\r
-               m_sizeLine.cx = 0;\r
-               m_sizeLine.cy = 0;\r
-               m_sizeClient.cx = 0;\r
-               m_sizeClient.cy = 0;\r
-\r
-               SetScrollExtendedStyle(SCRL_SCROLLCHILDREN | SCRL_ERASEBACKGROUND);\r
-       }\r
-\r
-// Attributes & Operations\r
-       DWORD GetScrollExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-       DWORD SetScrollExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               // cache scroll flags\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               m_uScrollFlags = pT->uSCROLL_FLAGS | (IsScrollingChildren() ? SW_SCROLLCHILDREN : 0) | (IsErasingBackground() ? SW_ERASE : 0);\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-               m_uScrollFlags |= (IsSmoothScroll() ? SW_SMOOTHSCROLL : 0);\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-               return dwPrevStyle;\r
-       }\r
-\r
-       // offset operations\r
-       void SetScrollOffset(int x, int y, BOOL bRedraw = TRUE)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               pT->AdjustScrollOffset(x, y);\r
-\r
-               int dx = m_ptOffset.x - x;\r
-               int dy = m_ptOffset.y - y;\r
-               m_ptOffset.x = x;\r
-               m_ptOffset.y = y;\r
-\r
-               // block: set horizontal scroll bar\r
-               {\r
-                       SCROLLINFO si = { sizeof(SCROLLINFO) };\r
-                       si.fMask = SIF_POS;\r
-                       if((m_dwExtendedStyle & SCRL_DISABLENOSCROLLH) != 0)\r
-                               si.fMask |= SIF_DISABLENOSCROLL;\r
-                       si.nPos = m_ptOffset.x;\r
-                       pT->SetScrollInfo(SB_HORZ, &si, bRedraw);\r
-               }\r
-\r
-               // block: set vertical scroll bar\r
-               {\r
-                       SCROLLINFO si = { sizeof(SCROLLINFO) };\r
-                       si.fMask = SIF_POS;\r
-                       if((m_dwExtendedStyle & SCRL_DISABLENOSCROLLV) != 0)\r
-                               si.fMask |= SIF_DISABLENOSCROLL;\r
-                       si.nPos = m_ptOffset.y;\r
-                       pT->SetScrollInfo(SB_VERT, &si, bRedraw);\r
-               }\r
-\r
-               // Move all children if needed\r
-               if(IsScrollingChildren() && (dx != 0 || dy != 0))\r
-               {\r
-                       for(HWND hWndChild = ::GetWindow(pT->m_hWnd, GW_CHILD); hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))\r
-                       {\r
-                               RECT rect = { 0 };\r
-                               ::GetWindowRect(hWndChild, &rect);\r
-                               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 1);\r
-                               ::SetWindowPos(hWndChild, NULL, rect.left + dx, rect.top + dy, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\r
-                       }\r
-               }\r
-\r
-               if(bRedraw)\r
-                       pT->Invalidate();\r
-       }\r
-\r
-       void SetScrollOffset(POINT ptOffset, BOOL bRedraw = TRUE)\r
-       {\r
-               SetScrollOffset(ptOffset.x, ptOffset.y, bRedraw);\r
-       }\r
-\r
-       void GetScrollOffset(POINT& ptOffset) const\r
-       {\r
-               ptOffset = m_ptOffset;\r
-       }\r
-\r
-       // size operations\r
-       void SetScrollSize(int cx, int cy, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               m_sizeAll.cx = cx;\r
-               m_sizeAll.cy = cy;\r
-\r
-               int x = 0;\r
-               int y = 0;\r
-               if(!bResetOffset)\r
-               {\r
-                       x = m_ptOffset.x;\r
-                       y = m_ptOffset.y;\r
-                       pT->AdjustScrollOffset(x, y);\r
-               }\r
-\r
-               int dx = m_ptOffset.x - x;\r
-               int dy = m_ptOffset.y - y;\r
-               m_ptOffset.x = x;\r
-               m_ptOffset.y = y;\r
-\r
-               // block: set horizontal scroll bar\r
-               {\r
-                       SCROLLINFO si = { sizeof(SCROLLINFO) };\r
-                       si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\r
-                       if((m_dwExtendedStyle & SCRL_DISABLENOSCROLLH) != 0)\r
-                               si.fMask |= SIF_DISABLENOSCROLL;\r
-                       si.nMin = 0;\r
-                       si.nMax = m_sizeAll.cx - 1;\r
-                       si.nPage = m_sizeClient.cx;\r
-                       si.nPos = m_ptOffset.x;\r
-                       pT->SetScrollInfo(SB_HORZ, &si, bRedraw);\r
-               }\r
-\r
-               // block: set vertical scroll bar\r
-               {\r
-                       SCROLLINFO si = { sizeof(SCROLLINFO) };\r
-                       si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\r
-                       if((m_dwExtendedStyle & SCRL_DISABLENOSCROLLV) != 0)\r
-                               si.fMask |= SIF_DISABLENOSCROLL;\r
-                       si.nMin = 0;\r
-                       si.nMax = m_sizeAll.cy - 1;\r
-                       si.nPage = m_sizeClient.cy;\r
-                       si.nPos = m_ptOffset.y;\r
-                       pT->SetScrollInfo(SB_VERT, &si, bRedraw);\r
-               }\r
-\r
-               // Move all children if needed\r
-               if(IsScrollingChildren() && (dx != 0 || dy != 0))\r
-               {\r
-                       for(HWND hWndChild = ::GetWindow(pT->m_hWnd, GW_CHILD); hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))\r
-                       {\r
-                               RECT rect = { 0 };\r
-                               ::GetWindowRect(hWndChild, &rect);\r
-                               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 1);\r
-                               ::SetWindowPos(hWndChild, NULL, rect.left + dx, rect.top + dy, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);\r
-                       }\r
-               }\r
-\r
-               SetScrollLine(0, 0);\r
-               SetScrollPage(0, 0);\r
-\r
-               if(bRedraw)\r
-                       pT->Invalidate();\r
-       }\r
-\r
-       void SetScrollSize(SIZE size, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               SetScrollSize(size.cx, size.cy, bRedraw, bResetOffset);\r
-       }\r
-\r
-       void GetScrollSize(SIZE& sizeWnd) const\r
-       {\r
-               sizeWnd = m_sizeAll;\r
-       }\r
-\r
-       // line operations\r
-       void SetScrollLine(int cxLine, int cyLine)\r
-       {\r
-               ATLASSERT(cxLine >= 0 && cyLine >= 0);\r
-               ATLASSERT(m_sizeAll.cx != 0 && m_sizeAll.cy != 0);\r
-\r
-               m_sizeLine.cx = T::CalcLineOrPage(cxLine, m_sizeAll.cx, 100);\r
-               m_sizeLine.cy = T::CalcLineOrPage(cyLine, m_sizeAll.cy, 100);\r
-       }\r
-\r
-       void SetScrollLine(SIZE sizeLine)\r
-       {\r
-               SetScrollLine(sizeLine.cx, sizeLine.cy);\r
-       }\r
-\r
-       void GetScrollLine(SIZE& sizeLine) const\r
-       {\r
-               sizeLine = m_sizeLine;\r
-       }\r
-\r
-       // page operations\r
-       void SetScrollPage(int cxPage, int cyPage)\r
-       {\r
-               ATLASSERT(cxPage >= 0 && cyPage >= 0);\r
-               ATLASSERT(m_sizeAll.cx != 0 && m_sizeAll.cy != 0);\r
-\r
-               m_sizePage.cx = T::CalcLineOrPage(cxPage, m_sizeAll.cx, 10);\r
-               m_sizePage.cy = T::CalcLineOrPage(cyPage, m_sizeAll.cy, 10);\r
-       }\r
-\r
-       void SetScrollPage(SIZE sizePage)\r
-       {\r
-               SetScrollPage(sizePage.cx, sizePage.cy);\r
-       }\r
-\r
-       void GetScrollPage(SIZE& sizePage) const\r
-       {\r
-               sizePage = m_sizePage;\r
-       }\r
-\r
-       // commands\r
-       void ScrollLineDown()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, SB_LINEDOWN, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-       }\r
-\r
-       void ScrollLineUp()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, SB_LINEUP, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-       }\r
-\r
-       void ScrollPageDown()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, SB_PAGEDOWN, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-       }\r
-\r
-       void ScrollPageUp()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, SB_PAGEUP, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-       }\r
-\r
-       void ScrollTop()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, SB_TOP, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-       }\r
-\r
-       void ScrollBottom()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, SB_BOTTOM, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-       }\r
-\r
-       void ScrollLineRight()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, SB_LINEDOWN, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-       }\r
-\r
-       void ScrollLineLeft()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, SB_LINEUP, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-       }\r
-\r
-       void ScrollPageRight()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, SB_PAGEDOWN, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-       }\r
-\r
-       void ScrollPageLeft()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, SB_PAGEUP, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-       }\r
-\r
-       void ScrollAllLeft()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, SB_TOP, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-       }\r
-\r
-       void ScrollAllRight()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, SB_BOTTOM, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-       }\r
-\r
-       // scroll to make point/view/window visible\r
-       void ScrollToView(POINT pt)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               RECT rect = { pt.x, pt.y, pt.x, pt.y };\r
-               pT->ScrollToView(rect);\r
-       }\r
-\r
-       void ScrollToView(RECT& rect)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               RECT rcClient = { 0 };\r
-               pT->GetClientRect(&rcClient);\r
-\r
-               int x = m_ptOffset.x;\r
-               if(rect.left < m_ptOffset.x)\r
-                       x = rect.left;\r
-               else if(rect.right > (m_ptOffset.x + rcClient.right))\r
-                       x = rect.right - rcClient.right;\r
-\r
-               int y = m_ptOffset.y;\r
-               if(rect.top < m_ptOffset.y)\r
-                       y = rect.top;\r
-               else if(rect.bottom > (m_ptOffset.y + rcClient.bottom))\r
-                       y = rect.bottom - rcClient.bottom;\r
-\r
-               SetScrollOffset(x, y);\r
-       }\r
-\r
-       void ScrollToView(HWND hWnd)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               RECT rect = { 0 };\r
-               ::GetWindowRect(hWnd, &rect);\r
-               ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rect, 2);\r
-               ScrollToView(rect);\r
-       }\r
-\r
-       BEGIN_MSG_MAP(CScrollImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_VSCROLL, OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-               MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnMouseHWheel)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-#endif // !_WIN32_WCE\r
-       // standard scroll commands\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, OnScrollAllRight)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               GetSystemSettings();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnVScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_VERT, (int)(short)LOWORD(wParam), (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnHScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               pT->DoScroll(SB_HORZ, (int)(short)LOWORD(wParam), (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnMouseWheel(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) || defined(_WIN32_WCE)\r
-               uMsg;\r
-               int zDelta = (int)GET_WHEEL_DELTA_WPARAM(wParam);\r
-#else\r
-               int zDelta = (uMsg == WM_MOUSEWHEEL) ? (int)GET_WHEEL_DELTA_WPARAM(wParam) : (int)wParam;\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) || defined(_WIN32_WCE))\r
-               int nScrollCode = (m_nWheelLines == WHEEL_PAGESCROLL) ? ((zDelta > 0) ? SB_PAGEUP : SB_PAGEDOWN) : ((zDelta > 0) ? SB_LINEUP : SB_LINEDOWN);\r
-               m_zDelta += zDelta;   // cumulative\r
-               int zTotal = (m_nWheelLines == WHEEL_PAGESCROLL) ? abs(m_zDelta) : abs(m_zDelta) * m_nWheelLines;\r
-               if(m_sizeAll.cy > m_sizeClient.cy)\r
-               {\r
-                       for(int i = 0; i < zTotal; i += WHEEL_DELTA)\r
-                       {\r
-                               pT->DoScroll(SB_VERT, nScrollCode, (int&)m_ptOffset.y, m_sizeAll.cy, m_sizePage.cy, m_sizeLine.cy);\r
-                               pT->UpdateWindow();\r
-                       }\r
-               }\r
-               else            // can't scroll vertically, scroll horizontally\r
-               {\r
-                       for(int i = 0; i < zTotal; i += WHEEL_DELTA)\r
-                       {\r
-                               pT->DoScroll(SB_HORZ, nScrollCode, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-                               pT->UpdateWindow();\r
-                       }\r
-               }\r
-               m_zDelta %= WHEEL_DELTA;\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnMouseHWheel(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               int zDelta = (int)GET_WHEEL_DELTA_WPARAM(wParam);\r
-               int nScrollCode = (m_nHWheelChars == WHEEL_PAGESCROLL) ? ((zDelta > 0) ? SB_PAGERIGHT : SB_PAGELEFT) : ((zDelta > 0) ? SB_LINERIGHT : SB_LINELEFT);\r
-               m_zHDelta += zDelta;   // cumulative\r
-               int zTotal = (m_nHWheelChars == WHEEL_PAGESCROLL) ? abs(m_zHDelta) : abs(m_zHDelta) * m_nHWheelChars;\r
-               if(m_sizeAll.cx > m_sizeClient.cx)\r
-               {\r
-                       for(int i = 0; i < zTotal; i += WHEEL_DELTA)\r
-                       {\r
-                               pT->DoScroll(SB_HORZ, nScrollCode, (int&)m_ptOffset.x, m_sizeAll.cx, m_sizePage.cx, m_sizeLine.cx);\r
-                               pT->UpdateWindow();\r
-                       }\r
-               }\r
-               m_zHDelta %= WHEEL_DELTA;\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               GetSystemSettings();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               m_sizeClient.cx = GET_X_LPARAM(lParam);\r
-               m_sizeClient.cy = GET_Y_LPARAM(lParam);\r
-\r
-               // block: set horizontal scroll bar\r
-               {\r
-                       SCROLLINFO si = { sizeof(SCROLLINFO) };\r
-                       si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\r
-                       si.nMin = 0;\r
-                       si.nMax = m_sizeAll.cx - 1;\r
-                       if((m_dwExtendedStyle & SCRL_DISABLENOSCROLLH) != 0)\r
-                               si.fMask |= SIF_DISABLENOSCROLL;\r
-                       si.nPage = m_sizeClient.cx;\r
-                       si.nPos = m_ptOffset.x;\r
-                       pT->SetScrollInfo(SB_HORZ, &si, TRUE);\r
-               }\r
-\r
-               // block: set vertical scroll bar\r
-               {\r
-                       SCROLLINFO si = { sizeof(SCROLLINFO) };\r
-                       si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;\r
-                       si.nMin = 0;\r
-                       si.nMax = m_sizeAll.cy - 1;\r
-                       if((m_dwExtendedStyle & SCRL_DISABLENOSCROLLV) != 0)\r
-                               si.fMask |= SIF_DISABLENOSCROLL;\r
-                       si.nPage = m_sizeClient.cy;\r
-                       si.nPos = m_ptOffset.y;\r
-                       pT->SetScrollInfo(SB_VERT, &si, TRUE);\r
-               }\r
-\r
-               int x = m_ptOffset.x;\r
-               int y = m_ptOffset.y;\r
-               if(pT->AdjustScrollOffset(x, y))\r
-               {\r
-                       // Children will be moved in SetScrollOffset, if needed\r
-                       pT->ScrollWindowEx(m_ptOffset.x - x, m_ptOffset.y - y, (m_uScrollFlags & ~SCRL_SCROLLCHILDREN));\r
-                       SetScrollOffset(x, y, FALSE);\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               if(wParam != NULL)\r
-               {\r
-                       CDCHandle dc = (HDC)wParam;\r
-                       POINT ptViewportOrg = { 0, 0 };\r
-                       dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y, &ptViewportOrg);\r
-                       pT->DoPaint(dc);\r
-                       dc.SetViewportOrg(ptViewportOrg);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y);\r
-                       pT->DoPaint(dc.m_hDC);\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       // scrolling handlers\r
-       LRESULT OnScrollUp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollLineUp();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollDown(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollLineDown();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollPageUp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollPageUp();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollPageDown(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollPageDown();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollTop(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollTop();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollBottom(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollBottom();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollLineLeft();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollLineRight();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollPageLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollPageLeft();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollPageRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollPageRight();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollAllLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollAllLeft();\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnScrollAllRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               ScrollAllRight();\r
-               return 0;\r
-       }\r
-\r
-// Overrideables\r
-       void DoPaint(CDCHandle /*dc*/)\r
-       {\r
-               // must be implemented in a derived class\r
-               ATLASSERT(FALSE);\r
-       }\r
-\r
-// Implementation\r
-       void DoScroll(int nType, int nScrollCode, int& cxyOffset, int cxySizeAll, int cxySizePage, int cxySizeLine)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               RECT rect = { 0 };\r
-               pT->GetClientRect(&rect);\r
-               int cxyClient = (nType == SB_VERT) ? rect.bottom : rect.right;\r
-               int cxyMax = cxySizeAll - cxyClient;\r
-\r
-               if(cxyMax < 0)   // can't scroll, client area is bigger\r
-                       return;\r
-\r
-               bool bUpdate = true;\r
-               int cxyScroll = 0;\r
-\r
-               switch(nScrollCode)\r
-               {\r
-               case SB_TOP:            // top or all left\r
-                       cxyScroll = cxyOffset;\r
-                       cxyOffset = 0;\r
-                       break;\r
-               case SB_BOTTOM:         // bottom or all right\r
-                       cxyScroll = cxyOffset - cxyMax;\r
-                       cxyOffset = cxyMax;\r
-                       break;\r
-               case SB_LINEUP:         // line up or line left\r
-                       if(cxyOffset >= cxySizeLine)\r
-                       {\r
-                               cxyScroll = cxySizeLine;\r
-                               cxyOffset -= cxySizeLine;\r
-                       }\r
-                       else\r
-                       {\r
-                               cxyScroll = cxyOffset;\r
-                               cxyOffset = 0;\r
-                       }\r
-                       break;\r
-               case SB_LINEDOWN:       // line down or line right\r
-                       if(cxyOffset < cxyMax - cxySizeLine)\r
-                       {\r
-                               cxyScroll = -cxySizeLine;\r
-                               cxyOffset += cxySizeLine;\r
-                       }\r
-                       else\r
-                       {\r
-                               cxyScroll = cxyOffset - cxyMax;\r
-                               cxyOffset = cxyMax;\r
-                       }\r
-                       break;\r
-               case SB_PAGEUP:         // page up or page left\r
-                       if(cxyOffset >= cxySizePage)\r
-                       {\r
-                               cxyScroll = cxySizePage;\r
-                               cxyOffset -= cxySizePage;\r
-                       }\r
-                       else\r
-                       {\r
-                               cxyScroll = cxyOffset;\r
-                               cxyOffset = 0;\r
-                       }\r
-                       break;\r
-               case SB_PAGEDOWN:       // page down or page right\r
-                       if(cxyOffset < cxyMax - cxySizePage)\r
-                       {\r
-                               cxyScroll = -cxySizePage;\r
-                               cxyOffset += cxySizePage;\r
-                       }\r
-                       else\r
-                       {\r
-                               cxyScroll = cxyOffset - cxyMax;\r
-                               cxyOffset = cxyMax;\r
-                       }\r
-                       break;\r
-               case SB_THUMBTRACK:\r
-                       if(IsNoThumbTracking())\r
-                               break;\r
-                       // else fall through\r
-               case SB_THUMBPOSITION:\r
-                       {\r
-                               SCROLLINFO si = { sizeof(SCROLLINFO), SIF_TRACKPOS };\r
-                               if(pT->GetScrollInfo(nType, &si))\r
-                               {\r
-                                       cxyScroll = cxyOffset - si.nTrackPos;\r
-                                       cxyOffset = si.nTrackPos;\r
-                               }\r
-                       }\r
-                       break;\r
-               case SB_ENDSCROLL:\r
-               default:\r
-                       bUpdate = false;\r
-                       break;\r
-               }\r
-\r
-               if(bUpdate && cxyScroll != 0)\r
-               {\r
-                       pT->SetScrollPos(nType, cxyOffset, TRUE);\r
-                       if(nType == SB_VERT)\r
-                               pT->ScrollWindowEx(0, cxyScroll, m_uScrollFlags);\r
-                       else\r
-                               pT->ScrollWindowEx(cxyScroll, 0, m_uScrollFlags);\r
-               }\r
-       }\r
-\r
-       static int CalcLineOrPage(int nVal, int nMax, int nDiv)\r
-       {\r
-               if(nVal == 0)\r
-               {\r
-                       nVal = nMax / nDiv;\r
-                       if(nVal < 1)\r
-                               nVal = 1;\r
-               }\r
-               else if(nVal > nMax)\r
-               {\r
-                       nVal = nMax;\r
-               }\r
-\r
-               return nVal;\r
-       }\r
-\r
-       bool AdjustScrollOffset(int& x, int& y)\r
-       {\r
-               int xOld = x;\r
-               int yOld = y;\r
-\r
-               int cxMax = m_sizeAll.cx - m_sizeClient.cx;\r
-               if(x > cxMax)\r
-                       x = (cxMax >= 0) ? cxMax : 0;\r
-               else if(x < 0)\r
-                       x = 0;\r
-\r
-               int cyMax = m_sizeAll.cy - m_sizeClient.cy;\r
-               if(y > cyMax)\r
-                       y = (cyMax >= 0) ? cyMax : 0;\r
-               else if(y < 0)\r
-                       y = 0;\r
-\r
-               return (x != xOld || y != yOld);\r
-       }\r
-\r
-       void GetSystemSettings()\r
-       {\r
-#ifndef _WIN32_WCE\r
-#ifndef SPI_GETWHEELSCROLLLINES\r
-               const UINT SPI_GETWHEELSCROLLLINES = 104;\r
-#endif // !SPI_GETWHEELSCROLLLINES\r
-               ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &m_nWheelLines, 0);\r
-\r
-#ifndef SPI_GETWHEELSCROLLCHARS\r
-               const UINT SPI_GETWHEELSCROLLCHARS = 0x006C;\r
-#endif // !SPI_GETWHEELSCROLLCHARS\r
-               ::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &m_nHWheelChars, 0);\r
-\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               if(m_uMsgMouseWheel != 0)\r
-                       m_uMsgMouseWheel = ::RegisterWindowMessage(MSH_MOUSEWHEEL);\r
-\r
-               HWND hWndWheel = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);\r
-               if(::IsWindow(hWndWheel))\r
-               {\r
-                       UINT uMsgScrollLines = ::RegisterWindowMessage(MSH_SCROLL_LINES);\r
-                       if(uMsgScrollLines != 0)\r
-                               m_nWheelLines = (int)::SendMessage(hWndWheel, uMsgScrollLines, 0, 0L);\r
-               }\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-#endif // !_WIN32_WCE\r
-       }\r
-\r
-       bool IsScrollingChildren() const\r
-       {\r
-               return (m_dwExtendedStyle & SCRL_SCROLLCHILDREN) != 0;\r
-       }\r
-\r
-       bool IsErasingBackground() const\r
-       {\r
-               return (m_dwExtendedStyle & SCRL_ERASEBACKGROUND) != 0;\r
-       }\r
-\r
-       bool IsNoThumbTracking() const\r
-       {\r
-               return (m_dwExtendedStyle & SCRL_NOTHUMBTRACKING) != 0;\r
-       }\r
-\r
-#if (WINVER >= 0x0500)\r
-       bool IsSmoothScroll() const\r
-       {\r
-               return (m_dwExtendedStyle & SCRL_SMOOTHSCROLL) != 0;\r
-       }\r
-#endif // (WINVER >= 0x0500)\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CScrollWindowImpl - Implements a scrollable window\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CScrollWindowImpl : public ATL::CWindowImpl<T, TBase, TWinTraits>, public CScrollImpl< T >\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CScrollWindowImpl)\r
-               MESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, CScrollImpl< T >::OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)) && !defined(_WIN32_WCE)\r
-               MESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\r
-               MESSAGE_HANDLER(WM_PAINT, CScrollImpl< T >::OnPaint)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, CScrollImpl< T >::OnPaint)\r
-#endif // !_WIN32_WCE\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMapScrollImpl - Provides mapping and scrolling support to any window\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T>\r
-class CMapScrollImpl : public CScrollImpl< T >\r
-{\r
-public:\r
-       int m_nMapMode;\r
-       RECT m_rectLogAll;\r
-       SIZE m_sizeLogLine;\r
-       SIZE m_sizeLogPage;\r
-\r
-// Constructor\r
-       CMapScrollImpl() : m_nMapMode(MM_TEXT)\r
-       {\r
-               ::SetRectEmpty(&m_rectLogAll);\r
-               m_sizeLogPage.cx = 0;\r
-               m_sizeLogPage.cy = 0;\r
-               m_sizeLogLine.cx = 0;\r
-               m_sizeLogLine.cy = 0;\r
-       }\r
-\r
-// Attributes & Operations\r
-       // mapping mode operations\r
-       void SetScrollMapMode(int nMapMode)\r
-       {\r
-               ATLASSERT(nMapMode >= MM_MIN && nMapMode <= MM_MAX_FIXEDSCALE);\r
-               m_nMapMode = nMapMode;\r
-       }\r
-\r
-       int GetScrollMapMode() const\r
-       {\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-               return m_nMapMode;\r
-       }\r
-\r
-       // offset operations\r
-       void SetScrollOffset(int x, int y, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-               POINT ptOff = { x, y };\r
-               // block: convert logical to device units\r
-               {\r
-                       CWindowDC dc(NULL);\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       dc.LPtoDP(&ptOff);\r
-               }\r
-               CScrollImpl< T >::SetScrollOffset(ptOff, bRedraw);\r
-       }\r
-\r
-       void SetScrollOffset(POINT ptOffset, BOOL bRedraw = TRUE)\r
-       {\r
-               SetScrollOffset(ptOffset.x, ptOffset.y, bRedraw);\r
-       }\r
-\r
-       void GetScrollOffset(POINT& ptOffset) const\r
-       {\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-               ptOffset = m_ptOffset;\r
-               // block: convert device to logical units\r
-               {\r
-                       CWindowDC dc(NULL);\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       dc.DPtoLP(&ptOffset);\r
-               }\r
-       }\r
-\r
-       // size operations\r
-       void SetScrollSize(int xMin, int yMin, int xMax, int yMax, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               ATLASSERT(xMax > xMin && yMax > yMin);\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-\r
-               ::SetRect(&m_rectLogAll, xMin, yMin, xMax, yMax);\r
-\r
-               SIZE sizeAll = { 0 };\r
-               sizeAll.cx = xMax - xMin + 1;\r
-               sizeAll.cy = yMax - yMin + 1;\r
-               // block: convert logical to device units\r
-               {\r
-                       CWindowDC dc(NULL);\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       dc.LPtoDP(&sizeAll);\r
-               }\r
-               CScrollImpl< T >::SetScrollSize(sizeAll, bRedraw, bResetOffset);\r
-               SetScrollLine(0, 0);\r
-               SetScrollPage(0, 0);\r
-       }\r
-\r
-       void SetScrollSize(RECT& rcScroll, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               SetScrollSize(rcScroll.left, rcScroll.top, rcScroll.right, rcScroll.bottom, bRedraw, bResetOffset);\r
-       }\r
-\r
-       void SetScrollSize(int cx, int cy, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               SetScrollSize(0, 0, cx, cy, bRedraw, bResetOffset);\r
-       }\r
-\r
-       void SetScrollSize(SIZE size, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               SetScrollSize(0, 0, size.cx, size.cy, bRedraw, bResetOffset);\r
-       }\r
-\r
-       void GetScrollSize(RECT& rcScroll) const\r
-       {\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-               rcScroll = m_rectLogAll;\r
-       }\r
-\r
-       // line operations\r
-       void SetScrollLine(int cxLine, int cyLine)\r
-       {\r
-               ATLASSERT(cxLine >= 0 && cyLine >= 0);\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-\r
-               m_sizeLogLine.cx = cxLine;\r
-               m_sizeLogLine.cy = cyLine;\r
-               SIZE sizeLine = m_sizeLogLine;\r
-               // block: convert logical to device units\r
-               {\r
-                       CWindowDC dc(NULL);\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       dc.LPtoDP(&sizeLine);\r
-               }\r
-               CScrollImpl< T >::SetScrollLine(sizeLine);\r
-       }\r
-\r
-       void SetScrollLine(SIZE sizeLine)\r
-       {\r
-               SetScrollLine(sizeLine.cx, sizeLine.cy);\r
-       }\r
-\r
-       void GetScrollLine(SIZE& sizeLine) const\r
-       {\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-               sizeLine = m_sizeLogLine;\r
-       }\r
-\r
-       // page operations\r
-       void SetScrollPage(int cxPage, int cyPage)\r
-       {\r
-               ATLASSERT(cxPage >= 0 && cyPage >= 0);\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-\r
-               m_sizeLogPage.cx = cxPage;\r
-               m_sizeLogPage.cy = cyPage;\r
-               SIZE sizePage = m_sizeLogPage;\r
-               // block: convert logical to device units\r
-               {\r
-                       CWindowDC dc(NULL);\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       dc.LPtoDP(&sizePage);\r
-               }\r
-               CScrollImpl< T >::SetScrollPage(sizePage);\r
-       }\r
-\r
-       void SetScrollPage(SIZE sizePage)\r
-       {\r
-               SetScrollPage(sizePage.cx, sizePage.cy);\r
-       }\r
-\r
-       void GetScrollPage(SIZE& sizePage) const\r
-       {\r
-               ATLASSERT(m_nMapMode >= MM_MIN && m_nMapMode <= MM_MAX_FIXEDSCALE);\r
-               sizePage = m_sizeLogPage;\r
-       }\r
-\r
-       BEGIN_MSG_MAP(CMapScrollImpl)\r
-               MESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, CScrollImpl< T >::OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               if(wParam != NULL)\r
-               {\r
-                       CDCHandle dc = (HDC)wParam;\r
-                       int nMapModeSav = dc.GetMapMode();\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       POINT ptViewportOrg = { 0, 0 };\r
-                       if(m_nMapMode == MM_TEXT)\r
-                               dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y, &ptViewportOrg);\r
-                       else\r
-                               dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y + m_sizeAll.cy, &ptViewportOrg);\r
-                       POINT ptWindowOrg = { 0, 0 };\r
-                       dc.SetWindowOrg(m_rectLogAll.left, m_rectLogAll.top, &ptWindowOrg);\r
-\r
-                       pT->DoPaint(dc);\r
-\r
-                       dc.SetMapMode(nMapModeSav);\r
-                       dc.SetViewportOrg(ptViewportOrg);\r
-                       dc.SetWindowOrg(ptWindowOrg);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       dc.SetMapMode(m_nMapMode);\r
-                       if(m_nMapMode == MM_TEXT)\r
-                               dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y);\r
-                       else\r
-                               dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y + m_sizeAll.cy);\r
-                       dc.SetWindowOrg(m_rectLogAll.left, m_rectLogAll.top);\r
-                       pT->DoPaint(dc.m_hDC);\r
-               }\r
-               return 0;\r
-       }\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMapScrollWindowImpl - Implements scrolling window with mapping\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CMapScrollWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CMapScrollImpl< T >\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CMapScrollWindowImpl)\r
-               MESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, CScrollImpl< T >::OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\r
-               MESSAGE_HANDLER(WM_PAINT, CMapScrollImpl< T >::OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, CMapScrollImpl< T >::OnPaint)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\r
-       END_MSG_MAP()\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFSBWindow - Use as a base instead of CWindow to get flat scroll bar support\r
-\r
-#if defined(__ATLCTRLS_H__) && (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-template <class TBase = ATL::CWindow>\r
-class CFSBWindowT : public TBase, public CFlatScrollBarImpl<CFSBWindowT< TBase > >\r
-{\r
-public:\r
-// Constructors\r
-       CFSBWindowT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CFSBWindowT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-// CWindow overrides that use flat scroll bar API\r
-// (only those methods that are used by scroll window classes)\r
-       int SetScrollPos(int nBar, int nPos, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return FlatSB_SetScrollPos(nBar, nPos, bRedraw);\r
-       }\r
-\r
-       BOOL GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return FlatSB_GetScrollInfo(nBar, lpScrollInfo);\r
-       }\r
-\r
-       BOOL SetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return FlatSB_SetScrollInfo(nBar, lpScrollInfo, bRedraw);\r
-       }\r
-};\r
-\r
-typedef CFSBWindowT<ATL::CWindow>   CFSBWindow;\r
-\r
-#endif // defined(__ATLCTRLS_H__) && (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CZoomScrollImpl - Provides zooming and scrolling support to any window\r
-\r
-#ifndef _WIN32_WCE\r
-\r
-// The zoom modes that can be set with the SetZoomMode method\r
-enum\r
-{\r
-       ZOOMMODE_OFF, \r
-       ZOOMMODE_IN,   // If left mouse button is clicked or dragged, zoom in on point clicked or rectangle dragged.\r
-       ZOOMMODE_OUT   // If left mouse button clicked, zoom out on point clicked.\r
-};\r
-\r
-// Notification to parent that zoom scale changed as a result of user mouse action.\r
-#define ZSN_ZOOMCHANGED        (NM_FIRST - 50) \r
-\r
-template <class T>\r
-class CZoomScrollImpl : public CScrollImpl< T >\r
-{\r
-public:\r
-       enum { m_cxyMinZoomRect = 12 };   // min rect size to zoom in on rect.\r
-\r
-// Data members\r
-       SIZE m_sizeLogAll;              \r
-       SIZE m_sizeLogLine;     \r
-       SIZE m_sizeLogPage;\r
-       float m_fZoomScale;\r
-       float m_fZoomScaleMin;\r
-       float m_fZoomDelta;   // Used in ZOOMMODE_IN and ZOOMMODE_OUT on left-button click.\r
-       int m_nZoomMode;                \r
-       RECT m_rcTrack;\r
-       bool m_bTracking;\r
-\r
-// Constructor\r
-       CZoomScrollImpl():\r
-                       m_fZoomScale(1.0),\r
-                       m_fZoomScaleMin(0.5),\r
-                       m_fZoomDelta(0.5),\r
-                       m_nZoomMode(ZOOMMODE_OFF),\r
-                       m_bTracking(false)\r
-       {\r
-               m_sizeLogAll.cx = 0;\r
-               m_sizeLogAll.cy = 0;\r
-               m_sizeLogPage.cx = 0;\r
-               m_sizeLogPage.cy = 0;\r
-               m_sizeLogLine.cx = 0;\r
-               m_sizeLogLine.cy = 0;\r
-               ::SetRectEmpty(&m_rcTrack);\r
-       }\r
-\r
-// Attributes & Operations\r
-\r
-       // size operations\r
-       void SetScrollSize(int cxLog, int cyLog, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               ATLASSERT(cxLog >= 0 && cyLog >= 0);\r
-\r
-               // Set up the defaults\r
-               if (cxLog == 0 && cyLog == 0)\r
-               {\r
-                       cxLog = 1;\r
-                       cyLog = 1;\r
-               }\r
-\r
-               m_sizeLogAll.cx = cxLog;\r
-               m_sizeLogAll.cy = cyLog;\r
-               SIZE sizeAll = { 0 };\r
-               sizeAll.cx = (int)((float)m_sizeLogAll.cx * m_fZoomScale);\r
-               sizeAll.cy = (int)((float)m_sizeLogAll.cy * m_fZoomScale);\r
-\r
-               CScrollImpl< T >::SetScrollSize(sizeAll, bRedraw, bResetOffset);\r
-       }\r
-\r
-       void SetScrollSize(SIZE sizeLog, BOOL bRedraw = TRUE, bool bResetOffset = true)\r
-       {\r
-               SetScrollSize(sizeLog.cx, sizeLog.cy, bRedraw, bResetOffset);\r
-       }\r
-\r
-       void GetScrollSize(SIZE& sizeLog) const\r
-       {\r
-               sizeLog = m_sizeLogAll;\r
-       }\r
-\r
-       // line operations\r
-       void SetScrollLine(int cxLogLine, int cyLogLine)\r
-       {\r
-               ATLASSERT(cxLogLine >= 0 && cyLogLine >= 0);\r
-\r
-               m_sizeLogLine.cx = cxLogLine;\r
-               m_sizeLogLine.cy = cyLogLine;\r
-\r
-               SIZE sizeLine = { 0 };\r
-               sizeLine.cx = (int)((float)m_sizeLogLine.cx * m_fZoomScale);\r
-               sizeLine.cy = (int)((float)m_sizeLogLine.cy * m_fZoomScale);\r
-               CScrollImpl< T >::SetScrollLine(sizeLine);\r
-       }\r
-\r
-       void SetScrollLine(SIZE sizeLogLine)\r
-       {\r
-               SetScrollLine(sizeLogLine.cx, sizeLogLine.cy);\r
-       }\r
-\r
-       void GetScrollLine(SIZE& sizeLogLine) const\r
-       {\r
-               sizeLogLine = m_sizeLogLine;\r
-       }\r
-\r
-       // page operations\r
-       void SetScrollPage(int cxLogPage, int cyLogPage)\r
-       {\r
-               ATLASSERT(cxLogPage >= 0 && cyLogPage >= 0);\r
-\r
-               m_sizeLogPage.cx = cxLogPage;\r
-               m_sizeLogPage.cy = cyLogPage;\r
-\r
-               SIZE sizePage = { 0 };\r
-               sizePage.cx = (int)((float)m_sizeLogPage.cx * m_fZoomScale);\r
-               sizePage.cy = (int)((float)m_sizeLogPage.cy * m_fZoomScale);\r
-\r
-               CScrollImpl< T >::SetScrollPage(sizePage);\r
-       }\r
-\r
-       void SetScrollPage(SIZE sizeLogPage)\r
-       {\r
-               SetScrollPage(sizeLogPage.cx, sizeLogPage.cy);\r
-       }\r
-\r
-       void GetScrollPage(SIZE& sizeLogPage) const\r
-       {\r
-               sizeLogPage = m_sizeLogPage;\r
-       }\r
-\r
-       void SetZoomScale(float fZoomScale)\r
-       {\r
-               ATLASSERT(fZoomScale > 0);\r
-\r
-               if(fZoomScale > 0 && fZoomScale >= m_fZoomScaleMin)\r
-                       m_fZoomScale = fZoomScale;\r
-       }\r
-\r
-       float GetZoomScale() const\r
-       {\r
-               return m_fZoomScale;\r
-       }\r
-\r
-       void SetZoomScaleMin(float fZoomScaleMin)\r
-       {\r
-               m_fZoomScaleMin = fZoomScaleMin;\r
-       }\r
-\r
-       float GetZoomScaleMin() const\r
-       {\r
-               return m_fZoomScaleMin;\r
-       }\r
-\r
-       void SetZoomDelta(float fZoomDelta)\r
-       {\r
-               ATLASSERT(fZoomDelta >= 0);\r
-\r
-               if(fZoomDelta >= 0)\r
-                       m_fZoomDelta = fZoomDelta;\r
-       }\r
-\r
-       float GetZoomDelta() const\r
-       {\r
-               return m_fZoomDelta;\r
-       }\r
-\r
-       void SetZoomMode(int nZoomMode)\r
-       {\r
-               m_nZoomMode = nZoomMode;\r
-       }\r
-\r
-       int GetZoomMode() const\r
-       {\r
-               return m_nZoomMode;\r
-       }\r
-\r
-       void Zoom(int x, int y, float fZoomScale)\r
-       {\r
-               if(fZoomScale <= 0)\r
-                       return;\r
-\r
-               fZoomScale = max(fZoomScale, m_fZoomScaleMin);\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               POINT pt = { x, y };\r
-               if(!pT->PtInDevRect(pt))\r
-                       return;\r
-\r
-               pT->ViewDPtoLP(&pt);\r
-               pT->Zoom(fZoomScale, false);\r
-               pT->CenterOnLogicalPoint(pt);\r
-       }\r
-\r
-       void Zoom(POINT pt, float fZoomScale)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->Zoom(pt.x, pt.y, fZoomScale);\r
-       }\r
-\r
-       void Zoom(RECT& rc)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               RECT rcZoom = rc;\r
-               pT->NormalizeRect(rcZoom);\r
-               SIZE size = { rcZoom.right - rcZoom.left, rcZoom.bottom - rcZoom.top };\r
-               POINT pt = { rcZoom.left + size.cx / 2, rcZoom.top + size.cy / 2 };\r
-               if(size.cx < m_cxyMinZoomRect || size.cy < m_cxyMinZoomRect)\r
-               {\r
-                       pT->Zoom(pt, m_fZoomScale + m_fZoomDelta);\r
-                       return;\r
-               }\r
-\r
-               ATLASSERT(size.cx > 0 && size.cy > 0);\r
-               \r
-               float fScaleH = (float)(m_sizeClient.cx  + 1) / (float)size.cx;\r
-               float fScaleV = (float)(m_sizeClient.cy + 1) / (float)size.cy;\r
-               float fZoomScale = min(fScaleH, fScaleV) * m_fZoomScale;\r
-               pT->Zoom(pt, fZoomScale);               \r
-       }\r
-\r
-       void Zoom(float fZoomScale, bool bCenter = true)\r
-       {\r
-               if(fZoomScale <= 0)\r
-                       return;\r
-\r
-               fZoomScale = max(fZoomScale, m_fZoomScaleMin);\r
-\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               POINT pt = { 0 };\r
-               if(bCenter)\r
-               {\r
-                       RECT rc;\r
-                       ::GetClientRect(pT->m_hWnd, &rc);\r
-                       pt.x = rc.right / 2;\r
-                       pt.y = rc.bottom / 2;\r
-                       pT->ViewDPtoLP(&pt);\r
-               }\r
-\r
-               // Modify the Viewport extent\r
-               m_fZoomScale = fZoomScale;\r
-               SIZE sizeAll = { 0 };\r
-               sizeAll.cx = (int)((float)m_sizeLogAll.cx * fZoomScale);\r
-               sizeAll.cy = (int)((float)m_sizeLogAll.cy * fZoomScale);\r
-               \r
-               // Update scroll bars and window\r
-               CScrollImpl< T >::SetScrollSize(sizeAll);\r
-\r
-               if(bCenter)\r
-                       pT->CenterOnLogicalPoint(pt);\r
-       }\r
-\r
-       // Helper functions\r
-       void PrepareDC(CDCHandle dc)\r
-       {\r
-               ATLASSERT(m_sizeAll.cx >= 0 && m_sizeAll.cy >= 0);\r
-               dc.SetMapMode(MM_ANISOTROPIC);\r
-               dc.SetWindowExt(m_sizeLogAll);\r
-               dc.SetViewportExt(m_sizeAll);\r
-               dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y);\r
-       }\r
-\r
-       void ViewDPtoLP(LPPOINT lpPoints, int nCount = 1)\r
-       {\r
-               ATLASSERT(lpPoints);\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-\r
-               CWindowDC dc(pT->m_hWnd);\r
-               pT->PrepareDC(dc.m_hDC);\r
-               dc.DPtoLP(lpPoints, nCount);\r
-       }\r
-\r
-       void ViewLPtoDP(LPPOINT lpPoints, int nCount = 1)\r
-       {\r
-               ATLASSERT(lpPoints);\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-       \r
-               CWindowDC dc(pT->m_hWnd);\r
-               pT->PrepareDC(dc.m_hDC);\r
-               dc.LPtoDP(lpPoints, nCount);\r
-       }\r
-\r
-       void ClientToDevice(POINT &pt)\r
-       {\r
-               pt.x += m_ptOffset.x;\r
-               pt.y += m_ptOffset.y;\r
-       }        \r
-\r
-       void DeviceToClient(POINT &pt)\r
-       {\r
-               pt.x -= m_ptOffset.x;\r
-               pt.y -= m_ptOffset.y;\r
-       }\r
-\r
-       void CenterOnPoint(POINT pt)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               RECT rect;\r
-               pT->GetClientRect(&rect);\r
-\r
-               int xOfs = pt.x - (rect.right / 2) + m_ptOffset.x;\r
-               if(xOfs < 0)\r
-               {\r
-                       xOfs = 0;\r
-               }\r
-               else \r
-               {\r
-                       int xMax = max((int)(m_sizeAll.cx - rect.right), 0);\r
-                       if(xOfs > xMax)\r
-                               xOfs = xMax;\r
-               }\r
-               \r
-               int yOfs = pt.y - (rect.bottom / 2) + m_ptOffset.y;\r
-               if(yOfs < 0)\r
-               {\r
-                       yOfs = 0;\r
-               }\r
-               else \r
-               {\r
-                       int yMax = max((int)(m_sizeAll.cy - rect.bottom), 0);\r
-                       if(yOfs > yMax)\r
-                               yOfs = yMax;\r
-               }\r
-\r
-               CScrollImpl< T >::SetScrollOffset(xOfs, yOfs);\r
-       }\r
-\r
-       void CenterOnLogicalPoint(POINT ptLog)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->ViewLPtoDP(&ptLog);\r
-               pT->DeviceToClient(ptLog);\r
-               pT->CenterOnPoint(ptLog);\r
-       }\r
-\r
-       BOOL PtInDevRect(POINT pt)\r
-       {\r
-               RECT rc = { 0, 0, m_sizeAll.cx, m_sizeAll.cy };\r
-               ::OffsetRect(&rc, -m_ptOffset.x, -m_ptOffset.y);\r
-               return ::PtInRect(&rc, pt);\r
-       }\r
-\r
-       void NormalizeRect(RECT& rc)\r
-       {\r
-               if(rc.left > rc.right) \r
-               {\r
-                       int r = rc.right;\r
-                       rc.right = rc.left;\r
-                       rc.left = r;\r
-               }\r
-               if(rc.top > rc.bottom)\r
-               {\r
-                       int b = rc.bottom;\r
-                       rc.bottom = rc.top;\r
-                       rc.top = b;\r
-               }\r
-       }\r
-\r
-       void DrawTrackRect()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               const SIZE sizeLines = { 2, 2 };\r
-               RECT rc = m_rcTrack;\r
-               pT->NormalizeRect(rc);\r
-               if(!::IsRectEmpty(&rc))\r
-               {\r
-                       ::MapWindowPoints(pT->m_hWnd, NULL, (LPPOINT)&rc, 2);\r
-                       CWindowDC dc(NULL);\r
-                       dc.DrawDragRect(&rc, sizeLines, NULL, sizeLines);\r
-               }\r
-       }\r
-\r
-       void NotifyParentZoomChanged()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               int nId = pT->GetDlgCtrlID();\r
-               NMHDR nmhdr = { pT->m_hWnd, nId, ZSN_ZOOMCHANGED };\r
-               ::SendMessage(pT->GetParent(), WM_NOTIFY, (WPARAM)nId, (LPARAM)&nmhdr);\r
-       }\r
-\r
-       BEGIN_MSG_MAP(CZoomScrollImpl)\r
-               MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)\r
-               MESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, CScrollImpl< T >::OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\r
-               MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               ATLASSERT(m_sizeLogAll.cx >= 0 && m_sizeLogAll.cy >= 0);\r
-               ATLASSERT(m_sizeAll.cx >= 0 && m_sizeAll.cy >= 0);\r
-\r
-               if(wParam != NULL)\r
-               {\r
-                       CDCHandle dc = (HDC)wParam;\r
-                       int nMapModeSav = dc.GetMapMode();\r
-                       dc.SetMapMode(MM_ANISOTROPIC);\r
-                       SIZE szWindowExt = { 0, 0 };\r
-                       dc.SetWindowExt(m_sizeLogAll, &szWindowExt);\r
-                       SIZE szViewportExt = { 0, 0 };\r
-                       dc.SetViewportExt(m_sizeAll, &szViewportExt);\r
-                       POINT ptViewportOrg = { 0, 0 };\r
-                       dc.SetViewportOrg(-m_ptOffset.x, -m_ptOffset.y, &ptViewportOrg);\r
-\r
-                       pT->DoPaint(dc);\r
-\r
-                       dc.SetMapMode(nMapModeSav);\r
-                       dc.SetWindowExt(szWindowExt);\r
-                       dc.SetViewportExt(szViewportExt);\r
-                       dc.SetViewportOrg(ptViewportOrg);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       pT->PrepareDC(dc.m_hDC);\r
-                       pT->DoPaint(dc.m_hDC);\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(m_nZoomMode == ZOOMMODE_IN && !m_bTracking)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-                       if(pT->PtInDevRect(pt))\r
-                       {\r
-                               pT->SetCapture();\r
-                               m_bTracking = true;\r
-                               ::SetRect(&m_rcTrack, pt.x, pt.y, pt.x, pt.y);\r
-                       }       \r
-               }\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(m_bTracking)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };\r
-                       if(pT->PtInDevRect(pt))\r
-                       {\r
-                               pT->DrawTrackRect();\r
-                               m_rcTrack.right = pt.x;\r
-                               m_rcTrack.bottom = pt.y;\r
-                               pT->DrawTrackRect();\r
-                       }\r
-               }\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               ::ReleaseCapture();\r
-               if(m_nZoomMode == ZOOMMODE_OUT)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->Zoom(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), m_fZoomScale - m_fZoomDelta);\r
-                       pT->NotifyParentZoomChanged();\r
-               }\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_bTracking)\r
-               {\r
-                       m_bTracking = false;\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->DrawTrackRect();\r
-                       pT->Zoom(m_rcTrack);\r
-                       pT->NotifyParentZoomChanged();\r
-                       ::SetRectEmpty(&m_rcTrack);\r
-               }\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }       \r
-\r
-       LRESULT OnSetCursor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if(LOWORD(lParam) == HTCLIENT && m_nZoomMode != ZOOMMODE_OFF)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       if((HWND)wParam == pT->m_hWnd)\r
-                       {\r
-                               DWORD dwPos = ::GetMessagePos();\r
-                               POINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };\r
-                               pT->ScreenToClient(&pt);\r
-                               if(pT->PtInDevRect(pt))\r
-                               {\r
-                                       ::SetCursor(::LoadCursor(NULL, IDC_CROSS));\r
-                                       return 1;\r
-                               }\r
-                       }\r
-               }\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CZoomScrollWindowImpl - Implements scrolling window with zooming\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CZoomScrollWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CZoomScrollImpl< T >\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CZoomScrollWindowImpl)\r
-               MESSAGE_HANDLER(WM_SETCURSOR, CZoomScrollImpl< T >::OnSetCursor)\r
-               MESSAGE_HANDLER(WM_VSCROLL, CScrollImpl< T >::OnVScroll)\r
-               MESSAGE_HANDLER(WM_HSCROLL, CScrollImpl< T >::OnHScroll)\r
-               MESSAGE_HANDLER(WM_MOUSEWHEEL, CScrollImpl< T >::OnMouseWheel)\r
-#if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(m_uMsgMouseWheel, CScrollImpl< T >::OnMouseWheel)\r
-#endif // !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))\r
-               MESSAGE_HANDLER(WM_MOUSEHWHEEL, CScrollImpl< T >::OnMouseHWheel)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CScrollImpl< T >::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_SIZE, CScrollImpl< T >::OnSize)\r
-               MESSAGE_HANDLER(WM_PAINT, CZoomScrollImpl< T >::OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, CZoomScrollImpl< T >::OnPaint)\r
-               MESSAGE_HANDLER(WM_LBUTTONDOWN, CZoomScrollImpl< T >::OnLButtonDown)\r
-               MESSAGE_HANDLER(WM_MOUSEMOVE, CZoomScrollImpl< T >::OnMouseMove)\r
-               MESSAGE_HANDLER(WM_LBUTTONUP, CZoomScrollImpl< T >::OnLButtonUp)\r
-               MESSAGE_HANDLER(WM_CAPTURECHANGED, CZoomScrollImpl< T >::OnCaptureChanged)\r
-       ALT_MSG_MAP(1)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_UP, CScrollImpl< T >::OnScrollUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_DOWN, CScrollImpl< T >::OnScrollDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_UP, CScrollImpl< T >::OnScrollPageUp)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_DOWN, CScrollImpl< T >::OnScrollPageDown)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_TOP, CScrollImpl< T >::OnScrollTop)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_BOTTOM, CScrollImpl< T >::OnScrollBottom)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_LEFT, CScrollImpl< T >::OnScrollLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_RIGHT, CScrollImpl< T >::OnScrollRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_LEFT, CScrollImpl< T >::OnScrollPageLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_PAGE_RIGHT, CScrollImpl< T >::OnScrollPageRight)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_LEFT, CScrollImpl< T >::OnScrollAllLeft)\r
-               COMMAND_ID_HANDLER(ID_SCROLL_ALL_RIGHT, CScrollImpl< T >::OnScrollAllRight)\r
-       END_MSG_MAP()\r
-};\r
-\r
-#endif // !_WIN32_WCE\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CScrollContainer\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CScrollContainerImpl : public CScrollWindowImpl< T, TBase, TWinTraits >\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(NULL, 0, -1)\r
-\r
-       typedef CScrollWindowImpl< T, TBase, TWinTraits >   _baseClass;\r
-\r
-// Data members\r
-       ATL::CWindow m_wndClient;\r
-       bool m_bAutoSizeClient;\r
-       bool m_bDrawEdgeIfEmpty;\r
-\r
-// Constructor\r
-       CScrollContainerImpl() : m_bAutoSizeClient(true), m_bDrawEdgeIfEmpty(false)\r
-       {\r
-               // Set CScrollWindowImpl extended style\r
-               SetScrollExtendedStyle(SCRL_SCROLLCHILDREN);\r
-       }\r
-\r
-// Attributes\r
-       HWND GetClient() const\r
-       {\r
-               return m_wndClient;\r
-       }\r
-\r
-       HWND SetClient(HWND hWndClient, bool bClientSizeAsMin = true)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               HWND hWndOldClient = m_wndClient;\r
-               m_wndClient = hWndClient;\r
-\r
-               SetRedraw(FALSE);\r
-               SetScrollSize(1, 1, FALSE);\r
-\r
-               if(m_wndClient.m_hWnd != NULL)\r
-               {\r
-                       m_wndClient.SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE);\r
-\r
-                       if(bClientSizeAsMin)\r
-                       {\r
-                               RECT rect = { 0 };\r
-                               m_wndClient.GetWindowRect(&rect);\r
-                               if((rect.right - rect.left) > 0 && (rect.bottom - rect.top) > 0)\r
-                                       SetScrollSize(rect.right - rect.left, rect.bottom - rect.top, FALSE);\r
-                       }\r
-\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateLayout();\r
-               }\r
-\r
-               SetRedraw(TRUE);\r
-               RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);\r
-\r
-               return hWndOldClient;\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CScrollContainerImpl)\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               CHAIN_MSG_MAP(_baseClass)\r
-               FORWARD_NOTIFICATIONS()\r
-       ALT_MSG_MAP(1)\r
-               CHAIN_MSG_MAP_ALT(_baseClass, 1)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(m_wndClient.m_hWnd != NULL)\r
-                       m_wndClient.SetFocus();\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background needed\r
-       }\r
-\r
-       LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               BOOL bTmp = TRUE;\r
-               LRESULT lRet = _baseClass::OnSize(uMsg, wParam, lParam, bTmp);\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               pT->UpdateLayout();\r
-\r
-               return lRet;\r
-       }\r
-\r
-// Overrides for CScrollWindowImpl\r
-       void DoPaint(CDCHandle dc)\r
-       {\r
-               if(!m_bAutoSizeClient || m_wndClient.m_hWnd == NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       RECT rect = { 0 };\r
-                       pT->GetContainerRect(rect);\r
-\r
-                       if(m_bDrawEdgeIfEmpty && m_wndClient.m_hWnd == NULL)\r
-                               dc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);\r
-\r
-                       dc.FillRect(&rect, COLOR_APPWORKSPACE);\r
-               }\r
-       }\r
-\r
-       void ScrollToView(POINT pt)\r
-       {\r
-               CScrollWindowImpl< T, TBase, TWinTraits >::ScrollToView(pt);\r
-       }\r
-\r
-       void ScrollToView(RECT& rect)\r
-       {\r
-               CScrollWindowImpl< T, TBase, TWinTraits >::ScrollToView(rect);\r
-       }\r
-\r
-       void ScrollToView(HWND hWnd)   // client window coordinates\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               ATLASSERT(m_wndClient.IsWindow());\r
-\r
-               RECT rect = { 0 };\r
-               ::GetWindowRect(hWnd, &rect);\r
-               ::MapWindowPoints(NULL, m_wndClient.m_hWnd, (LPPOINT)&rect, 2);\r
-               ScrollToView(rect);\r
-       }\r
-\r
-// Implementation - overrideable methods\r
-       void UpdateLayout()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-\r
-               if(m_bAutoSizeClient && m_wndClient.m_hWnd != NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       RECT rect = { 0 };\r
-                       pT->GetContainerRect(rect);\r
-\r
-                       m_wndClient.SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOMOVE);\r
-               }\r
-               else\r
-               {\r
-                       Invalidate();\r
-               }\r
-       }\r
-\r
-       void GetContainerRect(RECT& rect)\r
-       {\r
-               GetClientRect(&rect);\r
-\r
-               if(rect.right < m_sizeAll.cx)\r
-                       rect.right = m_sizeAll.cx;\r
-\r
-               if(rect.bottom < m_sizeAll.cy)\r
-                       rect.bottom = m_sizeAll.cy;\r
-       }\r
-};\r
-\r
-class CScrollContainer : public CScrollContainerImpl<CScrollContainer>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_ScrollContainer"), 0, -1)\r
-};\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLSCRL_H__\r
diff --git a/WTL80/include/atlsplit.h b/WTL80/include/atlsplit.h
deleted file mode 100644 (file)
index df879db..0000000
+++ /dev/null
@@ -1,892 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLSPLIT_H__\r
-#define __ATLSPLIT_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlsplit.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atlsplit.h requires atlwin.h to be included first\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CSplitterImpl<T, t_bVertical>\r
-// CSplitterWindowImpl<T, t_bVertical, TBase, TWinTraits>\r
-// CSplitterWindowT<t_bVertical>\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSplitterImpl - Provides splitter support to any window\r
-\r
-// Splitter panes constants\r
-#define SPLIT_PANE_LEFT                         0\r
-#define SPLIT_PANE_RIGHT                1\r
-#define SPLIT_PANE_TOP                  SPLIT_PANE_LEFT\r
-#define SPLIT_PANE_BOTTOM               SPLIT_PANE_RIGHT\r
-#define SPLIT_PANE_NONE                        -1\r
-\r
-// Splitter extended styles\r
-#define SPLIT_PROPORTIONAL             0x00000001\r
-#define SPLIT_NONINTERACTIVE           0x00000002\r
-#define SPLIT_RIGHTALIGNED             0x00000004\r
-#define SPLIT_BOTTOMALIGNED            SPLIT_RIGHTALIGNED\r
-\r
-// Note: SPLIT_PROPORTIONAL and SPLIT_RIGHTALIGNED/SPLIT_BOTTOMALIGNED are \r
-// mutually exclusive. If both are set, splitter defaults to SPLIT_PROPORTIONAL\r
-\r
-\r
-template <class T, bool t_bVertical = true>\r
-class CSplitterImpl\r
-{\r
-public:\r
-       enum { m_nPanesCount = 2, m_nPropMax = 10000 };\r
-\r
-       HWND m_hWndPane[m_nPanesCount];\r
-       RECT m_rcSplitter;\r
-       int m_xySplitterPos;\r
-       int m_nDefActivePane;\r
-       int m_cxySplitBar;              // splitter bar width/height\r
-       static HCURSOR m_hCursor;\r
-       int m_cxyMin;                   // minimum pane size\r
-       int m_cxyBarEdge;               // splitter bar edge\r
-       bool m_bFullDrag;\r
-       int m_cxyDragOffset;\r
-       int m_nProportionalPos;\r
-       bool m_bUpdateProportionalPos;\r
-       DWORD m_dwExtendedStyle;       // splitter specific extended styles\r
-       int m_nSinglePane;             // single pane mode\r
-\r
-// Constructor\r
-       CSplitterImpl() :\r
-                       m_xySplitterPos(-1), m_nDefActivePane(SPLIT_PANE_NONE), \r
-                       m_cxySplitBar(0), m_cxyMin(0), m_cxyBarEdge(0), m_bFullDrag(true), \r
-                       m_cxyDragOffset(0), m_nProportionalPos(0), m_bUpdateProportionalPos(true),\r
-                       m_dwExtendedStyle(SPLIT_PROPORTIONAL),\r
-                       m_nSinglePane(SPLIT_PANE_NONE)\r
-       {\r
-               m_hWndPane[SPLIT_PANE_LEFT] = NULL;\r
-               m_hWndPane[SPLIT_PANE_RIGHT] = NULL;\r
-\r
-               ::SetRectEmpty(&m_rcSplitter);\r
-\r
-               if(m_hCursor == NULL)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CSplitterImpl::CSplitterImpl.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return;\r
-                       }\r
-\r
-                       if(m_hCursor == NULL)\r
-                               m_hCursor = ::LoadCursor(NULL, t_bVertical ? IDC_SIZEWE : IDC_SIZENS);\r
-\r
-                       lock.Unlock();\r
-               }\r
-       }\r
-\r
-// Attributes\r
-       void SetSplitterRect(LPRECT lpRect = NULL, bool bUpdate = true)\r
-       {\r
-               if(lpRect == NULL)\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->GetClientRect(&m_rcSplitter);\r
-               }\r
-               else\r
-               {\r
-                       m_rcSplitter = *lpRect;\r
-               }\r
-\r
-               if(IsProportional())\r
-                       UpdateProportionalPos();\r
-               else if(IsRightAligned())\r
-                       UpdateRightAlignPos();\r
-\r
-               if(bUpdate)\r
-                       UpdateSplitterLayout();\r
-       }\r
-\r
-       void GetSplitterRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(lpRect != NULL);\r
-               *lpRect = m_rcSplitter;\r
-       }\r
-\r
-       bool SetSplitterPos(int xyPos = -1, bool bUpdate = true)\r
-       {\r
-               if(xyPos == -1)   // -1 == middle\r
-               {\r
-                       if(t_bVertical)\r
-                               xyPos = (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) / 2;\r
-                       else\r
-                               xyPos = (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge) / 2;\r
-               }\r
-\r
-               // Adjust if out of valid range\r
-               int cxyMax = 0;\r
-               if(t_bVertical)\r
-                       cxyMax = m_rcSplitter.right - m_rcSplitter.left;\r
-               else\r
-                       cxyMax = m_rcSplitter.bottom - m_rcSplitter.top;\r
-\r
-               if(xyPos < m_cxyMin + m_cxyBarEdge)\r
-                       xyPos = m_cxyMin;\r
-               else if(xyPos > (cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin))\r
-                       xyPos = cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin;\r
-\r
-               // Set new position and update if requested\r
-               bool bRet = (m_xySplitterPos != xyPos);\r
-               m_xySplitterPos = xyPos;\r
-\r
-               if(m_bUpdateProportionalPos)\r
-               {\r
-                       if(IsProportional())\r
-                               StoreProportionalPos();\r
-                       else if(IsRightAligned())\r
-                               StoreRightAlignPos();\r
-               }\r
-               else\r
-               {\r
-                       m_bUpdateProportionalPos = true;\r
-               }\r
-\r
-               if(bUpdate && bRet)\r
-                       UpdateSplitterLayout();\r
-\r
-               return bRet;\r
-       }\r
-\r
-       void SetSplitterPosPct(int nPct, bool bUpdate = true)\r
-       {\r
-               ATLASSERT(nPct >= 0 && nPct <= 100);\r
-\r
-               m_nProportionalPos = ::MulDiv(nPct, m_nPropMax, 100);\r
-               UpdateProportionalPos();\r
-\r
-               if(bUpdate)\r
-                       UpdateSplitterLayout();\r
-       }\r
-\r
-       int GetSplitterPos() const\r
-       {\r
-               return m_xySplitterPos;\r
-       }\r
-\r
-       bool SetSinglePaneMode(int nPane = SPLIT_PANE_NONE)\r
-       {\r
-               ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT || nPane == SPLIT_PANE_NONE);\r
-               if(!(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT || nPane == SPLIT_PANE_NONE))\r
-                       return false;\r
-\r
-               if(nPane != SPLIT_PANE_NONE)\r
-               {\r
-                       if(!::IsWindowVisible(m_hWndPane[nPane]))\r
-                               ::ShowWindow(m_hWndPane[nPane], SW_SHOW);\r
-                       int nOtherPane = (nPane == SPLIT_PANE_LEFT) ? SPLIT_PANE_RIGHT : SPLIT_PANE_LEFT;\r
-                       ::ShowWindow(m_hWndPane[nOtherPane], SW_HIDE);\r
-                       if(m_nDefActivePane != nPane)\r
-                               m_nDefActivePane = nPane;\r
-               }\r
-               else if(m_nSinglePane != SPLIT_PANE_NONE)\r
-               {\r
-                       int nOtherPane = (m_nSinglePane == SPLIT_PANE_LEFT) ? SPLIT_PANE_RIGHT : SPLIT_PANE_LEFT;\r
-                       ::ShowWindow(m_hWndPane[nOtherPane], SW_SHOW);\r
-               }\r
-\r
-               m_nSinglePane = nPane;\r
-               UpdateSplitterLayout();\r
-               return true;\r
-       }\r
-\r
-       int GetSinglePaneMode() const\r
-       {\r
-               return m_nSinglePane;\r
-       }\r
-\r
-       DWORD GetSplitterExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-       DWORD SetSplitterExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-#ifdef _DEBUG\r
-               if(IsProportional() && IsRightAligned())\r
-                       ATLTRACE2(atlTraceUI, 0, _T("CSplitterImpl::SetSplitterExtendedStyle - SPLIT_PROPORTIONAL and SPLIT_RIGHTALIGNED are mutually exclusive, defaulting to SPLIT_PROPORTIONAL.\n"));\r
-#endif // _DEBUG\r
-               return dwPrevStyle;\r
-       }\r
-\r
-// Splitter operations\r
-       void SetSplitterPanes(HWND hWndLeftTop, HWND hWndRightBottom, bool bUpdate = true)\r
-       {\r
-               m_hWndPane[SPLIT_PANE_LEFT] = hWndLeftTop;\r
-               m_hWndPane[SPLIT_PANE_RIGHT] = hWndRightBottom;\r
-               ATLASSERT(m_hWndPane[SPLIT_PANE_LEFT] == NULL || m_hWndPane[SPLIT_PANE_RIGHT] == NULL || m_hWndPane[SPLIT_PANE_LEFT] != m_hWndPane[SPLIT_PANE_RIGHT]);\r
-               if(bUpdate)\r
-                       UpdateSplitterLayout();\r
-       }\r
-\r
-       bool SetSplitterPane(int nPane, HWND hWnd, bool bUpdate = true)\r
-       {\r
-               ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);\r
-\r
-               if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)\r
-                       return false;\r
-               m_hWndPane[nPane] = hWnd;\r
-               ATLASSERT(m_hWndPane[SPLIT_PANE_LEFT] == NULL || m_hWndPane[SPLIT_PANE_RIGHT] == NULL || m_hWndPane[SPLIT_PANE_LEFT] != m_hWndPane[SPLIT_PANE_RIGHT]);\r
-               if(bUpdate)\r
-                       UpdateSplitterLayout();\r
-               return true;\r
-       }\r
-\r
-       HWND GetSplitterPane(int nPane) const\r
-       {\r
-               ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);\r
-\r
-               if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)\r
-                       return false;\r
-               return m_hWndPane[nPane];\r
-       }\r
-\r
-       bool SetActivePane(int nPane)\r
-       {\r
-               ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);\r
-\r
-               if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)\r
-                       return false;\r
-               if(m_nSinglePane != SPLIT_PANE_NONE && nPane != m_nSinglePane)\r
-                       return false;\r
-               ::SetFocus(m_hWndPane[nPane]);\r
-               m_nDefActivePane = nPane;\r
-               return true;\r
-       }\r
-\r
-       int GetActivePane() const\r
-       {\r
-               int nRet = SPLIT_PANE_NONE;\r
-               HWND hWndFocus = ::GetFocus();\r
-               if(hWndFocus != NULL)\r
-               {\r
-                       for(int nPane = 0; nPane < m_nPanesCount; nPane++)\r
-                       {\r
-                               if(hWndFocus == m_hWndPane[nPane] || ::IsChild(m_hWndPane[nPane], hWndFocus))\r
-                               {\r
-                                       nRet = nPane;\r
-                                       break;\r
-                               }\r
-                       }\r
-               }\r
-               return nRet;\r
-       }\r
-\r
-       bool ActivateNextPane(bool bNext = true)\r
-       {\r
-               int nPane = m_nSinglePane;\r
-               if(nPane == SPLIT_PANE_NONE)\r
-               {\r
-                       switch(GetActivePane())\r
-                       {\r
-                       case SPLIT_PANE_LEFT:\r
-                               nPane = SPLIT_PANE_RIGHT;\r
-                               break;\r
-                       case SPLIT_PANE_RIGHT:\r
-                               nPane = SPLIT_PANE_LEFT;\r
-                               break;\r
-                       default:\r
-                               nPane = bNext ? SPLIT_PANE_LEFT : SPLIT_PANE_RIGHT;\r
-                               break;\r
-                       }\r
-               }\r
-               return SetActivePane(nPane);\r
-       }\r
-\r
-       bool SetDefaultActivePane(int nPane)\r
-       {\r
-               ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);\r
-\r
-               if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)\r
-                       return false;\r
-               m_nDefActivePane = nPane;\r
-               return true;\r
-       }\r
-\r
-       bool SetDefaultActivePane(HWND hWnd)\r
-       {\r
-               for(int nPane = 0; nPane < m_nPanesCount; nPane++)\r
-               {\r
-                       if(hWnd == m_hWndPane[nPane])\r
-                       {\r
-                               m_nDefActivePane = nPane;\r
-                               return true;\r
-                       }\r
-               }\r
-               return false;   // not found\r
-       }\r
-\r
-       int GetDefaultActivePane() const\r
-       {\r
-               return m_nDefActivePane;\r
-       }\r
-\r
-       void DrawSplitter(CDCHandle dc)\r
-       {\r
-               ATLASSERT(dc.m_hDC != NULL);\r
-               if(m_nSinglePane == SPLIT_PANE_NONE && m_xySplitterPos == -1)\r
-                       return;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(m_nSinglePane == SPLIT_PANE_NONE)\r
-               {\r
-                       pT->DrawSplitterBar(dc);\r
-\r
-                       for(int nPane = 0; nPane < m_nPanesCount; nPane++)\r
-                       {\r
-                               if(m_hWndPane[nPane] == NULL)\r
-                                       pT->DrawSplitterPane(dc, nPane);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if(m_hWndPane[m_nSinglePane] == NULL)\r
-                               pT->DrawSplitterPane(dc, m_nSinglePane);\r
-               }\r
-       }\r
-\r
-// Overrideables\r
-       void DrawSplitterBar(CDCHandle dc)\r
-       {\r
-               RECT rect;\r
-               if(GetSplitterBarRect(&rect))\r
-               {\r
-                       dc.FillRect(&rect, COLOR_3DFACE);\r
-                       // draw 3D edge if needed\r
-                       T* pT = static_cast<T*>(this);\r
-                       if((pT->GetExStyle() & WS_EX_CLIENTEDGE) != 0)\r
-                               dc.DrawEdge(&rect, EDGE_RAISED, t_bVertical ? (BF_LEFT | BF_RIGHT) : (BF_TOP | BF_BOTTOM));\r
-               }\r
-       }\r
-\r
-       // called only if pane is empty\r
-       void DrawSplitterPane(CDCHandle dc, int nPane)\r
-       {\r
-               RECT rect;\r
-               if(GetSplitterPaneRect(nPane, &rect))\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       if((pT->GetExStyle() & WS_EX_CLIENTEDGE) == 0)\r
-                               dc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);\r
-                       dc.FillRect(&rect, COLOR_APPWORKSPACE);\r
-               }\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CSplitterImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-#endif // !_WIN32_WCE\r
-               if(IsInteractive())\r
-               {\r
-                       MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)\r
-                       MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)\r
-                       MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)\r
-                       MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)\r
-                       MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDoubleClick)\r
-                       MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)\r
-               }\r
-               MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)\r
-#ifndef _WIN32_WCE\r
-               MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)\r
-#endif // !_WIN32_WCE\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               GetSystemSettings(false);\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               // try setting position if not set\r
-               if(m_nSinglePane == SPLIT_PANE_NONE && m_xySplitterPos == -1)\r
-                       pT->SetSplitterPos();\r
-               // do painting\r
-               CPaintDC dc(pT->m_hWnd);\r
-               pT->DrawSplitter(dc.m_hDC);\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSetCursor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if((HWND)wParam == pT->m_hWnd && LOWORD(lParam) == HTCLIENT)\r
-               {\r
-                       DWORD dwPos = ::GetMessagePos();\r
-                       POINT ptPos = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };\r
-                       pT->ScreenToClient(&ptPos);\r
-                       if(IsOverSplitterBar(ptPos.x, ptPos.y))\r
-                               return 1;\r
-               }\r
-\r
-               bHandled = FALSE;\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               int xPos = GET_X_LPARAM(lParam);\r
-               int yPos = GET_Y_LPARAM(lParam);\r
-               if((wParam & MK_LBUTTON) && ::GetCapture() == pT->m_hWnd)\r
-               {\r
-                       int xyNewSplitPos = 0;\r
-                       if(t_bVertical)\r
-                               xyNewSplitPos = xPos - m_rcSplitter.left - m_cxyDragOffset;\r
-                       else\r
-                               xyNewSplitPos = yPos - m_rcSplitter.top - m_cxyDragOffset;\r
-\r
-                       if(xyNewSplitPos == -1)   // avoid -1, that means middle\r
-                               xyNewSplitPos = -2;\r
-\r
-                       if(m_xySplitterPos != xyNewSplitPos)\r
-                       {\r
-                               if(m_bFullDrag)\r
-                               {\r
-                                       if(pT->SetSplitterPos(xyNewSplitPos, true))\r
-                                               pT->UpdateWindow();\r
-                               }\r
-                               else\r
-                               {\r
-                                       DrawGhostBar();\r
-                                       pT->SetSplitterPos(xyNewSplitPos, false);\r
-                                       DrawGhostBar();\r
-                               }\r
-                       }\r
-               }\r
-               else            // not dragging, just set cursor\r
-               {\r
-                       if(IsOverSplitterBar(xPos, yPos))\r
-                               ::SetCursor(m_hCursor);\r
-                       bHandled = FALSE;\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               int xPos = GET_X_LPARAM(lParam);\r
-               int yPos = GET_Y_LPARAM(lParam);\r
-               if(IsOverSplitterBar(xPos, yPos))\r
-               {\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->SetCapture();\r
-                       ::SetCursor(m_hCursor);\r
-                       if(!m_bFullDrag)\r
-                               DrawGhostBar();\r
-                       if(t_bVertical)\r
-                               m_cxyDragOffset = xPos - m_rcSplitter.left - m_xySplitterPos;\r
-                       else\r
-                               m_cxyDragOffset = yPos - m_rcSplitter.top - m_xySplitterPos;\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               ::ReleaseCapture();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnLButtonDoubleClick(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetSplitterPos();   // middle\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               if(!m_bFullDrag)\r
-               {\r
-                       DrawGhostBar();\r
-                       UpdateSplitterLayout();\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->UpdateWindow();\r
-               }\r
-               return 0;\r
-       }\r
-\r
-       LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM, BOOL& bHandled)\r
-       {\r
-               if(m_nSinglePane == SPLIT_PANE_NONE)\r
-               {\r
-                       if(m_nDefActivePane == SPLIT_PANE_LEFT || m_nDefActivePane == SPLIT_PANE_RIGHT)\r
-                               ::SetFocus(m_hWndPane[m_nDefActivePane]);\r
-               }\r
-               else\r
-               {\r
-                       ::SetFocus(m_hWndPane[m_nSinglePane]);\r
-               }\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       LRESULT OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               LRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);\r
-               if(lRet == MA_ACTIVATE || lRet == MA_ACTIVATEANDEAT)\r
-               {\r
-                       DWORD dwPos = ::GetMessagePos();\r
-                       POINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };\r
-                       pT->ScreenToClient(&pt);\r
-                       RECT rcPane;\r
-                       for(int nPane = 0; nPane < m_nPanesCount; nPane++)\r
-                       {\r
-                               if(GetSplitterPaneRect(nPane, &rcPane) && ::PtInRect(&rcPane, pt))\r
-                               {\r
-                                       m_nDefActivePane = nPane;\r
-                                       break;\r
-                               }\r
-                       }\r
-               }\r
-               return lRet;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               GetSystemSettings(true);\r
-               return 0;\r
-       }\r
-\r
-// Implementation - internal helpers\r
-       void UpdateSplitterLayout()\r
-       {\r
-               if(m_nSinglePane == SPLIT_PANE_NONE && m_xySplitterPos == -1)\r
-                       return;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               RECT rect = { 0, 0, 0, 0 };\r
-               if(m_nSinglePane == SPLIT_PANE_NONE)\r
-               {\r
-                       if(GetSplitterBarRect(&rect))\r
-                               pT->InvalidateRect(&rect);\r
-\r
-                       for(int nPane = 0; nPane < m_nPanesCount; nPane++)\r
-                       {\r
-                               if(GetSplitterPaneRect(nPane, &rect))\r
-                               {\r
-                                       if(m_hWndPane[nPane] != NULL)\r
-                                               ::SetWindowPos(m_hWndPane[nPane], NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);\r
-                                       else\r
-                                               pT->InvalidateRect(&rect);\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if(GetSplitterPaneRect(m_nSinglePane, &rect))\r
-                       {\r
-                               if(m_hWndPane[m_nSinglePane] != NULL)\r
-                                       ::SetWindowPos(m_hWndPane[m_nSinglePane], NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);\r
-                               else\r
-                                       pT->InvalidateRect(&rect);\r
-                       }\r
-               }\r
-       }\r
-\r
-       bool GetSplitterBarRect(LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(lpRect != NULL);\r
-               if(m_nSinglePane != SPLIT_PANE_NONE || m_xySplitterPos == -1)\r
-                       return false;\r
-\r
-               if(t_bVertical)\r
-               {\r
-                       lpRect->left = m_rcSplitter.left + m_xySplitterPos;\r
-                       lpRect->top = m_rcSplitter.top;\r
-                       lpRect->right = m_rcSplitter.left + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\r
-                       lpRect->bottom = m_rcSplitter.bottom;\r
-               }\r
-               else\r
-               {\r
-                       lpRect->left = m_rcSplitter.left;\r
-                       lpRect->top = m_rcSplitter.top + m_xySplitterPos;\r
-                       lpRect->right = m_rcSplitter.right;\r
-                       lpRect->bottom = m_rcSplitter.top + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\r
-               }\r
-\r
-               return true;\r
-       }\r
-\r
-       bool GetSplitterPaneRect(int nPane, LPRECT lpRect) const\r
-       {\r
-               ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);\r
-               ATLASSERT(lpRect != NULL);\r
-               bool bRet = true;\r
-               if(m_nSinglePane != SPLIT_PANE_NONE)\r
-               {\r
-                       if(nPane == m_nSinglePane)\r
-                               *lpRect = m_rcSplitter;\r
-                       else\r
-                               bRet = false;\r
-               }\r
-               else if(nPane == SPLIT_PANE_LEFT)\r
-               {\r
-                       if(t_bVertical)\r
-                       {\r
-                               lpRect->left = m_rcSplitter.left;\r
-                               lpRect->top = m_rcSplitter.top;\r
-                               lpRect->right = m_rcSplitter.left + m_xySplitterPos;\r
-                               lpRect->bottom = m_rcSplitter.bottom;\r
-                       }\r
-                       else\r
-                       {\r
-                               lpRect->left = m_rcSplitter.left;\r
-                               lpRect->top = m_rcSplitter.top;\r
-                               lpRect->right = m_rcSplitter.right;\r
-                               lpRect->bottom = m_rcSplitter.top + m_xySplitterPos;\r
-                       }\r
-               }\r
-               else if(nPane == SPLIT_PANE_RIGHT)\r
-               {\r
-                       if(t_bVertical)\r
-                       {\r
-                               lpRect->left = m_rcSplitter.left + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\r
-                               lpRect->top = m_rcSplitter.top;\r
-                               lpRect->right = m_rcSplitter.right;\r
-                               lpRect->bottom = m_rcSplitter.bottom;\r
-                       }\r
-                       else\r
-                       {\r
-                               lpRect->left = m_rcSplitter.left;\r
-                               lpRect->top = m_rcSplitter.top + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;\r
-                               lpRect->right = m_rcSplitter.right;\r
-                               lpRect->bottom = m_rcSplitter.bottom;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       bRet = false;\r
-               }\r
-               return bRet;\r
-       }\r
-\r
-       bool IsOverSplitterRect(int x, int y) const\r
-       {\r
-               // -1 == don't check\r
-               return ((x == -1 || (x >= m_rcSplitter.left && x <= m_rcSplitter.right)) &&\r
-                       (y == -1 || (y >= m_rcSplitter.top && y <= m_rcSplitter.bottom)));\r
-       }\r
-\r
-       bool IsOverSplitterBar(int x, int y) const\r
-       {\r
-               if(m_nSinglePane != SPLIT_PANE_NONE)\r
-                       return false;\r
-               if(m_xySplitterPos == -1 || !IsOverSplitterRect(x, y))\r
-                       return false;\r
-               int xy = t_bVertical ? x : y;\r
-               int xyOff = t_bVertical ? m_rcSplitter.left : m_rcSplitter.top;\r
-               return ((xy >= (xyOff + m_xySplitterPos)) && (xy < xyOff + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge));\r
-       }\r
-\r
-       void DrawGhostBar()\r
-       {\r
-               RECT rect = { 0, 0, 0, 0 };\r
-               if(GetSplitterBarRect(&rect))\r
-               {\r
-                       // invert the brush pattern (looks just like frame window sizing)\r
-                       T* pT = static_cast<T*>(this);\r
-                       CWindowDC dc(pT->m_hWnd);\r
-                       CBrush brush = CDCHandle::GetHalftoneBrush();\r
-                       if(brush.m_hBrush != NULL)\r
-                       {\r
-                               CBrushHandle brushOld = dc.SelectBrush(brush);\r
-                               dc.PatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);\r
-                               dc.SelectBrush(brushOld);\r
-                       }\r
-               }\r
-       }\r
-\r
-       void GetSystemSettings(bool bUpdate)\r
-       {\r
-#ifndef _WIN32_WCE\r
-               m_cxySplitBar = ::GetSystemMetrics(t_bVertical ? SM_CXSIZEFRAME : SM_CYSIZEFRAME);\r
-#else // CE specific\r
-               m_cxySplitBar = 2 * ::GetSystemMetrics(t_bVertical ? SM_CXEDGE : SM_CYEDGE);\r
-#endif // _WIN32_WCE\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if((pT->GetExStyle() & WS_EX_CLIENTEDGE))\r
-               {\r
-                       m_cxyBarEdge = 2 * ::GetSystemMetrics(t_bVertical ? SM_CXEDGE : SM_CYEDGE);\r
-                       m_cxyMin = 0;\r
-               }\r
-               else\r
-               {\r
-                       m_cxyBarEdge = 0;\r
-                       m_cxyMin = 2 * ::GetSystemMetrics(t_bVertical ? SM_CXEDGE : SM_CYEDGE);\r
-               }\r
-\r
-#ifndef _WIN32_WCE\r
-               ::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &m_bFullDrag, 0);\r
-#endif // !_WIN32_WCE\r
-\r
-               if(bUpdate)\r
-                       UpdateSplitterLayout();\r
-       }\r
-\r
-       bool IsProportional() const\r
-       {\r
-               return ((m_dwExtendedStyle & SPLIT_PROPORTIONAL) != 0);\r
-       }\r
-\r
-       void StoreProportionalPos()\r
-       {\r
-               int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\r
-               if(cxyTotal > 0)\r
-                       m_nProportionalPos = ::MulDiv(m_xySplitterPos, m_nPropMax, cxyTotal);\r
-               else\r
-                       m_nProportionalPos = 0;\r
-               ATLTRACE2(atlTraceUI, 0, _T("CSplitterImpl::StoreProportionalPos - %i\n"), m_nProportionalPos);\r
-       }\r
-\r
-       void UpdateProportionalPos()\r
-       {\r
-               int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\r
-               if(cxyTotal > 0)\r
-               {\r
-                       int xyNewPos = ::MulDiv(m_nProportionalPos, cxyTotal, m_nPropMax);\r
-                       m_bUpdateProportionalPos = false;\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->SetSplitterPos(xyNewPos, false);\r
-               }\r
-       }\r
-\r
-       bool IsRightAligned() const\r
-       {\r
-               return ((m_dwExtendedStyle & SPLIT_RIGHTALIGNED) != 0);\r
-       }\r
-\r
-       void StoreRightAlignPos()\r
-       {\r
-               int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\r
-               if(cxyTotal > 0)\r
-                       m_nProportionalPos = cxyTotal - m_xySplitterPos;\r
-               else\r
-                       m_nProportionalPos = 0;\r
-               ATLTRACE2(atlTraceUI, 0, _T("CSplitterImpl::StoreRightAlignPos - %i\n"), m_nProportionalPos);\r
-       }\r
-\r
-       void UpdateRightAlignPos()\r
-       {\r
-               int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);\r
-               if(cxyTotal > 0)\r
-               {\r
-                       m_bUpdateProportionalPos = false;\r
-                       T* pT = static_cast<T*>(this);\r
-                       pT->SetSplitterPos(cxyTotal - m_nProportionalPos, false);\r
-               }\r
-       }\r
-\r
-       bool IsInteractive() const\r
-       {\r
-               return ((m_dwExtendedStyle & SPLIT_NONINTERACTIVE) == 0);\r
-       }\r
-};\r
-\r
-template <class T, bool t_bVertical> HCURSOR CSplitterImpl< T, t_bVertical>::m_hCursor = NULL;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSplitterWindowImpl - Implements a splitter window\r
-\r
-template <class T, bool t_bVertical = true, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CSplitterWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CSplitterImpl< T , t_bVertical >\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(NULL, CS_DBLCLKS, COLOR_WINDOW)\r
-\r
-       typedef CSplitterImpl< T , t_bVertical >   _baseClass;\r
-\r
-       BEGIN_MSG_MAP(CSplitterWindowImpl)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_SIZE, OnSize)\r
-               CHAIN_MSG_MAP(_baseClass)\r
-               FORWARD_NOTIFICATIONS()\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               // handled, no background painting needed\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(wParam != SIZE_MINIMIZED)\r
-                       SetSplitterRect();\r
-\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSplitterWindow - Implements a splitter window to be used as is\r
-\r
-template <bool t_bVertical = true>\r
-class CSplitterWindowT : public CSplitterWindowImpl<CSplitterWindowT<t_bVertical>, t_bVertical>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_SplitterWindow"), CS_DBLCLKS, COLOR_WINDOW)\r
-};\r
-\r
-typedef CSplitterWindowT<true>    CSplitterWindow;\r
-typedef CSplitterWindowT<false>   CHorSplitterWindow;\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLSPLIT_H__\r
diff --git a/WTL80/include/atltheme.h b/WTL80/include/atltheme.h
deleted file mode 100644 (file)
index 4c0725f..0000000
+++ /dev/null
@@ -1,1218 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLTHEME_H__\r
-#define __ATLTHEME_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifdef _WIN32_WCE\r
-       #error atltheme.h is not supported on Windows CE\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atltheme.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atltheme.h requires atlwin.h to be included first\r
-#endif\r
-\r
-#if (_WIN32_WINNT < 0x0501)\r
-       #error atltheme.h requires _WIN32_WINNT >= 0x0501\r
-#endif // (_WIN32_WINNT < 0x0501)\r
-\r
-#if defined(_WTL_USE_VSSYM32) || (defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN))\r
-  #include <vssym32.h>\r
-#else\r
-  #include <tmschema.h>\r
-#endif\r
-\r
-#include <uxtheme.h>\r
-#pragma comment(lib, "uxtheme.lib")\r
-\r
-// Note: To create an application that also runs on older versions of Windows,\r
-// use delay load of uxtheme.dll and ensure that no calls to the Theme API are\r
-// made if theming is not supported. It is enough to check if m_hTheme is NULL.\r
-// Example:\r
-//     if(m_hTheme != NULL)\r
-//     {\r
-//             DrawThemeBackground(dc, BP_PUSHBUTTON, PBS_NORMAL, &rect, NULL);\r
-//             DrawThemeText(dc, BP_PUSHBUTTON, PBS_NORMAL, L"Button", -1, DT_SINGLELINE | DT_CENTER | DT_VCENTER, 0, &rect);\r
-//     }\r
-//     else\r
-//     {\r
-//             dc.DrawFrameControl(&rect, DFC_BUTTON, DFCS_BUTTONPUSH);\r
-//             dc.DrawText(_T("Button"), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);\r
-//     }\r
-//\r
-// Delay load is NOT AUTOMATIC for VC++ 7, you have to link to delayimp.lib, \r
-// and add uxtheme.dll in the Linker.Input.Delay Loaded DLLs section of the \r
-// project properties.\r
-#if (_MSC_VER < 1300) && !defined(_WTL_NO_THEME_DELAYLOAD)\r
-  #pragma comment(lib, "delayimp.lib")\r
-  #pragma comment(linker, "/delayload:uxtheme.dll")\r
-#endif // (_MSC_VER < 1300) && !defined(_WTL_NO_THEME_DELAYLOAD)\r
-\r
-// Hack: Signatures in uxtheme.h changed - the only way to check which variant of uxtheme.h\r
-// is included is to check for presence of new defines MAX_THEMECOLOR and MAX_THEMESIZE\r
-#ifndef _WTL_NEW_UXTHEME\r
-  #if defined(MAX_THEMECOLOR) && defined(MAX_THEMESIZE)\r
-    #define _WTL_NEW_UXTHEME\r
-  #endif // defined(MAX_THEMECOLOR) && defined(MAX_THEMESIZE)\r
-#endif // _WTL_NEW_UXTHEME\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CTheme\r
-// CThemeImpl<T, TBase>\r
-//\r
-// CBufferedPaint\r
-// CBufferedPaintImpl<T>\r
-// CBufferedPaintWindowImpl<T, TBase, TWinTraits>\r
-// CBufferedAnimation\r
-// CBufferedAnimationImpl<T, TState>\r
-// CBufferedAnimationWindowImpl<T, TState, TBase, TWinTraits>\r
-//\r
-// Global functions:\r
-//   AtlDrawThemeClientEdge()\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTheme - wrapper for theme handle\r
-\r
-class CTheme\r
-{\r
-public:\r
-// Data members\r
-       HTHEME m_hTheme;\r
-       static int m_nIsThemingSupported;\r
-\r
-// Constructor\r
-       CTheme(HTHEME hTheme = NULL) : m_hTheme(hTheme)\r
-       {\r
-               IsThemingSupported();\r
-       }\r
-\r
-// Operators and helpers\r
-       bool IsThemeNull() const\r
-       {\r
-               return (m_hTheme == NULL);\r
-       }\r
-\r
-       CTheme& operator =(HTHEME hTheme)\r
-       {\r
-               m_hTheme = hTheme;\r
-               return *this;\r
-       }\r
-\r
-       operator HTHEME() const\r
-       {\r
-               return m_hTheme;\r
-       }\r
-\r
-       void Attach(HTHEME hTheme)\r
-       {\r
-               m_hTheme = hTheme;\r
-       }\r
-\r
-       HTHEME Detach()\r
-       {\r
-               HTHEME hTheme = m_hTheme;\r
-               m_hTheme = NULL;\r
-               return hTheme;\r
-       }\r
-\r
-// Theme support helper\r
-       static bool IsThemingSupported()\r
-       {\r
-               if(m_nIsThemingSupported == -1)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CTheme::IsThemingSupported.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return false;\r
-                       }\r
-\r
-                       if(m_nIsThemingSupported == -1)\r
-                       {\r
-                               HMODULE hThemeDLL = ::LoadLibrary(_T("uxtheme.dll"));\r
-                               m_nIsThemingSupported = (hThemeDLL != NULL) ? 1 : 0;\r
-                               if(hThemeDLL != NULL)\r
-                                       ::FreeLibrary(hThemeDLL);\r
-                       }\r
-\r
-                       lock.Unlock();\r
-               }\r
-\r
-               ATLASSERT(m_nIsThemingSupported != -1);\r
-               return (m_nIsThemingSupported == 1);\r
-       }\r
-\r
-// Operations and theme properties\r
-       HTHEME OpenThemeData(HWND hWnd, LPCWSTR pszClassList)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return NULL;\r
-\r
-               ATLASSERT(m_hTheme == NULL);\r
-               m_hTheme = ::OpenThemeData(hWnd, pszClassList);\r
-               return m_hTheme;\r
-       }\r
-\r
-       HRESULT CloseThemeData()\r
-       {\r
-               HRESULT hRet = S_FALSE;\r
-               if(m_hTheme != NULL)\r
-               {\r
-                       hRet = ::CloseThemeData(m_hTheme);\r
-                       if(SUCCEEDED(hRet))\r
-                               m_hTheme = NULL;\r
-               }\r
-               return hRet;\r
-       }\r
-\r
-       HRESULT DrawThemeBackground(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, LPCRECT pClipRect = NULL)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::DrawThemeBackground(m_hTheme, hDC, nPartID, nStateID, pRect, pClipRect);\r
-       }\r
-\r
-       HRESULT DrawThemeBackgroundEx(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, const DTBGOPTS* pOptions = NULL)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::DrawThemeBackgroundEx(m_hTheme, hDC, nPartID, nStateID, pRect, pOptions);\r
-       }\r
-\r
-       HRESULT DrawThemeText(HDC hDC, int nPartID, int nStateID, LPCWSTR pszText, int nCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::DrawThemeText(m_hTheme, hDC, nPartID, nStateID, pszText, nCharCount, dwTextFlags, dwTextFlags2, pRect);\r
-       }\r
-\r
-       HRESULT GetThemeBackgroundContentRect(HDC hDC, int nPartID, int nStateID,  LPCRECT pBoundingRect, LPRECT pContentRect) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeBackgroundContentRect(m_hTheme, hDC, nPartID, nStateID,  pBoundingRect, pContentRect);\r
-       }\r
-\r
-       HRESULT GetThemeBackgroundExtent(HDC hDC, int nPartID, int nStateID, LPCRECT pContentRect, LPRECT pExtentRect) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeBackgroundExtent(m_hTheme, hDC, nPartID, nStateID, pContentRect, pExtentRect);\r
-       }\r
-\r
-       HRESULT GetThemePartSize(HDC hDC, int nPartID, int nStateID, LPRECT pRect, enum THEMESIZE eSize, LPSIZE pSize) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemePartSize(m_hTheme, hDC, nPartID, nStateID, pRect, eSize, pSize);\r
-       }\r
-\r
-       HRESULT GetThemeTextExtent(HDC hDC, int nPartID, int nStateID, LPCWSTR pszText, int nCharCount, DWORD dwTextFlags, LPCRECT  pBoundingRect, LPRECT pExtentRect) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeTextExtent(m_hTheme, hDC, nPartID, nStateID, pszText, nCharCount, dwTextFlags, pBoundingRect, pExtentRect);\r
-       }\r
-\r
-       HRESULT GetThemeTextMetrics(HDC hDC, int nPartID, int nStateID, PTEXTMETRICW pTextMetric) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-#ifdef _WTL_NEW_UXTHEME\r
-               return ::GetThemeTextMetrics(m_hTheme, hDC, nPartID, nStateID, pTextMetric);\r
-#else // !_WTL_NEW_UXTHEME\r
-               // Note: The cast to PTEXTMETRIC is because uxtheme.h incorrectly uses it instead of PTEXTMETRICW\r
-               return ::GetThemeTextMetrics(m_hTheme, hDC, nPartID, nStateID, (PTEXTMETRIC)pTextMetric);\r
-#endif // !_WTL_NEW_UXTHEME\r
-       }\r
-\r
-       HRESULT GetThemeBackgroundRegion(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, HRGN* pRegion) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeBackgroundRegion(m_hTheme, hDC, nPartID, nStateID, pRect, pRegion);\r
-       }\r
-\r
-       HRESULT HitTestThemeBackground(HDC hDC, int nPartID, int nStateID, DWORD dwOptions, LPCRECT pRect, HRGN hrgn, POINT ptTest, WORD* pwHitTestCode) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::HitTestThemeBackground(m_hTheme, hDC, nPartID, nStateID, dwOptions, pRect, hrgn, ptTest, pwHitTestCode);\r
-       }\r
-\r
-       HRESULT DrawThemeEdge(HDC hDC, int nPartID, int nStateID, LPCRECT pDestRect, UINT uEdge, UINT uFlags, LPRECT pContentRect = NULL)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::DrawThemeEdge(m_hTheme, hDC, nPartID, nStateID, pDestRect, uEdge, uFlags, pContentRect);\r
-       }\r
-\r
-       HRESULT DrawThemeIcon(HDC hDC, int nPartID, int nStateID, LPCRECT pRect, HIMAGELIST himl, int nImageIndex)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::DrawThemeIcon(m_hTheme, hDC, nPartID, nStateID, pRect, himl, nImageIndex);\r
-       }\r
-\r
-       BOOL IsThemePartDefined(int nPartID, int nStateID) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::IsThemePartDefined(m_hTheme, nPartID, nStateID);\r
-       }\r
-\r
-       BOOL IsThemeBackgroundPartiallyTransparent(int nPartID, int nStateID) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::IsThemeBackgroundPartiallyTransparent(m_hTheme, nPartID, nStateID);\r
-       }\r
-\r
-       HRESULT GetThemeColor(int nPartID, int nStateID, int nPropID, COLORREF* pColor) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeColor(m_hTheme, nPartID, nStateID, nPropID, pColor);\r
-       }\r
-\r
-       HRESULT GetThemeMetric(HDC hDC, int nPartID, int nStateID, int nPropID, int* pnVal) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeMetric(m_hTheme, hDC, nPartID, nStateID, nPropID, pnVal);\r
-       }\r
-\r
-       HRESULT GetThemeString(int nPartID, int nStateID, int nPropID, LPWSTR pszBuff, int cchMaxBuffChars) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeString(m_hTheme, nPartID, nStateID, nPropID, pszBuff, cchMaxBuffChars);\r
-       }\r
-\r
-       HRESULT GetThemeBool(int nPartID, int nStateID, int nPropID, BOOL* pfVal) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeBool(m_hTheme, nPartID, nStateID, nPropID, pfVal);\r
-       }\r
-\r
-       HRESULT GetThemeInt(int nPartID, int nStateID, int nPropID, int* pnVal) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeInt(m_hTheme, nPartID, nStateID, nPropID, pnVal);\r
-       }\r
-\r
-       HRESULT GetThemeEnumValue(int nPartID, int nStateID, int nPropID, int* pnVal) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeEnumValue(m_hTheme, nPartID, nStateID, nPropID, pnVal);\r
-       }\r
-\r
-       HRESULT GetThemePosition(int nPartID, int nStateID, int nPropID, LPPOINT pPoint) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemePosition(m_hTheme, nPartID, nStateID, nPropID, pPoint);\r
-       }\r
-\r
-       // deprecated\r
-       HRESULT GetThemeFont(int nPartID, HDC hDC, int nStateID, int nPropID, LOGFONTW* pFont) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-#ifdef _WTL_NEW_UXTHEME\r
-               return ::GetThemeFont(m_hTheme, hDC, nPartID, nStateID, nPropID, pFont);\r
-#else // !_WTL_NEW_UXTHEME\r
-               // Note: The cast to LOGFONT* is because uxtheme.h incorrectly uses it instead of LOGFONTW*\r
-               return ::GetThemeFont(m_hTheme, hDC, nPartID, nStateID, nPropID, (LOGFONT*)pFont);\r
-#endif // !_WTL_NEW_UXTHEME\r
-       }\r
-\r
-       HRESULT GetThemeFont(HDC hDC, int nPartID, int nStateID, int nPropID, LOGFONTW* pFont) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-#ifdef _WTL_NEW_UXTHEME\r
-               return ::GetThemeFont(m_hTheme, hDC, nPartID, nStateID, nPropID, pFont);\r
-#else // !_WTL_NEW_UXTHEME\r
-               // Note: The cast to LOGFONT* is because uxtheme.h incorrectly uses it instead of LOGFONTW*\r
-               return ::GetThemeFont(m_hTheme, hDC, nPartID, nStateID, nPropID, (LOGFONT*)pFont);\r
-#endif // !_WTL_NEW_UXTHEME\r
-       }\r
-\r
-       HRESULT GetThemeRect(int nPartID, int nStateID, int nPropID, LPRECT pRect) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeRect(m_hTheme, nPartID, nStateID, nPropID, pRect);\r
-       }\r
-\r
-       HRESULT GetThemeMargins(HDC hDC, int nPartID, int nStateID, int nPropID, LPRECT pRect, PMARGINS pMargins) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeMargins(m_hTheme, hDC, nPartID, nStateID, nPropID, pRect, pMargins);\r
-       }\r
-\r
-       HRESULT GetThemeIntList(int nPartID, int nStateID, int nPropID, INTLIST* pIntList) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeIntList(m_hTheme, nPartID, nStateID, nPropID, pIntList);\r
-       }\r
-\r
-       HRESULT GetThemePropertyOrigin(int nPartID, int nStateID, int nPropID, enum PROPERTYORIGIN* pOrigin) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemePropertyOrigin(m_hTheme, nPartID, nStateID, nPropID, pOrigin);\r
-       }\r
-\r
-       HRESULT GetThemeFilename(int nPartID, int nStateID, int nPropID, LPWSTR pszThemeFileName, int cchMaxBuffChars) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeFilename(m_hTheme, nPartID, nStateID, nPropID, pszThemeFileName, cchMaxBuffChars);\r
-       }\r
-\r
-       COLORREF GetThemeSysColor(int nColorID) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeSysColor(m_hTheme, nColorID);\r
-       }\r
-\r
-       HBRUSH GetThemeSysColorBrush(int nColorID) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeSysColorBrush(m_hTheme, nColorID);\r
-       }\r
-\r
-       int GetThemeSysSize(int nSizeID) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeSysSize(m_hTheme, nSizeID);\r
-       }\r
-\r
-       BOOL GetThemeSysBool(int nBoolID) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeSysBool(m_hTheme, nBoolID);\r
-       }\r
-\r
-       HRESULT GetThemeSysFont(int nFontID, LOGFONTW* plf) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-#ifdef _WTL_NEW_UXTHEME\r
-               return ::GetThemeSysFont(m_hTheme, nFontID, plf);\r
-#else // !_WTL_NEW_UXTHEME\r
-               // Note: The cast to LOGFONT* is because uxtheme.h incorrectly uses it instead of LOGFONTW*\r
-               return ::GetThemeSysFont(m_hTheme, nFontID, (LOGFONT*)plf);\r
-#endif // !_WTL_NEW_UXTHEME\r
-       }\r
-\r
-       HRESULT GetThemeSysString(int nStringID, LPWSTR pszStringBuff, int cchMaxStringChars) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeSysString(m_hTheme, nStringID, pszStringBuff, cchMaxStringChars);\r
-       }\r
-\r
-       HRESULT GetThemeSysInt(int nIntID, int* pnValue) const\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeSysInt(m_hTheme, nIntID, pnValue);\r
-       }\r
-\r
-#ifdef _WTL_NEW_UXTHEME\r
-       HTHEME OpenThemeDataEx(HWND hWnd, LPCWSTR pszClassList, DWORD dwFlags)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return NULL;\r
-\r
-               ATLASSERT(m_hTheme == NULL);\r
-               m_hTheme = ::OpenThemeDataEx(hWnd, pszClassList, dwFlags);\r
-               return m_hTheme;\r
-       }\r
-\r
-       HRESULT DrawThemeTextEx(HDC hDC, int nPartID, int nStateID, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT lpRect, const DTTOPTS* pOptions)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::DrawThemeTextEx(m_hTheme, hDC, nPartID, nStateID, pszText, cchText, dwTextFlags, lpRect, pOptions);\r
-       }\r
-\r
-       HRESULT GetThemeTransitionDuration(int nPartID, int nFromStateID, int nToStateID, int nPropID, DWORD& dwDuration)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeTransitionDuration(m_hTheme, nPartID, nFromStateID, nToStateID, nPropID, &dwDuration);\r
-       }\r
-#endif // _WTL_NEW_UXTHEME\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       HRESULT GetThemeBitmap(int nPartID, int nStateID, int nPropID, ULONG uFlags, HBITMAP& hBitmap)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeBitmap(m_hTheme, nPartID, nStateID, nPropID, uFlags, &hBitmap);\r
-       }\r
-\r
-       HRESULT GetThemeStream(int nPartID, int nStateID, int nPropID, VOID** ppvStream, DWORD* pcbStream, HINSTANCE hInstance)\r
-       {\r
-               ATLASSERT(m_hTheme != NULL);\r
-               return ::GetThemeStream(m_hTheme, nPartID, nStateID, nPropID, ppvStream, pcbStream, hInstance);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-};\r
-\r
-__declspec(selectany) int CTheme::m_nIsThemingSupported = -1;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CThemeImpl - theme support implementation\r
-\r
-// Derive from this class to implement window with theme support.\r
-// Example:\r
-//     class CMyThemeWindow : public CWindowImpl<CMyThemeWindow>, public CThemeImpl<CMyThemeWindow>\r
-//     {\r
-//     ...\r
-//             BEGIN_MSG_MAP(CMyThemeWindow)\r
-//                     CHAIN_MSG_MAP(CThemeImpl<CMyThemeWindow>)\r
-//                     ...\r
-//             END_MSG_MAP()\r
-//     ...\r
-//     };\r
-//\r
-// If you set theme class list, the class will automaticaly open/close/reopen theme data.\r
-\r
-\r
-// Helper for drawing theme client edge\r
-inline bool AtlDrawThemeClientEdge(HTHEME hTheme, HWND hWnd, HRGN hRgnUpdate = NULL, HBRUSH hBrush = NULL, int nPartID = 0, int nStateID = 0)\r
-{\r
-       ATLASSERT(hTheme != NULL);\r
-       ATLASSERT(::IsWindow(hWnd));\r
-\r
-       CWindowDC dc(hWnd);\r
-       if(dc.IsNull())\r
-               return false;\r
-\r
-       // Get border size\r
-       int cxBorder = GetSystemMetrics(SM_CXBORDER);\r
-       int cyBorder = GetSystemMetrics(SM_CYBORDER);\r
-       if(SUCCEEDED(::GetThemeInt(hTheme, nPartID, nStateID, TMT_SIZINGBORDERWIDTH, &cxBorder)))\r
-               cyBorder = cxBorder;\r
-\r
-       RECT rect;\r
-       ::GetWindowRect(hWnd, &rect);            \r
-\r
-       // Remove the client edge from the update region\r
-       int cxEdge = GetSystemMetrics(SM_CXEDGE);\r
-       int cyEdge = GetSystemMetrics(SM_CYEDGE);\r
-       ::InflateRect(&rect, -cxEdge, -cyEdge);\r
-       CRgn rgn;\r
-       rgn.CreateRectRgnIndirect(&rect);\r
-       if(rgn.IsNull())\r
-               return false;\r
-\r
-       if(hRgnUpdate != NULL)\r
-               rgn.CombineRgn(hRgnUpdate, rgn, RGN_AND);\r
-\r
-       ::OffsetRect(&rect, -rect.left, -rect.top);\r
-\r
-       ::OffsetRect(&rect, cxEdge, cyEdge);\r
-       dc.ExcludeClipRect(&rect);\r
-       ::InflateRect(&rect, cxEdge, cyEdge);\r
-\r
-       ::DrawThemeBackground(hTheme, dc, nPartID, nStateID, &rect, NULL);\r
-\r
-       // Use background brush too, since theme border might not cover everything\r
-       if(cxBorder < cxEdge && cyBorder < cyEdge)\r
-       {\r
-               if(hBrush == NULL)\r
-// need conditional code because types don't match in winuser.h\r
-#ifdef _WIN64\r
-                       hBrush = (HBRUSH)::GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND);\r
-#else\r
-                       hBrush = (HBRUSH)UlongToPtr(::GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND));\r
-#endif\r
-\r
-               ::InflateRect(&rect, cxBorder - cxEdge, cyBorder - cyEdge);\r
-               dc.FillRect(&rect, hBrush);\r
-       }\r
-\r
-       ::DefWindowProc(hWnd, WM_NCPAINT, (WPARAM)rgn.m_hRgn, 0L);\r
-\r
-       return true;\r
-}\r
-\r
-\r
-// Theme extended styles\r
-#define THEME_EX_3DCLIENTEDGE          0x00000001\r
-#define THEME_EX_THEMECLIENTEDGE       0x00000002\r
-\r
-template <class T, class TBase = CTheme>\r
-class CThemeImpl : public TBase\r
-{\r
-public:\r
-// Data members\r
-       LPWSTR m_lpstrThemeClassList;\r
-       DWORD m_dwExtendedStyle;   // theme specific extended styles\r
-\r
-// Constructor & destructor\r
-       CThemeImpl() : m_lpstrThemeClassList(NULL), m_dwExtendedStyle(0)\r
-       { }\r
-\r
-       ~CThemeImpl()\r
-       {\r
-               delete [] m_lpstrThemeClassList;\r
-       }\r
-\r
-// Attributes\r
-       bool SetThemeClassList(LPCWSTR lpstrThemeClassList)\r
-       {\r
-               if(m_lpstrThemeClassList != NULL)\r
-               {\r
-                       delete [] m_lpstrThemeClassList;\r
-                       m_lpstrThemeClassList = NULL;\r
-               }\r
-\r
-               if(lpstrThemeClassList == NULL)\r
-                       return true;\r
-\r
-               int cchLen = lstrlenW(lpstrThemeClassList) + 1;\r
-               ATLTRY(m_lpstrThemeClassList = new WCHAR[cchLen]);\r
-               if(m_lpstrThemeClassList == NULL)\r
-                       return false;\r
-\r
-               SecureHelper::strcpyW_x(m_lpstrThemeClassList, cchLen, lpstrThemeClassList);\r
-\r
-               return true;\r
-       }\r
-\r
-       bool GetThemeClassList(LPWSTR lpstrThemeClassList, int cchListBuffer) const\r
-       {\r
-               int cchLen = lstrlenW(m_lpstrThemeClassList) + 1;\r
-               if(cchListBuffer < cchLen)\r
-                       return false;\r
-\r
-               SecureHelper::strcpyW_x(lpstrThemeClassList, cchListBuffer, m_lpstrThemeClassList);\r
-\r
-               return true;\r
-       }\r
-\r
-       LPCWSTR GetThemeClassList() const\r
-       {\r
-               return m_lpstrThemeClassList;\r
-       }\r
-\r
-       DWORD SetThemeExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)\r
-       {\r
-               DWORD dwPrevStyle = m_dwExtendedStyle;\r
-               if(dwMask == 0)\r
-                       m_dwExtendedStyle = dwExtendedStyle;\r
-               else\r
-                       m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);\r
-               return dwPrevStyle;\r
-       }\r
-\r
-       DWORD GetThemeExtendedStyle() const\r
-       {\r
-               return m_dwExtendedStyle;\r
-       }\r
-\r
-// Operations\r
-       HTHEME OpenThemeData()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               ATLASSERT(m_lpstrThemeClassList != NULL);\r
-               if(m_lpstrThemeClassList == NULL)\r
-                       return NULL;\r
-               CloseThemeData();\r
-               return TBase::OpenThemeData(pT->m_hWnd, m_lpstrThemeClassList);\r
-       }\r
-\r
-       HTHEME OpenThemeData(LPCWSTR pszClassList)\r
-       {\r
-               if(!SetThemeClassList(pszClassList))\r
-                       return NULL;\r
-               return OpenThemeData();\r
-       }\r
-\r
-       HRESULT SetWindowTheme(LPCWSTR pszSubAppName, LPCWSTR pszSubIDList)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return S_FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::SetWindowTheme(pT->m_hWnd, pszSubAppName, pszSubIDList);\r
-       }\r
-\r
-       HTHEME GetWindowTheme() const\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return NULL;\r
-\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::GetWindowTheme(pT->m_hWnd);\r
-       }\r
-\r
-       HRESULT EnableThemeDialogTexture(DWORD dwFlags)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return S_FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::EnableThemeDialogTexture(pT->m_hWnd, dwFlags);\r
-       }\r
-\r
-       BOOL IsThemeDialogTextureEnabled() const\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return FALSE;\r
-\r
-               const T* pT = static_cast<const T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::IsThemeDialogTextureEnabled(pT->m_hWnd);\r
-       }\r
-\r
-       HRESULT DrawThemeParentBackground(HDC hDC, const RECT* pRect = NULL)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return S_FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-#ifdef _WTL_NEW_UXTHEME\r
-               return ::DrawThemeParentBackground(pT->m_hWnd, hDC, pRect);\r
-#else\r
-               return ::DrawThemeParentBackground(pT->m_hWnd, hDC, (RECT*)pRect);\r
-#endif\r
-       }\r
-\r
-#ifdef _WTL_NEW_UXTHEME\r
-       HRESULT SetWindowThemeAttribute(WINDOWTHEMEATTRIBUTETYPE type, PVOID pvAttribute, DWORD cbAttribute)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return S_FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::SetWindowThemeAttribute(pT->m_hWnd, type, pvAttribute, cbAttribute);\r
-       }\r
-\r
-       HRESULT SetWindowThemeNonClientAttributes(DWORD dwAttributes, DWORD dwMask)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return S_FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               WTA_OPTIONS opt = { dwAttributes, dwMask };\r
-               return ::SetWindowThemeAttribute(pT->m_hWnd, WTA_NONCLIENT, (PVOID)&opt, sizeof(opt));\r
-       }\r
-\r
-       HRESULT DrawThemeParentBackgroundEx(HDC hDC, DWORD dwFlags, const RECT* lpRect = NULL)\r
-       {\r
-               if(!IsThemingSupported())\r
-                       return S_FALSE;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               return ::DrawThemeParentBackgroundEx(pT->m_hWnd, hDC, dwFlags, lpRect);\r
-       }\r
-#endif // _WTL_NEW_UXTHEME\r
-\r
-// Message map and handlers\r
-       // Note: If you handle any of these messages in your derived class,\r
-       // it is better to put CHAIN_MSG_MAP at the start of your message map.\r
-       BEGIN_MSG_MAP(CThemeImpl)\r
-               MESSAGE_HANDLER(WM_CREATE, OnCreate)\r
-               MESSAGE_HANDLER(WM_DESTROY, OnDestroy)\r
-               MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)\r
-               MESSAGE_HANDLER(WM_NCPAINT, OnNcPaint)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if(m_lpstrThemeClassList != NULL)\r
-                       OpenThemeData();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               CloseThemeData();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnThemeChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               CloseThemeData();\r
-               if(m_lpstrThemeClassList != NULL)\r
-                       OpenThemeData();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               LRESULT lRet = 0;\r
-               bHandled = FALSE;\r
-               if(IsThemingSupported() && ((pT->GetExStyle() & WS_EX_CLIENTEDGE) != 0))\r
-               {\r
-                       if((m_dwExtendedStyle & THEME_EX_3DCLIENTEDGE) != 0)\r
-                       {\r
-                               lRet = ::DefWindowProc(pT->m_hWnd, uMsg, wParam, lParam);\r
-                               bHandled = TRUE;\r
-                       }\r
-                       else if((m_hTheme != NULL) && ((m_dwExtendedStyle & THEME_EX_THEMECLIENTEDGE) != 0))\r
-                       {\r
-                               HRGN hRgn = (wParam != 1) ? (HRGN)wParam : NULL;\r
-                               if(pT->DrawThemeClientEdge(hRgn))\r
-                                       bHandled = TRUE;\r
-                       }\r
-               }\r
-               return lRet;\r
-       }\r
-\r
-// Drawing helper\r
-       bool DrawThemeClientEdge(HRGN hRgnUpdate)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return AtlDrawThemeClientEdge(m_hTheme, pT->m_hWnd, hRgnUpdate, NULL, 0, 0);\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Buffered Paint and Animation\r
-\r
-#ifdef _WTL_NEW_UXTHEME\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedPaintBase - Buffered Paint support for othe classes\r
-\r
-class CBufferedPaintBase\r
-{\r
-public:\r
-       static int m_nIsBufferedPaintSupported;\r
-\r
-       CBufferedPaintBase()\r
-       {\r
-               if(IsBufferedPaintSupported())\r
-                       ATLVERIFY(SUCCEEDED(::BufferedPaintInit()));\r
-       }\r
-\r
-       ~CBufferedPaintBase()\r
-       {\r
-               if(IsBufferedPaintSupported())\r
-                       ATLVERIFY(SUCCEEDED(::BufferedPaintUnInit()));\r
-       }\r
-\r
-       static bool IsBufferedPaintSupported()\r
-       {\r
-               if(m_nIsBufferedPaintSupported == -1)\r
-               {\r
-                       CStaticDataInitCriticalSectionLock lock;\r
-                       if(FAILED(lock.Lock()))\r
-                       {\r
-                               ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CBufferedPaintBase::IsBufferedPaintSupported.\n"));\r
-                               ATLASSERT(FALSE);\r
-                               return false;\r
-                       }\r
-\r
-                       if(m_nIsBufferedPaintSupported == -1)\r
-                               m_nIsBufferedPaintSupported = RunTimeHelper::IsVista() ? 1 : 0;\r
-\r
-                       lock.Unlock();\r
-               }\r
-\r
-               ATLASSERT(m_nIsBufferedPaintSupported != -1);\r
-               return (m_nIsBufferedPaintSupported == 1);\r
-       }\r
-};\r
-\r
-__declspec(selectany) int CBufferedPaintBase::m_nIsBufferedPaintSupported = -1;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedPaint - support for buffered paint functions\r
-\r
-class CBufferedPaint\r
-{\r
-public:\r
-       HPAINTBUFFER m_hPaintBuffer;\r
-\r
-       CBufferedPaint() : m_hPaintBuffer(NULL)\r
-       { }\r
-\r
-       ~CBufferedPaint()\r
-       {\r
-               ATLVERIFY(SUCCEEDED(End()));\r
-       }\r
-\r
-       bool IsNull() const\r
-       {\r
-               return (m_hPaintBuffer == NULL);\r
-       }\r
-\r
-       HPAINTBUFFER Begin(HDC hdcTarget, const RECT* prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdcPaint)\r
-       {\r
-               ATLASSERT(m_hPaintBuffer == NULL);\r
-               m_hPaintBuffer = ::BeginBufferedPaint(hdcTarget, prcTarget, dwFormat, pPaintParams, phdcPaint);\r
-               return m_hPaintBuffer;\r
-       }\r
-\r
-       HRESULT End(BOOL bUpdate = TRUE)\r
-       {\r
-               HRESULT hRet = S_FALSE;\r
-               if(m_hPaintBuffer != NULL)\r
-               {\r
-                       hRet = ::EndBufferedPaint(m_hPaintBuffer, bUpdate);\r
-                       m_hPaintBuffer = NULL;\r
-               }\r
-               return hRet;\r
-       }\r
-\r
-       HRESULT GetTargetRect(LPRECT pRect) const\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::GetBufferedPaintTargetRect(m_hPaintBuffer, pRect);\r
-       }\r
-\r
-       HDC GetTargetDC() const\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::GetBufferedPaintTargetDC(m_hPaintBuffer);\r
-       }\r
-\r
-       HDC GetPaintDC() const\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::GetBufferedPaintDC(m_hPaintBuffer);\r
-       }\r
-\r
-       HRESULT GetBits(RGBQUAD** ppbBuffer, int* pcxRow) const\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::GetBufferedPaintBits(m_hPaintBuffer, ppbBuffer, pcxRow);\r
-       }\r
-\r
-       HRESULT Clear(const RECT* pRect = NULL)\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::BufferedPaintClear(m_hPaintBuffer, pRect);\r
-       }\r
-\r
-       HRESULT SetAlpha(BYTE alpha, const RECT* pRect = NULL)\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::BufferedPaintSetAlpha(m_hPaintBuffer, pRect, alpha);\r
-       }\r
-\r
-       HRESULT MakeOpaque(const RECT* pRect = NULL)\r
-       {\r
-               ATLASSERT(m_hPaintBuffer != NULL);\r
-               return ::BufferedPaintSetAlpha(m_hPaintBuffer, pRect, 255);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedPaintImpl - provides buffered paint for any window\r
-\r
-template <class T>\r
-class ATL_NO_VTABLE CBufferedPaintImpl : public CBufferedPaintBase\r
-{\r
-public:\r
-       CBufferedPaint m_BufferedPaint;\r
-       BP_BUFFERFORMAT m_dwFormat;\r
-       BP_PAINTPARAMS m_PaintParams;\r
-\r
-       CBufferedPaintImpl() : m_dwFormat(BPBF_TOPDOWNDIB)\r
-       {\r
-               memset(&m_PaintParams, 0, sizeof(BP_PAINTPARAMS));\r
-               m_PaintParams.cbSize = sizeof(BP_PAINTPARAMS);\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CBufferedPaintImpl)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background needed\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if(wParam != NULL)\r
-               {\r
-                       RECT rect = { 0 };\r
-                       pT->GetClientRect(&rect);\r
-                       pT->DoPaint((HDC)wParam, rect);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       pT->DoBufferedPaint(dc.m_hDC, dc.m_ps.rcPaint);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-// Overrideables\r
-       void DoBufferedPaint(CDCHandle dc, RECT& rect)\r
-       {\r
-               HDC hDCPaint = NULL;\r
-               if(IsBufferedPaintSupported())\r
-                       m_BufferedPaint.Begin(dc, &rect, m_dwFormat, &m_PaintParams, &hDCPaint);\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               if(hDCPaint != NULL)\r
-                       pT->DoPaint(hDCPaint, rect);\r
-               else\r
-                       pT->DoPaint(dc.m_hDC, rect);\r
-\r
-               if(IsBufferedPaintSupported())\r
-                       m_BufferedPaint.End();\r
-       }\r
-\r
-       void DoPaint(CDCHandle /*dc*/, RECT& /*rect*/)\r
-       {\r
-               // must be implemented in a derived class\r
-               ATLASSERT(FALSE);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedPaintWindowImpl - implements a window that uses buffered paint\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CBufferedPaintWindowImpl : \r
-               public ATL::CWindowImpl<T, TBase, TWinTraits>, \r
-               public CBufferedPaintImpl< T >\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CBufferedPaintWindowImpl)\r
-               CHAIN_MSG_MAP(CBufferedPaintImpl< T >)\r
-       END_MSG_MAP()\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedAnimation - support for buffered animation\r
-\r
-class CBufferedAnimation\r
-{\r
-public:\r
-       HANIMATIONBUFFER m_hAnimationBuffer;\r
-\r
-       CBufferedAnimation() : m_hAnimationBuffer(NULL)\r
-       { }\r
-\r
-       ~CBufferedAnimation()\r
-       {\r
-               ATLVERIFY(SUCCEEDED(End()));\r
-       }\r
-\r
-       bool IsNull() const\r
-       {\r
-               return (m_hAnimationBuffer == NULL);\r
-       }\r
-\r
-       HANIMATIONBUFFER Begin(HWND hWnd, HDC hDCTarget, const RECT* pRectTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, BP_ANIMATIONPARAMS* pAnimationParams, HDC* phdcFrom, HDC* phdcTo)\r
-       {\r
-               ATLASSERT(m_hAnimationBuffer == NULL);\r
-               m_hAnimationBuffer = ::BeginBufferedAnimation(hWnd, hDCTarget, pRectTarget, dwFormat, pPaintParams, pAnimationParams, phdcFrom, phdcTo);\r
-               return m_hAnimationBuffer;\r
-       }\r
-\r
-       HRESULT End(BOOL bUpdate = TRUE)\r
-       {\r
-               HRESULT hRet = S_FALSE;\r
-               if(m_hAnimationBuffer != NULL)\r
-               {\r
-                       hRet = ::EndBufferedAnimation(m_hAnimationBuffer, bUpdate);\r
-                       m_hAnimationBuffer = NULL;\r
-               }\r
-               return hRet;\r
-       }\r
-\r
-       static bool IsRendering(HWND hWnd, HDC hDC)\r
-       {\r
-               return (::BufferedPaintRenderAnimation(hWnd, hDC) != FALSE);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedAnimationImpl - provides buffered animation support for any window\r
-\r
-// Note: You can either use m_State and m_NewState to store the state information\r
-// for the animation change, or map your state to those data members. DoPaint()\r
-// should only rely on the state information that is passed to it.\r
-\r
-template <class T, class TState = DWORD_PTR>\r
-class ATL_NO_VTABLE CBufferedAnimationImpl : public CBufferedPaintBase\r
-{\r
-public:\r
-       BP_BUFFERFORMAT m_dwFormat;\r
-       BP_PAINTPARAMS m_PaintParams;\r
-       BP_ANIMATIONPARAMS m_AnimationParams;\r
-\r
-       TState m_State;\r
-       TState m_NewState;\r
-\r
-       CBufferedAnimationImpl(TState InitialState) : m_dwFormat(BPBF_TOPDOWNDIB)\r
-       {\r
-               memset(&m_PaintParams, 0, sizeof(BP_PAINTPARAMS));\r
-               m_PaintParams.cbSize = sizeof(BP_PAINTPARAMS);\r
-\r
-               memset(&m_AnimationParams, 0, sizeof(BP_ANIMATIONPARAMS));\r
-               m_AnimationParams.cbSize = sizeof(BP_ANIMATIONPARAMS);\r
-               m_AnimationParams.style = BPAS_LINEAR;\r
-               m_AnimationParams.dwDuration = 500;\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetState(InitialState);\r
-               pT->SetNewState(InitialState);\r
-       }\r
-\r
-       DWORD GetDuration() const\r
-       {\r
-               return m_AnimationParams.dwDuration;\r
-       }\r
-\r
-       void SetDuration(DWORD dwDuration)\r
-       {\r
-               m_AnimationParams.dwDuration = dwDuration;\r
-       }\r
-\r
-       void DoAnimation(TState NewState, const RECT* pRect = NULL)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->SetNewState(NewState);\r
-\r
-               pT->InvalidateRect(pRect, FALSE);\r
-               pT->UpdateWindow();\r
-\r
-               pT->SetState(NewState);\r
-       }\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CBufferedAnimationImpl)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaint)\r
-               MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               return 1;   // no background needed\r
-       }\r
-\r
-       LRESULT OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if(wParam != NULL)\r
-               {\r
-                       RECT rect = { 0 };\r
-                       pT->GetClientRect(&rect);\r
-                       pT->DoPaint((HDC)wParam, rect, m_NewState);\r
-               }\r
-               else\r
-               {\r
-                       CPaintDC dc(pT->m_hWnd);\r
-                       pT->DoAnimationPaint(dc.m_hDC, dc.m_ps.rcPaint);\r
-               }\r
-\r
-               return 0;\r
-       }\r
-\r
-// Overrideables\r
-       void SetState(TState State)\r
-       {\r
-               m_State = State;\r
-       }\r
-\r
-       void SetNewState(TState State)\r
-       {\r
-               m_NewState = State;\r
-       }\r
-\r
-       bool AreStatesEqual() const\r
-       {\r
-               return (m_State == m_NewState);\r
-       }\r
-\r
-       void DoAnimationPaint(CDCHandle dc, RECT& rect)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if(IsBufferedPaintSupported() && CBufferedAnimation::IsRendering(pT->m_hWnd, dc))\r
-                       return;\r
-\r
-               DWORD dwDurationSave = m_AnimationParams.dwDuration;\r
-               if(pT->AreStatesEqual())\r
-                       m_AnimationParams.dwDuration = 0;\r
-\r
-               HDC hdcFrom = NULL, hdcTo = NULL;\r
-               CBufferedAnimation ba;\r
-               if(IsBufferedPaintSupported())\r
-                       ba.Begin(pT->m_hWnd, dc, &rect, m_dwFormat, &m_PaintParams, &m_AnimationParams, &hdcFrom, &hdcTo);\r
-\r
-               if(!ba.IsNull())\r
-               {\r
-                       if(hdcFrom != NULL)\r
-                               pT->DoPaint(hdcFrom, rect, m_State);\r
-\r
-                       if (hdcTo != NULL)\r
-                               pT->DoPaint(hdcTo, rect, m_NewState);\r
-               }\r
-               else\r
-               {\r
-                       pT->DoPaint(dc.m_hDC, rect, m_NewState);\r
-               }\r
-\r
-               m_AnimationParams.dwDuration = dwDurationSave;\r
-       }\r
-\r
-       void DoPaint(CDCHandle /*dc*/, RECT& /*rect*/, TState /*State*/)\r
-       {\r
-               // must be implemented in a derived class\r
-               ATLASSERT(FALSE);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBufferedAnimationWindowImpl - implements a window that uses buffered animation\r
-\r
-template <class T, class TState = DWORD_PTR, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CBufferedAnimationWindowImpl : \r
-               public ATL::CWindowImpl<T, TBase, TWinTraits>, \r
-               public CBufferedAnimationImpl< T, TState >\r
-{\r
-public:\r
-       CBufferedAnimationWindowImpl(TState InitialState) : CBufferedAnimationImpl< T, TState >(InitialState)\r
-       { }\r
-\r
-       typedef CBufferedAnimationImpl< T, TState >   _baseBufferedAnimation;\r
-       BEGIN_MSG_MAP(CBufferedAnimationWindowImpl)\r
-               CHAIN_MSG_MAP(_baseBufferedAnimation)\r
-       END_MSG_MAP()\r
-};\r
-\r
-#endif // _WTL_NEW_UXTHEME\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLTHEME_H__\r
diff --git a/WTL80/include/atluser.h b/WTL80/include/atluser.h
deleted file mode 100644 (file)
index 6570b8b..0000000
+++ /dev/null
@@ -1,1162 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLUSER_H__\r
-#define __ATLUSER_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atluser.h requires atlapp.h to be included first\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CMenuItemInfo\r
-// CMenuT<t_bManaged>\r
-// CAcceleratorT<t_bManaged>\r
-// CIconT<t_bManaged>\r
-// CCursorT<t_bManaged>\r
-// CResource\r
-//\r
-// Global functions:\r
-//   AtlMessageBox()\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// AtlMessageBox - accepts both memory and resource based strings\r
-\r
-inline int AtlMessageBox(HWND hWndOwner, ATL::_U_STRINGorID message, ATL::_U_STRINGorID title = (LPCTSTR)NULL, UINT uType = MB_OK | MB_ICONINFORMATION)\r
-{\r
-       ATLASSERT(hWndOwner == NULL || ::IsWindow(hWndOwner));\r
-\r
-       LPTSTR lpstrMessage = NULL;\r
-       if(IS_INTRESOURCE(message.m_lpstr))\r
-       {\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       ATLTRY(lpstrMessage = new TCHAR[nLen]);\r
-                       if(lpstrMessage == NULL)\r
-                       {\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-                       int nRes = ::LoadString(ModuleHelper::GetResourceInstance(), LOWORD(message.m_lpstr), lpstrMessage, nLen);\r
-                       if(nRes < nLen - 1)\r
-                               break;\r
-                       delete [] lpstrMessage;\r
-                       lpstrMessage = NULL;\r
-               }\r
-\r
-               message.m_lpstr = lpstrMessage;\r
-       }\r
-\r
-       LPTSTR lpstrTitle = NULL;\r
-       if(IS_INTRESOURCE(title.m_lpstr) && LOWORD(title.m_lpstr) != 0)\r
-       {\r
-               for(int nLen = 256; ; nLen *= 2)\r
-               {\r
-                       ATLTRY(lpstrTitle = new TCHAR[nLen]);\r
-                       if(lpstrTitle == NULL)\r
-                       {\r
-                               ATLASSERT(FALSE);\r
-                               return 0;\r
-                       }\r
-                       int nRes = ::LoadString(ModuleHelper::GetResourceInstance(), LOWORD(title.m_lpstr), lpstrTitle, nLen);\r
-                       if(nRes < nLen - 1)\r
-                               break;\r
-                       delete [] lpstrTitle;\r
-                       lpstrTitle = NULL;\r
-               }\r
-\r
-               title.m_lpstr = lpstrTitle;\r
-       }\r
-\r
-       int nRet = ::MessageBox(hWndOwner, message.m_lpstr, title.m_lpstr, uType);\r
-\r
-       delete [] lpstrMessage;\r
-       delete [] lpstrTitle;\r
-\r
-       return nRet;\r
-}\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CMenu\r
-\r
-#if (WINVER >= 0x0500)\r
-  #ifndef MII_SIZEOF_STRUCT\r
-    #define MII_SIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))\r
-  #endif\r
-  #define MENUITEMINFO_SIZE_VERSION_400A  MII_SIZEOF_STRUCT(MENUITEMINFOA, cch)\r
-  #define MENUITEMINFO_SIZE_VERSION_400W  MII_SIZEOF_STRUCT(MENUITEMINFOW, cch)\r
-  #ifdef UNICODE\r
-    #define MENUITEMINFO_SIZE_VERSION_400  MENUITEMINFO_SIZE_VERSION_400W\r
-  #else\r
-    #define MENUITEMINFO_SIZE_VERSION_400  MENUITEMINFO_SIZE_VERSION_400A\r
-  #endif // !UNICODE\r
-#endif // (WINVER >= 0x0500)\r
-\r
-class CMenuItemInfo : public MENUITEMINFO\r
-{\r
-public:\r
-       CMenuItemInfo()\r
-       {\r
-               memset(this, 0, sizeof(MENUITEMINFO));\r
-               cbSize = sizeof(MENUITEMINFO);\r
-#if (WINVER >= 0x0500)\r
-               // adjust struct size if running on older version of Windows\r
-               if(AtlIsOldWindows())\r
-               {\r
-                       ATLASSERT(cbSize > MENUITEMINFO_SIZE_VERSION_400);   // must be\r
-                       cbSize = MENUITEMINFO_SIZE_VERSION_400;\r
-               }\r
-#endif // (WINVER >= 0x0500)\r
-       }\r
-};\r
-\r
-\r
-// forward declarations\r
-template <bool t_bManaged> class CMenuT;\r
-typedef CMenuT<false>   CMenuHandle;\r
-typedef CMenuT<true>    CMenu;\r
-\r
-\r
-template <bool t_bManaged>\r
-class CMenuT\r
-{\r
-public:\r
-// Data members\r
-       HMENU m_hMenu;\r
-\r
-// Constructor/destructor/operators\r
-       CMenuT(HMENU hMenu = NULL) : m_hMenu(hMenu)\r
-       { }\r
-\r
-       ~CMenuT()\r
-       {\r
-               if(t_bManaged && m_hMenu != NULL)\r
-                       DestroyMenu();\r
-       }\r
-\r
-       CMenuT<t_bManaged>& operator =(HMENU hMenu)\r
-       {\r
-               Attach(hMenu);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HMENU hMenuNew)\r
-       {\r
-               ATLASSERT(::IsMenu(hMenuNew));\r
-               if(t_bManaged && m_hMenu != NULL && m_hMenu != hMenuNew)\r
-                       ::DestroyMenu(m_hMenu);\r
-               m_hMenu = hMenuNew;\r
-       }\r
-\r
-       HMENU Detach()\r
-       {\r
-               HMENU hMenu = m_hMenu;\r
-               m_hMenu = NULL;\r
-               return hMenu;\r
-       }\r
-\r
-       operator HMENU() const { return m_hMenu; }\r
-\r
-       bool IsNull() const { return (m_hMenu == NULL); }\r
-\r
-       BOOL IsMenu() const\r
-       {\r
-               return ::IsMenu(m_hMenu);\r
-       }\r
-\r
-// Create/destroy methods\r
-       BOOL CreateMenu()\r
-       {\r
-               ATLASSERT(m_hMenu == NULL);\r
-               m_hMenu = ::CreateMenu();\r
-               return (m_hMenu != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL CreatePopupMenu()\r
-       {\r
-               ATLASSERT(m_hMenu == NULL);\r
-               m_hMenu = ::CreatePopupMenu();\r
-               return (m_hMenu != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-       BOOL LoadMenu(ATL::_U_STRINGorID menu)\r
-       {\r
-               ATLASSERT(m_hMenu == NULL);\r
-               m_hMenu = ::LoadMenu(ModuleHelper::GetResourceInstance(), menu.m_lpstr);\r
-               return (m_hMenu != NULL) ? TRUE : FALSE;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL LoadMenuIndirect(const void* lpMenuTemplate)\r
-       {\r
-               ATLASSERT(m_hMenu == NULL);\r
-               m_hMenu = ::LoadMenuIndirect(lpMenuTemplate);\r
-               return (m_hMenu != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DestroyMenu()\r
-       {\r
-               if (m_hMenu == NULL)\r
-                       return FALSE;\r
-               BOOL bRet = ::DestroyMenu(m_hMenu);\r
-               if(bRet)\r
-                       m_hMenu = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Menu Operations\r
-       BOOL DeleteMenu(UINT nPosition, UINT nFlags)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::DeleteMenu(m_hMenu, nPosition, nFlags);\r
-       }\r
-\r
-       BOOL TrackPopupMenu(UINT nFlags, int x, int y, HWND hWnd, LPCRECT lpRect = NULL)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-#ifndef _WIN32_WCE\r
-#if (WINVER >= 0x0500)\r
-               x = _FixTrackMenuPopupX(x, y);\r
-#endif // !(WINVER >= 0x0500)\r
-               return ::TrackPopupMenu(m_hMenu, nFlags, x, y, 0, hWnd, lpRect);\r
-#else // CE specific\r
-               lpRect;\r
-               return ::TrackPopupMenuEx(m_hMenu, nFlags, x, y, hWnd, NULL);\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-       BOOL TrackPopupMenuEx(UINT uFlags, int x, int y, HWND hWnd, LPTPMPARAMS lptpm = NULL)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-               x = _FixTrackMenuPopupX(x, y);\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-               return ::TrackPopupMenuEx(m_hMenu, uFlags, x, y, hWnd, lptpm);\r
-       }\r
-\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-       // helper that fixes popup menu X position when it's off-screen\r
-       static int _FixTrackMenuPopupX(int x, int y)\r
-       {\r
-               POINT pt = { x, y };\r
-               HMONITOR hMonitor = ::MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);\r
-               if(hMonitor == NULL)\r
-               {\r
-                       HMONITOR hMonitorNear = ::MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);\r
-                       if(hMonitorNear != NULL)\r
-                       {\r
-                               MONITORINFO mi = { 0 };\r
-                               mi.cbSize = sizeof(MONITORINFO);\r
-                               if(::GetMonitorInfo(hMonitorNear, &mi) != FALSE)\r
-                               {\r
-                                       if(x < mi.rcWork.left)\r
-                                               x = mi.rcWork.left;\r
-                                       else if(x > mi.rcWork.right)\r
-                                               x = mi.rcWork.right;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               return x;\r
-       }\r
-\r
-       BOOL GetMenuInfo(LPMENUINFO lpMenuInfo) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuInfo(m_hMenu, lpMenuInfo);\r
-       }\r
-\r
-       BOOL SetMenuInfo(LPCMENUINFO lpMenuInfo)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::SetMenuInfo(m_hMenu, lpMenuInfo);\r
-       }\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-\r
-// Menu Item Operations\r
-       BOOL AppendMenu(UINT nFlags, UINT_PTR nIDNewItem = 0, LPCTSTR lpszNewItem = NULL)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::AppendMenu(m_hMenu, nFlags, nIDNewItem, lpszNewItem);\r
-       }\r
-\r
-       BOOL AppendMenu(UINT nFlags, HMENU hSubMenu, LPCTSTR lpszNewItem)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(::IsMenu(hSubMenu));\r
-               return ::AppendMenu(m_hMenu, nFlags | MF_POPUP, (UINT_PTR)hSubMenu, lpszNewItem);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL AppendMenu(UINT nFlags, UINT_PTR nIDNewItem, HBITMAP hBmp)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::AppendMenu(m_hMenu, nFlags | MF_BITMAP, nIDNewItem, (LPCTSTR)hBmp);\r
-       }\r
-\r
-       BOOL AppendMenu(UINT nFlags, HMENU hSubMenu, HBITMAP hBmp)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(::IsMenu(hSubMenu));\r
-               return ::AppendMenu(m_hMenu, nFlags | (MF_BITMAP | MF_POPUP), (UINT_PTR)hSubMenu, (LPCTSTR)hBmp);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       UINT CheckMenuItem(UINT nIDCheckItem, UINT nCheck)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return (UINT)::CheckMenuItem(m_hMenu, nIDCheckItem, nCheck);\r
-       }\r
-\r
-       UINT EnableMenuItem(UINT nIDEnableItem, UINT nEnable)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::EnableMenuItem(m_hMenu, nIDEnableItem, nEnable);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL HiliteMenuItem(HWND hWnd, UINT uIDHiliteItem, UINT uHilite)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::HiliteMenuItem(hWnd, m_hMenu, uIDHiliteItem, uHilite);\r
-       }\r
-\r
-       int GetMenuItemCount() const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuItemCount(m_hMenu);\r
-       }\r
-\r
-       UINT GetMenuItemID(int nPos) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuItemID(m_hMenu, nPos);\r
-       }\r
-\r
-       UINT GetMenuState(UINT nID, UINT nFlags) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuState(m_hMenu, nID, nFlags);\r
-       }\r
-\r
-       int GetMenuString(UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuString(m_hMenu, nIDItem, lpString, nMaxCount, nFlags);\r
-       }\r
-\r
-       int GetMenuStringLen(UINT nIDItem, UINT nFlags) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuString(m_hMenu, nIDItem, NULL, 0, nFlags);\r
-       }\r
-\r
-#ifndef _ATL_NO_COM\r
-       BOOL GetMenuString(UINT nIDItem, BSTR& bstrText, UINT nFlags) const\r
-       {\r
-               USES_CONVERSION;\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(bstrText == NULL);\r
-\r
-               int nLen = GetMenuStringLen(nIDItem, nFlags);\r
-               if(nLen == 0)\r
-               {\r
-                       bstrText = ::SysAllocString(OLESTR(""));\r
-                       return (bstrText != NULL) ? TRUE : FALSE;\r
-               }\r
-\r
-               nLen++;   // increment to include terminating NULL char\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR lpszText = buff.Allocate(nLen);\r
-               if(lpszText == NULL)\r
-                       return FALSE;\r
-\r
-               if(!GetMenuString(nIDItem, lpszText, nLen, nFlags))\r
-                       return FALSE;\r
-\r
-               bstrText = ::SysAllocString(T2OLE(lpszText));\r
-               return (bstrText != NULL) ? TRUE : FALSE;\r
-       }\r
-#endif // !_ATL_NO_COM\r
-#endif // !_WIN32_WCE\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       int GetMenuString(UINT nIDItem, _CSTRING_NS::CString& strText, UINT nFlags) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-\r
-               int nLen = GetMenuStringLen(nIDItem, nFlags);\r
-               if(nLen == 0)\r
-                       return 0;\r
-\r
-               nLen++;   // increment to include terminating NULL char\r
-               LPTSTR lpstr = strText.GetBufferSetLength(nLen);\r
-               if(lpstr == NULL)\r
-                       return 0;\r
-               int nRet = GetMenuString(nIDItem, lpstr, nLen, nFlags);\r
-               strText.ReleaseBuffer();\r
-               return nRet;\r
-       }\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-\r
-       CMenuHandle GetSubMenu(int nPos) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return CMenuHandle(::GetSubMenu(m_hMenu, nPos));\r
-       }\r
-\r
-       BOOL InsertMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem = 0, LPCTSTR lpszNewItem = NULL)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::InsertMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpszNewItem);\r
-       }\r
-\r
-       BOOL InsertMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, LPCTSTR lpszNewItem)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(::IsMenu(hSubMenu));\r
-               return ::InsertMenu(m_hMenu, nPosition, nFlags | MF_POPUP, (UINT_PTR)hSubMenu, lpszNewItem);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL InsertMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem, HBITMAP hBmp)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::InsertMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, (LPCTSTR)hBmp);\r
-       }\r
-\r
-       BOOL InsertMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, HBITMAP hBmp)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(::IsMenu(hSubMenu));\r
-               return ::InsertMenu(m_hMenu, nPosition, nFlags | (MF_BITMAP | MF_POPUP), (UINT_PTR)hSubMenu, (LPCTSTR)hBmp);\r
-       }\r
-\r
-       BOOL ModifyMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem = 0, LPCTSTR lpszNewItem = NULL)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::ModifyMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpszNewItem);\r
-       }\r
-\r
-       BOOL ModifyMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, LPCTSTR lpszNewItem)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(::IsMenu(hSubMenu));\r
-               return ::ModifyMenu(m_hMenu, nPosition, nFlags | MF_POPUP, (UINT_PTR)hSubMenu, lpszNewItem);\r
-       }\r
-\r
-       BOOL ModifyMenu(UINT nPosition, UINT nFlags, UINT_PTR nIDNewItem, HBITMAP hBmp)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::ModifyMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, (LPCTSTR)hBmp);\r
-       }\r
-\r
-       BOOL ModifyMenu(UINT nPosition, UINT nFlags, HMENU hSubMenu, HBITMAP hBmp)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               ATLASSERT(::IsMenu(hSubMenu));\r
-               return ::ModifyMenu(m_hMenu, nPosition, nFlags | (MF_BITMAP | MF_POPUP), (UINT_PTR)hSubMenu, (LPCTSTR)hBmp);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL RemoveMenu(UINT nPosition, UINT nFlags)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::RemoveMenu(m_hMenu, nPosition, nFlags);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL SetMenuItemBitmaps(UINT nPosition, UINT nFlags, HBITMAP hBmpUnchecked, HBITMAP hBmpChecked)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::SetMenuItemBitmaps(m_hMenu, nPosition, nFlags, hBmpUnchecked, hBmpChecked);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL CheckMenuRadioItem(UINT nIDFirst, UINT nIDLast, UINT nIDItem, UINT nFlags)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::CheckMenuRadioItem(m_hMenu, nIDFirst, nIDLast, nIDItem, nFlags);\r
-       }\r
-\r
-       BOOL GetMenuItemInfo(UINT uItem, BOOL bByPosition, LPMENUITEMINFO lpmii) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return (BOOL)::GetMenuItemInfo(m_hMenu, uItem, bByPosition, lpmii);\r
-       }\r
-\r
-       BOOL SetMenuItemInfo(UINT uItem, BOOL bByPosition, LPMENUITEMINFO lpmii)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return (BOOL)::SetMenuItemInfo(m_hMenu, uItem, bByPosition, lpmii);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL InsertMenuItem(UINT uItem, BOOL bByPosition, LPMENUITEMINFO lpmii)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return (BOOL)::InsertMenuItem(m_hMenu, uItem, bByPosition, lpmii);\r
-       }\r
-\r
-       UINT GetMenuDefaultItem(BOOL bByPosition = FALSE, UINT uFlags = 0U) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuDefaultItem(m_hMenu, (UINT)bByPosition, uFlags);\r
-       }\r
-\r
-       BOOL SetMenuDefaultItem(UINT uItem = (UINT)-1,  BOOL bByPosition = FALSE)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::SetMenuDefaultItem(m_hMenu, uItem, (UINT)bByPosition);\r
-       }\r
-\r
-       BOOL GetMenuItemRect(HWND hWnd, UINT uItem, LPRECT lprcItem) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuItemRect(hWnd, m_hMenu, uItem, lprcItem);\r
-       }\r
-\r
-       int MenuItemFromPoint(HWND hWnd, POINT point) const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::MenuItemFromPoint(hWnd, m_hMenu, point);\r
-       }\r
-\r
-// Context Help Functions\r
-       BOOL SetMenuContextHelpId(DWORD dwContextHelpId)\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::SetMenuContextHelpId(m_hMenu, dwContextHelpId);\r
-       }\r
-\r
-       DWORD GetMenuContextHelpId() const\r
-       {\r
-               ATLASSERT(::IsMenu(m_hMenu));\r
-               return ::GetMenuContextHelpId(m_hMenu);\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAccelerator\r
-\r
-template <bool t_bManaged>\r
-class CAcceleratorT\r
-{\r
-public:\r
-       HACCEL m_hAccel;\r
-\r
-// Constructor/destructor/operators\r
-       CAcceleratorT(HACCEL hAccel = NULL) : m_hAccel(hAccel)\r
-       { }\r
-\r
-       ~CAcceleratorT()\r
-       {\r
-               if(t_bManaged && m_hAccel != NULL)\r
-                       ::DestroyAcceleratorTable(m_hAccel);\r
-       }\r
-\r
-       CAcceleratorT<t_bManaged>& operator =(HACCEL hAccel)\r
-       {\r
-               Attach(hAccel);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HACCEL hAccel)\r
-       {\r
-               if(t_bManaged && m_hAccel != NULL)\r
-                       ::DestroyAcceleratorTable(m_hAccel);\r
-               m_hAccel = hAccel;\r
-       }\r
-\r
-       HACCEL Detach()\r
-       {\r
-               HACCEL hAccel = m_hAccel;\r
-               m_hAccel = NULL;\r
-               return hAccel;\r
-       }\r
-\r
-       operator HACCEL() const { return m_hAccel; }\r
-\r
-       bool IsNull() const { return m_hAccel == NULL; }\r
-\r
-// Create/destroy methods\r
-       HACCEL LoadAccelerators(ATL::_U_STRINGorID accel)\r
-       {\r
-               ATLASSERT(m_hAccel == NULL);\r
-               m_hAccel = ::LoadAccelerators(ModuleHelper::GetResourceInstance(), accel.m_lpstr);\r
-               return m_hAccel;\r
-       }\r
-\r
-       HACCEL CreateAcceleratorTable(LPACCEL pAccel, int cEntries)\r
-       {\r
-               ATLASSERT(m_hAccel == NULL);\r
-               ATLASSERT(pAccel != NULL);\r
-               m_hAccel = ::CreateAcceleratorTable(pAccel, cEntries);\r
-               return m_hAccel;\r
-       }\r
-\r
-       void DestroyObject()\r
-       {\r
-               if(m_hAccel != NULL)\r
-               {\r
-                       ::DestroyAcceleratorTable(m_hAccel);\r
-                       m_hAccel = NULL;\r
-               }\r
-       }\r
-\r
-// Operations\r
-#ifndef _WIN32_WCE\r
-       int CopyAcceleratorTable(LPACCEL lpAccelDst, int cEntries)\r
-       {\r
-               ATLASSERT(m_hAccel != NULL);\r
-               ATLASSERT(lpAccelDst != NULL);\r
-               return ::CopyAcceleratorTable(m_hAccel, lpAccelDst, cEntries);\r
-       }\r
-\r
-       int GetEntriesCount() const\r
-       {\r
-               ATLASSERT(m_hAccel != NULL);\r
-               return ::CopyAcceleratorTable(m_hAccel, NULL, 0);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL TranslateAccelerator(HWND hWnd, LPMSG pMsg)\r
-       {\r
-               ATLASSERT(m_hAccel != NULL);\r
-               ATLASSERT(::IsWindow(hWnd));\r
-               ATLASSERT(pMsg != NULL);\r
-               return ::TranslateAccelerator(hWnd, m_hAccel, pMsg);\r
-       }\r
-};\r
-\r
-typedef CAcceleratorT<false>   CAcceleratorHandle;\r
-typedef CAcceleratorT<true>    CAccelerator;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CIcon\r
-\r
-template <bool t_bManaged>\r
-class CIconT\r
-{\r
-public:\r
-       HICON m_hIcon;\r
-\r
-// Constructor/destructor/operators\r
-       CIconT(HICON hIcon = NULL) : m_hIcon(hIcon)\r
-       { }\r
-\r
-       ~CIconT()\r
-       {\r
-               if(t_bManaged && m_hIcon != NULL)\r
-                       ::DestroyIcon(m_hIcon);\r
-       }\r
-\r
-       CIconT<t_bManaged>& operator =(HICON hIcon)\r
-       {\r
-               Attach(hIcon);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HICON hIcon)\r
-       {\r
-               if(t_bManaged && m_hIcon != NULL)\r
-                       ::DestroyIcon(m_hIcon);\r
-               m_hIcon = hIcon;\r
-       }\r
-\r
-       HICON Detach()\r
-       {\r
-               HICON hIcon = m_hIcon;\r
-               m_hIcon = NULL;\r
-               return hIcon;\r
-       }\r
-\r
-       operator HICON() const { return m_hIcon; }\r
-\r
-       bool IsNull() const { return m_hIcon == NULL; }\r
-\r
-// Create/destroy methods\r
-       HICON LoadIcon(ATL::_U_STRINGorID icon)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               m_hIcon = ::LoadIcon(ModuleHelper::GetResourceInstance(), icon.m_lpstr);\r
-               return m_hIcon;\r
-       }\r
-\r
-       HICON LoadIcon(ATL::_U_STRINGorID icon, int cxDesired, int cyDesired, UINT fuLoad = 0)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               m_hIcon = (HICON) ::LoadImage(ModuleHelper::GetResourceInstance(), icon.m_lpstr, IMAGE_ICON, cxDesired, cyDesired, fuLoad);\r
-               return m_hIcon;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HICON LoadOEMIcon(LPCTSTR lpstrIconName)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(IsOEMIcon(lpstrIconName));\r
-               m_hIcon = ::LoadIcon(NULL, lpstrIconName);\r
-               return m_hIcon;\r
-       }\r
-\r
-       HICON CreateIcon(int nWidth, int nHeight, BYTE cPlanes, BYTE cBitsPixel, CONST BYTE* lpbANDbits, CONST BYTE *lpbXORbits)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(lpbANDbits != NULL);\r
-               ATLASSERT(lpbXORbits != NULL);\r
-               m_hIcon = ::CreateIcon(ModuleHelper::GetResourceInstance(), nWidth, nHeight, cPlanes, cBitsPixel, lpbANDbits, lpbXORbits);\r
-               return m_hIcon;\r
-       }\r
-\r
-       HICON CreateIconFromResource(PBYTE pBits, DWORD dwResSize, DWORD dwVersion = 0x00030000)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(pBits != NULL);\r
-               m_hIcon = ::CreateIconFromResource(pBits, dwResSize, TRUE, dwVersion);\r
-               return m_hIcon;\r
-       }\r
-\r
-       HICON CreateIconFromResourceEx(PBYTE pbBits, DWORD cbBits, DWORD dwVersion = 0x00030000, int cxDesired = 0, int cyDesired = 0, UINT uFlags = LR_DEFAULTCOLOR)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(pbBits != NULL);\r
-               ATLASSERT(cbBits > 0);\r
-               m_hIcon = ::CreateIconFromResourceEx(pbBits, cbBits, TRUE, dwVersion, cxDesired, cyDesired, uFlags);\r
-               return m_hIcon;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       HICON CreateIconIndirect(PICONINFO pIconInfo)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(pIconInfo != NULL);\r
-               m_hIcon = ::CreateIconIndirect(pIconInfo);\r
-               return m_hIcon;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HICON ExtractIcon(LPCTSTR lpszExeFileName, UINT nIconIndex)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(lpszExeFileName != NULL);\r
-               m_hIcon = ::ExtractIcon(ModuleHelper::GetModuleInstance(), lpszExeFileName, nIconIndex);\r
-               return m_hIcon;\r
-       }\r
-\r
-       HICON ExtractAssociatedIcon(HINSTANCE hInst, LPTSTR lpIconPath, LPWORD lpiIcon)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(lpIconPath != NULL);\r
-               ATLASSERT(lpiIcon != NULL);\r
-               m_hIcon = ::ExtractAssociatedIcon(hInst, lpIconPath, lpiIcon);\r
-               return m_hIcon;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DestroyIcon()\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               BOOL bRet = ::DestroyIcon(m_hIcon);\r
-               if(bRet != FALSE)\r
-                       m_hIcon = NULL;\r
-               return bRet;\r
-       }\r
-\r
-// Operations\r
-#ifndef _WIN32_WCE\r
-       HICON CopyIcon()\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               return ::CopyIcon(m_hIcon);\r
-       }\r
-\r
-       HICON DuplicateIcon()\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               return ::DuplicateIcon(NULL, m_hIcon);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DrawIcon(HDC hDC, int x, int y)\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-#ifndef _WIN32_WCE\r
-               return ::DrawIcon(hDC, x, y, m_hIcon);\r
-#else // CE specific\r
-               return ::DrawIconEx(hDC, x, y, m_hIcon, 0, 0, 0, NULL, DI_NORMAL);\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-       BOOL DrawIcon(HDC hDC, POINT pt)\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-#ifndef _WIN32_WCE\r
-               return ::DrawIcon(hDC, pt.x, pt.y, m_hIcon);\r
-#else // CE specific\r
-               return ::DrawIconEx(hDC, pt.x, pt.y, m_hIcon, 0, 0, 0, NULL, DI_NORMAL);\r
-#endif // _WIN32_WCE\r
-       }\r
-\r
-       BOOL DrawIconEx(HDC hDC, int x, int y, int cxWidth, int cyWidth, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               return ::DrawIconEx(hDC, x, y, m_hIcon, cxWidth, cyWidth, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\r
-       }\r
-\r
-       BOOL DrawIconEx(HDC hDC, POINT pt, SIZE size, UINT uStepIfAniCur = 0, HBRUSH hbrFlickerFreeDraw = NULL, UINT uFlags = DI_NORMAL)\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               return ::DrawIconEx(hDC, pt.x, pt.y, m_hIcon, size.cx, size.cy, uStepIfAniCur, hbrFlickerFreeDraw, uFlags);\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       BOOL GetIconInfo(PICONINFO pIconInfo) const\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               ATLASSERT(pIconInfo != NULL);\r
-               return ::GetIconInfo(m_hIcon, pIconInfo);\r
-       }\r
-\r
-#if (_WIN32_WINNT >= 0x0600)\r
-       BOOL GetIconInfoEx(PICONINFOEX pIconInfo) const\r
-       {\r
-               ATLASSERT(m_hIcon != NULL);\r
-               ATLASSERT(pIconInfo != NULL);\r
-               return ::GetIconInfoEx(m_hIcon, pIconInfo);\r
-       }\r
-#endif // (_WIN32_WINNT >= 0x0600)\r
-\r
-#if defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-       HRESULT LoadIconMetric(ATL::_U_STRINGorID icon, int lims)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               USES_CONVERSION;\r
-               return ::LoadIconMetric(ModuleHelper::GetResourceInstance(), T2CW(icon.m_lpstr), lims, &m_hIcon);\r
-       }\r
-\r
-       HRESULT LoadIconWithScaleDown(ATL::_U_STRINGorID icon, int cx, int cy)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               USES_CONVERSION;\r
-               return ::LoadIconWithScaleDown(ModuleHelper::GetResourceInstance(), T2CW(icon.m_lpstr), cx, cy, &m_hIcon);\r
-       }\r
-\r
-       HRESULT LoadOEMIconMetric(LPCTSTR lpstrIconName, int lims)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(IsOEMIcon(lpstrIconName));\r
-               return ::LoadIconMetric(NULL, (LPCWSTR)lpstrIconName, lims, &m_hIcon);\r
-       }\r
-\r
-       HRESULT LoadOEMIconWithScaleDown(LPCTSTR lpstrIconName, int cx, int cy)\r
-       {\r
-               ATLASSERT(m_hIcon == NULL);\r
-               ATLASSERT(IsOEMIcon(lpstrIconName));\r
-               USES_CONVERSION;\r
-               return ::LoadIconWithScaleDown(NULL, (LPCWSTR)lpstrIconName, cx, cy, &m_hIcon);\r
-       }\r
-#endif // defined(NTDDI_VERSION) && (NTDDI_VERSION >= NTDDI_LONGHORN)\r
-#endif // !_WIN32_WCE\r
-\r
-       // Helper\r
-#ifndef _WIN32_WCE\r
-       static bool IsOEMIcon(LPCTSTR lpstrIconName)\r
-       {\r
-#if (WINVER >= 0x0600)\r
-               return (lpstrIconName == IDI_APPLICATION || lpstrIconName == IDI_ASTERISK || lpstrIconName == IDI_EXCLAMATION ||\r
-                         lpstrIconName == IDI_HAND || lpstrIconName == IDI_QUESTION || lpstrIconName == IDI_WINLOGO ||\r
-                         lpstrIconName == IDI_SHIELD);\r
-#else // !(WINVER >= 0x0600)\r
-               return (lpstrIconName == IDI_APPLICATION || lpstrIconName == IDI_ASTERISK || lpstrIconName == IDI_EXCLAMATION ||\r
-                         lpstrIconName == IDI_HAND || lpstrIconName == IDI_QUESTION || lpstrIconName == IDI_WINLOGO);\r
-#endif // !(WINVER >= 0x0600)\r
-       }\r
-#endif // !_WIN32_WCE\r
-};\r
-\r
-typedef CIconT<false>   CIconHandle;\r
-typedef CIconT<true>    CIcon;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCursor\r
-\r
-// protect template member from a winuser.h macro\r
-#ifdef CopyCursor\r
-  #undef CopyCursor\r
-#endif\r
-\r
-template <bool t_bManaged>\r
-class CCursorT\r
-{\r
-public:\r
-       HCURSOR m_hCursor;\r
-\r
-// Constructor/destructor/operators\r
-       CCursorT(HCURSOR hCursor = NULL) : m_hCursor(hCursor)\r
-       { }\r
-\r
-       ~CCursorT()\r
-       {\r
-               if(t_bManaged && m_hCursor != NULL)\r
-                       DestroyCursor();\r
-       }\r
-\r
-       CCursorT<t_bManaged>& operator =(HCURSOR hCursor)\r
-       {\r
-               Attach(hCursor);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HCURSOR hCursor)\r
-       {\r
-               if(t_bManaged && m_hCursor != NULL)\r
-                       DestroyCursor();\r
-               m_hCursor = hCursor;\r
-       }\r
-\r
-       HCURSOR Detach()\r
-       {\r
-               HCURSOR hCursor = m_hCursor;\r
-               m_hCursor = NULL;\r
-               return hCursor;\r
-       }\r
-\r
-       operator HCURSOR() const { return m_hCursor; }\r
-\r
-       bool IsNull() const { return m_hCursor == NULL; }\r
-\r
-// Create/destroy methods\r
-       HCURSOR LoadCursor(ATL::_U_STRINGorID cursor)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-               m_hCursor = ::LoadCursor(ModuleHelper::GetResourceInstance(), cursor.m_lpstr);\r
-               return m_hCursor;\r
-       }\r
-\r
-       HCURSOR LoadSysCursor(LPCTSTR lpstrCursorName)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-#if (WINVER >= 0x0500)\r
-               ATLASSERT(lpstrCursorName == IDC_ARROW || lpstrCursorName == IDC_IBEAM || lpstrCursorName == IDC_WAIT ||\r
-                       lpstrCursorName == IDC_CROSS || lpstrCursorName == IDC_UPARROW || lpstrCursorName == IDC_SIZE ||\r
-                       lpstrCursorName == IDC_ICON || lpstrCursorName == IDC_SIZENWSE || lpstrCursorName == IDC_SIZENESW ||\r
-                       lpstrCursorName == IDC_SIZEWE || lpstrCursorName == IDC_SIZENS || lpstrCursorName == IDC_SIZEALL ||\r
-                       lpstrCursorName == IDC_NO || lpstrCursorName == IDC_APPSTARTING || lpstrCursorName == IDC_HELP ||\r
-                       lpstrCursorName == IDC_HAND);\r
-#else // !(WINVER >= 0x0500)\r
-               ATLASSERT(lpstrCursorName == IDC_ARROW || lpstrCursorName == IDC_IBEAM || lpstrCursorName == IDC_WAIT ||\r
-                       lpstrCursorName == IDC_CROSS || lpstrCursorName == IDC_UPARROW || lpstrCursorName == IDC_SIZE ||\r
-                       lpstrCursorName == IDC_ICON || lpstrCursorName == IDC_SIZENWSE || lpstrCursorName == IDC_SIZENESW ||\r
-                       lpstrCursorName == IDC_SIZEWE || lpstrCursorName == IDC_SIZENS || lpstrCursorName == IDC_SIZEALL ||\r
-                       lpstrCursorName == IDC_NO || lpstrCursorName == IDC_APPSTARTING || lpstrCursorName == IDC_HELP);\r
-#endif // !(WINVER >= 0x0500)\r
-               m_hCursor = ::LoadCursor(NULL, lpstrCursorName);\r
-               return m_hCursor;\r
-       }\r
-\r
-       // deprecated\r
-       HCURSOR LoadOEMCursor(LPCTSTR lpstrCursorName)\r
-       {\r
-               return LoadSysCursor(lpstrCursorName);\r
-       }\r
-\r
-       HCURSOR LoadCursor(ATL::_U_STRINGorID cursor, int cxDesired, int cyDesired, UINT fuLoad = 0)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-               m_hCursor = (HCURSOR) ::LoadImage(ModuleHelper::GetResourceInstance(), cursor.m_lpstr, IMAGE_CURSOR, cxDesired, cyDesired, fuLoad);\r
-               return m_hCursor;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       HCURSOR LoadCursorFromFile(LPCTSTR pstrFilename)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-               ATLASSERT(pstrFilename != NULL);\r
-               m_hCursor = ::LoadCursorFromFile(pstrFilename);\r
-               return m_hCursor;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))\r
-       HCURSOR CreateCursor(int xHotSpot, int yHotSpot, int nWidth, int nHeight, CONST VOID *pvANDPlane, CONST VOID *pvXORPlane)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-               m_hCursor = ::CreateCursor(ModuleHelper::GetResourceInstance(), xHotSpot, yHotSpot, nWidth, nHeight, pvANDPlane, pvXORPlane);\r
-               return m_hCursor;\r
-       }\r
-#endif // !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))\r
-\r
-#ifndef _WIN32_WCE\r
-       HCURSOR CreateCursorFromResource(PBYTE pBits, DWORD dwResSize, DWORD dwVersion = 0x00030000)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-               ATLASSERT(pBits != NULL);\r
-               m_hCursor = (HCURSOR)::CreateIconFromResource(pBits, dwResSize, FALSE, dwVersion);\r
-               return m_hCursor;\r
-       }\r
-\r
-       HCURSOR CreateCursorFromResourceEx(PBYTE pbBits, DWORD cbBits, DWORD dwVersion = 0x00030000, int cxDesired = 0, int cyDesired = 0, UINT uFlags = LR_DEFAULTCOLOR)\r
-       {\r
-               ATLASSERT(m_hCursor == NULL);\r
-               ATLASSERT(pbBits != NULL);\r
-               ATLASSERT(cbBits > 0);\r
-               m_hCursor = (HCURSOR)::CreateIconFromResourceEx(pbBits, cbBits, FALSE, dwVersion, cxDesired, cyDesired, uFlags);\r
-               return m_hCursor;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-       BOOL DestroyCursor()\r
-       {\r
-               ATLASSERT(m_hCursor != NULL);\r
-#if !defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)))\r
-               BOOL bRet = ::DestroyCursor(m_hCursor);\r
-               if(bRet != FALSE)\r
-                       m_hCursor = NULL;\r
-               return bRet;\r
-#else // !(!defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP))))\r
-               ATLTRACE2(atlTraceUI, 0, _T("Warning: This version of Windows CE does not have ::DestroyCursor()\n"));\r
-               return FALSE;\r
-#endif // !(!defined(_WIN32_WCE) || ((_WIN32_WCE >= 0x400) && !(defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP))))\r
-       }\r
-\r
-// Operations\r
-#ifndef _WIN32_WCE\r
-       HCURSOR CopyCursor()\r
-       {\r
-               ATLASSERT(m_hCursor != NULL);\r
-               return (HCURSOR)::CopyIcon((HICON)m_hCursor);\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-#if (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-       BOOL GetCursorInfo(LPCURSORINFO pCursorInfo)\r
-       {\r
-               ATLASSERT(m_hCursor != NULL);\r
-               ATLASSERT(pCursorInfo != NULL);\r
-               return ::GetCursorInfo(pCursorInfo);\r
-       }\r
-#endif // (WINVER >= 0x0500) && !defined(_WIN32_WCE)\r
-};\r
-\r
-typedef CCursorT<false>   CCursorHandle;\r
-typedef CCursorT<true>    CCursor;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CResource - Wraps a generic Windows resource.\r
-//             Use it with custom resource types other than the\r
-//             standard RT_CURSOR, RT_BITMAP, etc.\r
-\r
-class CResource\r
-{\r
-public:\r
-       HGLOBAL m_hGlobal;\r
-       HRSRC m_hResource;\r
-\r
-// Constructor/destructor\r
-       CResource() : m_hGlobal(NULL), m_hResource(NULL)\r
-       { }\r
-\r
-       ~CResource()\r
-       {\r
-               Release();\r
-       }\r
-\r
-// Load methods\r
-       bool Load(ATL::_U_STRINGorID Type, ATL::_U_STRINGorID ID)\r
-       {\r
-               ATLASSERT(m_hResource == NULL);\r
-               ATLASSERT(m_hGlobal == NULL);\r
-\r
-               m_hResource = ::FindResource(ModuleHelper::GetResourceInstance(), ID.m_lpstr, Type.m_lpstr);\r
-               if(m_hResource == NULL)\r
-                       return false;\r
-\r
-               m_hGlobal = ::LoadResource(ModuleHelper::GetResourceInstance(), m_hResource);\r
-               if(m_hGlobal == NULL)\r
-               {\r
-                       m_hResource = NULL;\r
-                       return false;\r
-               }\r
-\r
-               return true;\r
-       }\r
-\r
-#ifndef _WIN32_WCE\r
-       bool LoadEx(ATL::_U_STRINGorID Type, ATL::_U_STRINGorID ID, WORD wLanguage)\r
-       {\r
-               ATLASSERT(m_hResource == NULL);\r
-               ATLASSERT(m_hGlobal == NULL);\r
-\r
-               m_hResource = ::FindResourceEx(ModuleHelper::GetResourceInstance(), ID.m_lpstr, Type.m_lpstr, wLanguage);\r
-               if(m_hResource == NULL)\r
-                       return false;\r
-\r
-               m_hGlobal = ::LoadResource(ModuleHelper::GetResourceInstance(), m_hResource);\r
-               if(m_hGlobal == NULL)\r
-               {\r
-                       m_hResource = NULL;\r
-                       return false;\r
-               }\r
-\r
-               return true;\r
-       }\r
-#endif // !_WIN32_WCE\r
-\r
-// Misc. operations\r
-       DWORD GetSize() const\r
-       {\r
-               ATLASSERT(m_hResource != NULL);\r
-               return ::SizeofResource(ModuleHelper::GetResourceInstance(), m_hResource);\r
-       }\r
-\r
-       LPVOID Lock()\r
-       {\r
-               ATLASSERT(m_hResource != NULL);\r
-               ATLASSERT(m_hGlobal != NULL);\r
-               LPVOID pVoid = ::LockResource(m_hGlobal);\r
-               ATLASSERT(pVoid != NULL);\r
-               return pVoid;\r
-       }\r
-\r
-       void Release()\r
-       {\r
-               if(m_hGlobal != NULL)\r
-               {\r
-                       FreeResource(m_hGlobal);\r
-                       m_hGlobal = NULL;\r
-                       m_hResource = NULL;\r
-               }\r
-       }\r
-};\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLUSER_H__\r
diff --git a/WTL80/include/atlwince.h b/WTL80/include/atlwince.h
deleted file mode 100644 (file)
index 5502d2e..0000000
+++ /dev/null
@@ -1,3010 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLWINCE_H__\r
-#define __ATLWINCE_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlwince.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#ifndef __ATLWIN_H__\r
-       #error atlwince.h requires atlwin.h to be included first\r
-#endif\r
-\r
-#ifndef _WIN32_WCE\r
-       #error atlwince.h compiles under Windows CE only\r
-#elif (_WIN32_WCE < 300)\r
-       #error atlwince.h requires Windows CE 3.0 or higher.\r
-#endif\r
-\r
-#if defined(WIN32_PLATFORM_WFSP) &&  _MSC_VER < 1400 // EVC compiling SmartPhone code\r
-  #if (WIN32_PLATFORM_WFSP < 200)\r
-       #error atlwince.h requires Smartphone 2003 or higher\r
-  #endif\r
-#endif // WIN32_PLATFORM_WFSP\r
-\r
-#if defined(WIN32_PLATFORM_PSPC) &&  _MSC_VER < 1400 // EVC compiling Pocket PC code\r
-  #if (WIN32_PLATFORM_PSPC < 310)\r
-       #error atlwince.h requires Pocket PC 2002 or higher\r
-  #endif\r
-#endif // WIN32_PLATFORM_PSPC\r
-\r
-#if !defined(_AYGSHELL_H_) && !defined(__AYGSHELL_H__)\r
-       #error atlwince.h requires aygshell.h to be included first\r
-#else\r
-  #if defined(WIN32_PLATFORM_WFSP) && !defined(_TPCSHELL_H_)\r
-       #error SmartPhone dialog classes require tpcshell.h to be included first\r
-  #endif\r
-#endif\r
-\r
-#if (_MSC_VER >= 1400) // VS2005\r
-  #include <DeviceResolutionAware.h>\r
-  #define _WTL_CE_DRA\r
-#endif // (_MSC_VER >= 1400)\r
-\r
-#if !defined(_WTL_CE_NO_DIALOGS) &&  !defined(__ATLFRAME_H__)\r
-       #error Orientation aware dialog classes require atlframe.h to be included first\r
-#endif\r
-\r
-#if !defined(_WTL_CE_NO_APPWINDOW) &&  !defined(__ATLFRAME_H__)\r
-       #error Application window class require atlframe.h to be included first\r
-#endif\r
-\r
-#if !defined(_WTL_CE_NO_ZOOMSCROLL) &&  !defined(__ATLSCRL_H__)\r
-       #error ZoomScroll implementation requires atlscrl.h to be included first\r
-#endif\r
-\r
-#if !defined(_WTL_CE_NO_ZOOMSCROLL)\r
-  #if !(defined(__ATLTYPES_H__) || (defined(__ATLMISC_H__) && !defined(_WTL_NO_WTYPES)))\r
-       #error ZoomScroll requires _WTL_NO_WTYPES not to be defined and either atlmisc.h or atltypes.h to be included first\r
-  #endif // !(defined(__ATLTYPES_H__) || (defined(__ATLMISC_H__) && !defined(_WTL_NO_WTYPES)))\r
-#endif // !defined(_WTL_CE_NO_ZOOMSCROLL)\r
-\r
-#if !defined(WIN32_PLATFORM_WFSP) && !defined(WIN32_PLATFORM_PSPC)\r
-  #define _WTL_CE_NO_CONTROLS\r
-#endif // !defined(WIN32_PLATFORM_WFSP) && !defined(WIN32_PLATFORM_PSPC)\r
-\r
-#ifndef _WTL_CE_NO_CONTROLS\r
-  #ifndef __ATLCTRLS_H__\r
-       #error The PPC/SmartPhone controls classes require atlctrls.h to be included first\r
-  #endif\r
-\r
-  #include <htmlctrl.h>\r
-  #pragma comment(lib, "htmlview.lib")\r
-\r
-  #include <voicectl.h>\r
-  #pragma comment(lib, "voicectl.lib")\r
-\r
-  #ifdef WIN32_PLATFORM_PSPC\r
-    #include <richink.h>\r
-    #pragma comment(lib, "richink.lib")\r
-\r
-    #include <inkx.h>\r
-    #pragma comment(lib, "inkx.lib")\r
-\r
-    #include <doclist.h>\r
-    #pragma comment(lib, "doclist.lib")\r
-  #endif\r
-#endif\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// CStdDialogBase<T, t_shidiFlags, t_bModal> : Standard PPC/SmartPhone dialog base class\r
-// CStdDialogImplBase - Base implementation of standard dialog\r
-// CStdDialogImpl<T, t_shidiFlags, t_bModal> : Standard dialog implementation\r
-// CStdIndirectDialogImpl - implementation of standard indirect PPC/SmartPhone dialog\r
-// CStdAxDialogImpl<T, t_shidiFlags, t_bModal> : Standard AxDialog implementation\r
-// CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags> : Standard simple dialog\r
-// CStdDialogResizeImplBase - Base implementation of orientation resizing standard dialog\r
-// CStdDialogResizeImpl<T, t_shidiFlags, t_bModal> : Orientation resizing standard dialog implementation\r
-// CStdAxDialogResizeImpl - implementation of orientation resizing standard AxDialog\r
-// CStdSimpleDialogResizeImpl<T, t_wDlgTemplateID, t_shidiFlags> : Standard resizing simple dialog implementation\r
-// CStdOrientedDialogBase - Oriented PPC standard dialog base class\r
-// CStdOrientedDialogImplBase - Oriented PPC standard dialog base implementation\r
-// CStdOrientedDialogImpl<T, t_shidiFlags, t_bModal> : Oriented PPC standard dialog implementation\r
-// CStdAxOrientedDialogImpl - Oriented PPC standard AxDialog implementation\r
-// CStdSimpleOrientedDialog<t_wDlgTemplateID, t_wDlgLandscapeID, t_shidiFlags> : Standard simple orientable dialog\r
-//\r
-// CAppInfoBase         : Helper for application state save/restore to registry\r
-// CAppInfoT<T> : CAppInfoBase constructed from a CAppWindow<T>\r
-// CAppWindowBase<T> : Base class for PPC/SmartPhone well-behaved application window or dialog\r
-// CAppWindow<T> : PPC/SmartPhone well-behaved application window class\r
-// CAppDialog<T> : PPC/SmartPhone well-behaved application dialog class\r
-// CAppStdDialogImplBase - Base implementation of standard application dialogs\r
-// CAppStdDialogImpl<T, t_shidiFlags, t_bModal> : Implementation of standard application dialog\r
-// CAppStdDialogResizeImpl - implementation of orientation resizing standard application dialog\r
-// CAppStdAxDialogImpl - Implementation of standard application AxDialog \r
-// CAppStdAxDialogResizeImpl - implementation of orientation resizing standard application AxDialog\r
-// CAppStdOrientedDialogImpl - implementation of oriented PPC standard application dialog\r
-// CAppStdAxOrientedDialogImpl - implementation of oriented PPC standard application AxDialog\r
-//\r
-// CFullScreenFrame<T, t_bHasSip> : Full screen frame class\r
-//\r
-// CZoomScrollImpl<T> : WinCE zooming implementation\r
-//\r
-// CBottomTabViewImpl<T, TBase, TWinTraits> - CBottomTabView \r
-// CHtmlCtrlT<TBase> - CHtmlCtrl\r
-// CRichInkCtrlT<TBase> - CRichInkCtrl\r
-// CInkXCtrlT<TBase> - CInkXCtrl\r
-// CVoiceRecorderCtrlT<TBase> - CVoiceRecorderCtrl\r
-// CDocListCtrlT<TBase> - CDocListCtrl\r
-// CCapEditT<TBase> - CCapEdit\r
-// CTTStaticT<TBase> - CTTStatic\r
-// CTTButtonT<TBase> - CTTButton\r
-//\r
-// CSpinCtrlT<TBase> - CSpinCtrl : SmartPhone specific UpDown control\r
-// CSpinned<TBase, t_bExpandOnly> : SmartPhone association of control and Spin\r
-// CSpinListBox : SmartPhone spinned ListBox control\r
-// CExpandListBox : SmartPhone expandable ListBox control\r
-// CExpandEdit : SmartPhone expandable Edit control\r
-// CExpandCapEdit : SmartPhone expandable CapEdit control\r
-//\r
-// Global functions:\r
-//   AtlCreateMenuBar()\r
-//   AtlCreateEmptyMenuBar()\r
-//   AtlIsEditFocus()\r
-//   AtlActivateBackKey()\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// MenuBar creation functions for property sheets and dialogs\r
-// Frame windows use CreateSimpleCEMenuBar\r
-\r
-inline HWND AtlCreateMenuBar(SHMENUBARINFO& mbi)\r
-{\r
-       ATLASSERT(::IsWindow(mbi.hwndParent));\r
-       ATLVERIFY(::SHCreateMenuBar(&mbi) != FALSE);\r
-       return mbi.hwndMB;\r
-};\r
-\r
-inline HWND AtlCreateMenuBar(HWND hWnd, UINT nToolBarId = ATL_IDW_TOOLBAR, DWORD dwFlags = 0, int nBmpId = 0, int cBmpImages = 0, COLORREF clrBk = 0)\r
-{\r
-       SHMENUBARINFO mbi = { sizeof(mbi), hWnd, dwFlags, nToolBarId, ModuleHelper::GetResourceInstance(), nBmpId, cBmpImages, 0, clrBk };\r
-       return AtlCreateMenuBar(mbi);\r
-}\r
-\r
-inline HWND AtlCreateEmptyMenuBar(HWND hWnd, bool bSip = true)\r
-{\r
-       SHMENUBARINFO embi = { sizeof(SHMENUBARINFO), hWnd, SHCMBF_EMPTYBAR };\r
-       if (!bSip)\r
-               embi.dwFlags |= SHCMBF_HIDESIPBUTTON;\r
-       \r
-       return AtlCreateMenuBar(embi);\r
-}\r
-       \r
-///////////////////////////////////////////////////////////////////////////////\r
-// Helper functions for SmartPhone back key handling\r
-\r
-inline bool AtlIsEditFocus()\r
-{\r
-       ATL::CWindow wCtrl = GetFocus();\r
-       if (wCtrl.IsWindow())\r
-       {\r
-               TCHAR szClassName[8] = {0};\r
-               ATLVERIFY(::GetClassName(wCtrl.m_hWnd, szClassName, 8));\r
-               return !_tcscmp(szClassName, _T("Edit")) || !_tcscmp(szClassName, WC_CAPEDIT);\r
-       }\r
-       return false;\r
-}\r
-\r
-#if defined WIN32_PLATFORM_WFSP\r
-inline void AtlActivateBackKey(HWND hMenuBar)\r
-{\r
-       ATLASSERT(::IsWindow(hMenuBar));\r
-       ::SendMessage(hMenuBar, SHCMBM_OVERRIDEKEY, VK_TBACK,\r
-               MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, SHMBOF_NODEFAULT | SHMBOF_NOTIFY));\r
-}\r
-#endif // WIN32_PLATFORM_WFSP\r
-\r
-// --- Standard PPC/SmartPhone dialogs ---\r
-\r
-#ifndef _WTL_CE_NO_DIALOGS\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdDialogBase - base class for standard PPC/SmartPhone dialogs\r
-\r
-#define WTL_STD_SHIDIF   SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN\r
-#define WTL_SP_SHIDIF    SHIDIF_SIZEDLGFULLSCREEN\r
-\r
-// Title setting macros\r
-#define WTL_DLG_TITLEHEIGHT(iHeight) static const int GetTitleHeight(){return iHeight;}\r
-#define WTL_DLG_NOTITLE         WTL_DLG_TITLEHEIGHT(0)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdDialogBase - Base class for standard PPC/SmartPhone dialog\r
-\r
-template <class T, UINT t_shidiFlags, bool t_bModal = true>\r
-class CStdDialogBase\r
-{\r
-public:\r
-#ifdef WIN32_PLATFORM_PSPC\r
-// Pocket PC only Dialog title handling\r
-       const int nTitleHeight;\r
-\r
-       CStdDialogBase() : nTitleHeight(T::GetTitleHeight())\r
-       { }\r
-\r
-// Overloads\r
-       BOOL GetClientRect(LPRECT lpRect) \r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               BOOL bRes = ::GetClientRect(pT->m_hWnd, lpRect);\r
-               lpRect->top += nTitleHeight;\r
-               return bRes;\r
-       }\r
-\r
-       BOOL SetWindowText(LPCTSTR lpszString)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               BOOL bRes = ::SetWindowText(pT->m_hWnd, lpszString);\r
-               if (nTitleHeight != 0)\r
-                       pT->DoPaintTitle();\r
-               return bRes;\r
-       }\r
-\r
-// Overrideables\r
-       static const int GetTitleHeight()\r
-       {\r
-       #ifdef _WTL_CE_DRA\r
-               return DRA::SCALEY(24);\r
-       #else // !_WTL_CE_DRA\r
-               CWindowDC dc(NULL);\r
-               return dc.GetDeviceCaps(LOGPIXELSY) >> 2; // LOGPIXELSY * 24 / 96,\r
-       #endif // !_WTL_CE_DRA\r
-       }\r
-\r
-       // Title painting\r
-       bool DoPaintTitle()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               TCHAR sTitle[48];\r
-\r
-               // Preparation\r
-               CPaintDC dc(pT->m_hWnd);\r
-               CFont fontTitle = AtlCreateBoldFont();\r
-               CFontHandle fontOld = dc.SelectFont(fontTitle);\r
-               dc.SetTextColor(GetSysColor(COLOR_HIGHLIGHT));\r
-               int nLen = pT->GetWindowText(sTitle, 48);\r
-               int nWidth = dc.GetDeviceCaps(HORZRES);\r
-\r
-               // Display title text\r
-               RECT rTitle = { 0, 0, nWidth, nTitleHeight };\r
-               dc.FillRect(&rTitle, COLOR_3DHIGHLIGHT);\r
-       #ifdef _WTL_CE_DRA\r
-               rTitle.left = DRA::SCALEX(8);\r
-       #else // !_WTL_CE_DRA\r
-               rTitle.left = nTitleHeight / 3; // 8 == 24 / 3\r
-       #endif // !_WTL_CE_DRA\r
-               dc.DrawText(sTitle, nLen, &rTitle, DT_VCENTER | DT_SINGLELINE);\r
-               dc.SelectFont(fontOld);\r
-\r
-               // Draw bottom line, 2 pixels thick if HI_RES_AWARE\r
-               CPenHandle penOld = dc.SelectStockPen(BLACK_PEN);\r
-               POINT line[4] = {{0, nTitleHeight}, {nWidth, nTitleHeight}, {0, nTitleHeight - 1}, {nWidth, nTitleHeight - 1}};\r
-\r
-       #ifdef _WTL_CE_DRA\r
-               int nSeg = DRA::SCALEY(1);\r
-       #else // !_WTL_CE_DRA\r
-               int nSeg = nTitleHeight / 24; \r
-       #endif // !_WTL_CE_DRA\r
-\r
-               dc.Polyline(line, nSeg <= 2 ? nSeg * 2 : 4);\r
-               dc.SelectPen(penOld);\r
-\r
-               return false;\r
-       }\r
-\r
-       // Title preparation: move the dialog controls down to make room for title\r
-       void DialogTitleInit()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-\r
-               ATL::CWindow wCtl = pT->GetWindow(GW_CHILD);\r
-               while (wCtl.IsWindow())\r
-               {\r
-                       RECT rCtl = { 0 };\r
-                       wCtl.GetWindowRect(&rCtl);\r
-                       ::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rCtl, 2);\r
-                       ::OffsetRect(&rCtl, 0, nTitleHeight);\r
-                       wCtl.MoveWindow(&rCtl, FALSE);\r
-                       wCtl = wCtl.GetWindow(GW_HWNDNEXT);\r
-               }\r
-       }\r
-\r
-       // SIP management\r
-       void DoSipInfo()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-\r
-               SIPINFO si = {sizeof(SIPINFO)};\r
-               SipGetInfo(&si);\r
-               if ((si.fdwFlags & SIPF_ON) ^ SIPF_ON) \r
-                       si.rcVisibleDesktop.bottom = si.rcSipRect.bottom;\r
-               pT->MoveWindow(&si.rcVisibleDesktop, FALSE);\r
-       }\r
-\r
-// Title painting handler\r
-       LRESULT OnPaintTitle(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return bHandled = nTitleHeight ? pT->DoPaintTitle() : FALSE;\r
-       }\r
-\r
-// SIP handler\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if (wParam == SPI_SETSIPINFO)\r
-               {\r
-                       pT->DoSipInfo();\r
-                       return TRUE;\r
-               }\r
-               return bHandled = FALSE;\r
-       }\r
-\r
-#elif defined WIN32_PLATFORM_WFSP\r
-// SmartPhone VK_TBACK key standard management\r
-       LRESULT OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               const UINT uModif = (UINT)LOWORD(lParam);\r
-               const UINT uVirtKey = (UINT)HIWORD(lParam);\r
-\r
-               if(uVirtKey == VK_TBACK)\r
-                       if (AtlIsEditFocus())\r
-                               ::SHSendBackToFocusWindow(uMsg, wParam, lParam);\r
-                       else if (uModif & MOD_KEYUP)\r
-                                       pT->StdCloseDialog(IDCANCEL);\r
-               return 1;\r
-       }\r
-\r
- // SmartPhone MenuBar and VK_TBACK key initialization\r
-       void StdSPInit()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               HWND hMenuBar = ::SHFindMenuBar(pT->m_hWnd);\r
-\r
-               if (!hMenuBar && (t_shidiFlags & SHIDIF_DONEBUTTON))\r
-                       hMenuBar = CreateMenuBar(ATL_IDM_MENU_DONE);\r
-\r
-               if(hMenuBar != NULL)\r
-                       AtlActivateBackKey(hMenuBar);\r
-       }\r
-\r
-       void SetStaticBold()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-\r
-               CFontHandle fontBold = AtlCreateBoldFont(pT->GetFont());\r
-\r
-               ATL::CWindow wCtl = pT->GetWindow(GW_CHILD);\r
-\r
-               while (wCtl.IsWindow())\r
-               {\r
-                       if ((short int)wCtl.GetDlgCtrlID() == IDC_STATIC)\r
-                               wCtl.SetFont(fontBold);\r
-                       wCtl = wCtl.GetWindow(GW_HWNDNEXT);\r
-               }\r
-       }\r
-#endif // WIN32_PLATFORM_WFSP\r
-\r
-// Platform dependant initialization\r
-       void StdPlatformInit()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-#ifdef WIN32_PLATFORM_PSPC // Pocket PC title initialization\r
-               if (nTitleHeight != 0)\r
-                       pT->DialogTitleInit();\r
-#elif defined(WIN32_PLATFORM_WFSP)\r
-               pT->StdSPInit();\r
-               SetStaticBold();\r
-#endif // WIN32_PLATFORM_WFSP\r
-       }\r
-\r
-       // Menu bar creation\r
-       HWND CreateMenuBar(UINT uiMB = T::IDD, int nBmpImages = 0)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return AtlCreateMenuBar(pT->m_hWnd, uiMB, 0, nBmpImages ? uiMB : 0, nBmpImages);\r
-       }\r
-\r
-       // Dialog closing\r
-       void StdCloseDialog(WORD wID)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if (t_bModal)\r
-                       ::EndDialog(pT->m_hWnd, wID);\r
-               else\r
-                       pT->DestroyWindow();\r
-       }\r
-\r
-       // Shell dialog layout initialization\r
-       void StdShidInit()\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               SHINITDLGINFO shidi = { SHIDIM_FLAGS, pT->m_hWnd, t_shidiFlags };\r
-               ::SHInitDialog(&shidi);\r
-       }\r
-\r
-// IDC_INFOSTATIC background setting\r
-       LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               if (::GetDlgCtrlID((HWND)lParam) == IDC_INFOSTATIC)\r
-               {\r
-                       ::SetBkMode((HDC)wParam, TRANSPARENT);\r
-                       return (LRESULT)::GetSysColorBrush(COLOR_INFOBK);\r
-               }\r
-               return bHandled = FALSE;\r
-       }\r
-\r
-// Menu dialog ending\r
-       LRESULT OnMenuClose(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->StdCloseDialog((WORD)(wID - ID_MENU_OK + IDOK));\r
-               return 0;\r
-       }\r
-\r
-// Standard dialog ending: may be used with any command\r
-       LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->StdCloseDialog(wID);\r
-               return 0;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdDialogImplBase - Base implementation of standard PPC/SmartPhone dialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true, class TBase = ATL::CDialogImpl< T > >\r
-class ATL_NO_VTABLE CStdDialogImplBase :\r
-               public TBase,\r
-               public CStdDialogBase<T, t_shidiFlags, t_bModal>\r
-{\r
-public:\r
-#ifdef WIN32_PLATFORM_PSPC\r
-       BOOL GetClientRect(LPRECT lpRect) \r
-       {\r
-               return CStdDialogBase<T, t_shidiFlags, t_bModal>::GetClientRect(lpRect);\r
-       }\r
-\r
-       BOOL SetWindowText(LPCTSTR lpszString)\r
-       {\r
-               return CStdDialogBase<T, t_shidiFlags, t_bModal>::SetWindowText(lpszString);\r
-       }\r
-#endif\r
-\r
-       BEGIN_MSG_MAP(CStdDialogImplBase)\r
-#ifdef WIN32_PLATFORM_PSPC // Pocket PC title and SIP\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaintTitle)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-#elif defined(WIN32_PLATFORM_WFSP) // SmartPhone VK_TBACK key\r
-               MESSAGE_HANDLER(WM_HOTKEY, OnHotKey)\r
-#endif\r
-               MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, OnCloseCmd)\r
-               COMMAND_RANGE_HANDLER(ID_MENU_OK, ID_MENU_CANCEL, OnMenuClose)\r
-       END_MSG_MAP()\r
-       \r
-       LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _DEBUG\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(t_bModal == pT->m_bModal);\r
-#endif\r
-               StdPlatformInit();\r
-               StdShidInit();\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdDialogImpl - implementation of standard PPC/SmartPhone dialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true >\r
-class ATL_NO_VTABLE CStdDialogImpl : public CStdDialogImplBase< T, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdIndirectDialogImpl - implementation of standard indirect PPC/SmartPhone dialog\r
-\r
-#if defined __ATLDLGS_H__ \r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true>\r
-class ATL_NO_VTABLE CStdIndirectDialogImpl : \r
-       public CIndirectDialogImpl< T, CMemDlgTemplate, CStdDialogImpl<T, t_shidiFlags, t_bModal> >\r
-{\r
-public:\r
-       typedef CIndirectDialogImpl< T, CMemDlgTemplate, CStdDialogImpl<T, t_shidiFlags, t_bModal> >    _baseClass;\r
-       typedef CStdDialogImpl<T, t_shidiFlags, t_bModal> _baseStd;\r
-\r
-       INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow(), LPARAM dwInitParam = NULL)\r
-       {\r
-               ATLASSERT(t_bModal);\r
-\r
-               if (!m_Template.IsValid())\r
-                       CreateTemplate();\r
-\r
-               if (m_Template.IsTemplateEx())\r
-               {\r
-                       if (m_Template.GetTemplateExPtr()->style & DS_CENTER)\r
-                       {\r
-                               ATLASSERT(m_Template.GetTemplateExPtr()->style ^ WS_CHILD);\r
-                               GetTemplateExPtr()->style |= WS_POPUP;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if (m_Template.GetTemplatePtr()->style & DS_CENTER)\r
-                       {\r
-                               ATLASSERT(m_Template.GetTemplatePtr()->style ^ WS_CHILD);\r
-                               m_Template.GetTemplatePtr()->style |= WS_POPUP;\r
-                       }\r
-               }\r
-\r
-               return _baseClass::DoModal(hWndParent, dwInitParam);\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, LPARAM dwInitParam = NULL)\r
-       {\r
-               ATLASSERT(!t_bModal);\r
-\r
-               if (!m_Template.IsValid())\r
-                       CreateTemplate();\r
-\r
-               if (m_Template.IsTemplateEx())\r
-               {\r
-                       if (GetTemplateExPtr()->style & DS_CENTER)\r
-                       {\r
-                               ATLASSERT(GetTemplateExPtr()->style ^ WS_CHILD);\r
-                               GetTemplateExPtr()->style |= WS_POPUP;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       if (GetTemplatePtr()->style & DS_CENTER)\r
-                       {\r
-                               ATLASSERT(GetTemplatePtr()->style ^ WS_CHILD);\r
-                               GetTemplatePtr()->style |= WS_POPUP;\r
-                       }\r
-               }\r
-\r
-               return _baseClass::Create(hWndParent, dwInitParam);\r
-       }\r
-\r
-       BEGIN_MSG_MAP(CStdIndirectDialogImpl)\r
-               CHAIN_MSG_MAP(_baseStd)\r
-       END_MSG_MAP()\r
-\r
-};\r
\r
-#endif // defined __ATLDLGS_H__ \r
-\r
-#ifndef _ATL_NO_HOSTING\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdAxDialogImpl - implementation of standard  PPC/SmartPhone AxDialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true >\r
-class ATL_NO_VTABLE CStdAxDialogImpl : public CStdDialogImplBase< T, t_shidiFlags, t_bModal, ATL::CAxDialogImpl< T > >\r
-{};\r
-#endif // _ATL_NO_HOSTING\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdSimpleDialog - standard PPC/SmartPhone simple dialog with SHIDIF_xxx flags\r
-\r
-template <WORD t_wDlgTemplateID, UINT t_shidiFlags = WTL_STD_SHIDIF>\r
-class CStdSimpleDialog :\r
-               public ATL::CSimpleDialog<t_wDlgTemplateID, FALSE>,\r
-               public CStdDialogBase<CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags>, t_shidiFlags>\r
-{\r
-public:\r
-       typedef CStdDialogBase<CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags>, t_shidiFlags> baseClass;\r
-\r
-#ifdef WIN32_PLATFORM_PSPC\r
-       BOOL GetClientRect(LPRECT lpRect) \r
-       {\r
-               return baseClass::GetClientRect(lpRect);\r
-       }\r
-\r
-       BOOL SetWindowText(LPCTSTR lpszString)\r
-       {\r
-               return baseClass::SetWindowText(lpszString);\r
-       }\r
-#endif\r
-\r
-       BEGIN_MSG_MAP(CStdSimpleDialog)\r
-#ifdef WIN32_PLATFORM_PSPC // Pocket PC title and SIP\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaintTitle)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-#elif defined(WIN32_PLATFORM_WFSP) // SmartPhone VK_TBACK key\r
-               MESSAGE_HANDLER(WM_HOTKEY, OnHotKey)\r
-#endif\r
-               MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               COMMAND_RANGE_HANDLER(ID_MENU_OK, ID_MENU_CANCEL, OnMenuClose)\r
-               COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, baseClass::OnCloseCmd)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               StdPlatformInit();\r
-               StdShidInit();\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdDialogResizeImplBase - Base implementation of orientation resizing standard PPC/SmartPhone dialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true, class TBase = ATL::CDialogImpl<T> >\r
-class ATL_NO_VTABLE CStdDialogResizeImplBase :\r
-               public CStdDialogImplBase< T, t_shidiFlags, t_bModal, TBase>,\r
-               public CDialogResize<T>\r
-{\r
-public:\r
-       // Note: BEGIN_DLGRESIZE_MAP is required in the derived class.\r
-\r
-       BEGIN_MSG_MAP(CStdResizeDialogImplBase)\r
-#ifdef WIN32_PLATFORM_PSPC // Pocket PC title\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaintTitle)\r
-#elif defined(WIN32_PLATFORM_WFSP) // SmartPhone VK_TBACK key\r
-               MESSAGE_HANDLER(WM_HOTKEY, OnHotKey)\r
-#endif\r
-               MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, OnCloseCmd)\r
-               COMMAND_RANGE_HANDLER(ID_MENU_OK, ID_MENU_CANCEL, OnMenuClose)\r
-               CHAIN_MSG_MAP(CDialogResize< T >)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifdef _DEBUG\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(t_bModal == pT->m_bModal);\r
-#endif\r
-               StdPlatformInit();\r
-               DlgResize_Init(FALSE);\r
-               StdShidInit();\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdDialogResizeImpl - implementation of orientation resizing standard PPC/SmartPhone dialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true >\r
-class ATL_NO_VTABLE CStdDialogResizeImpl : public CStdDialogResizeImplBase< T, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-#ifndef _ATL_NO_HOSTING\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdAxDialogResizeImpl - implementation of orientation resizing standard PPC/SmartPhone AxDialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true >\r
-class ATL_NO_VTABLE CStdAxDialogResizeImpl : public CStdDialogResizeImplBase< T, t_shidiFlags, t_bModal, ATL::CAxDialogImpl<T> >\r
-{};\r
-#endif // _ATL_NO_HOSTING\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdSimpleDialogResizeImpl - implementation of standard resizing simple dialog with SHIDIF_xxx flags\r
-\r
-// Usage:\r
-//     class CMyDlg : public CStdSimpleDialogResize<CMyDlg,\r
-//             IDD_MYDLG, SHIDIF_DONEBUTTON | SHIDIF_FULLSCREENNOMENUBAR>\r
-//     {\r
-//     public:\r
-//             BEGIN_DLGRESIZE_MAP(CMyDlg)\r
-//             ...\r
-//             END_DLGRESIZE_MAP()\r
-//     };\r
-\r
-template <class T, WORD t_wDlgTemplateID, UINT t_shidiFlags = WTL_STD_SHIDIF>\r
-class ATL_NO_VTABLE CStdSimpleDialogResizeImpl :\r
-               public CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags>,\r
-               public CDialogResize< T >\r
-{\r
-public:\r
-       typedef CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags>::baseClass baseClass;\r
-\r
-       BEGIN_MSG_MAP(CStdSimpleDialogResizeImpl)\r
-#ifdef WIN32_PLATFORM_PSPC // Pocket PC title\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaintTitle)\r
-#elif defined(WIN32_PLATFORM_WFSP) // SmartPhone VK_TBACK key\r
-               MESSAGE_HANDLER(WM_HOTKEY, OnHotKey)\r
-#endif\r
-               MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, baseClass::OnCloseCmd)\r
-               COMMAND_RANGE_HANDLER(ID_MENU_OK, ID_MENU_CANCEL, OnMenuClose)\r
-               CHAIN_MSG_MAP(CDialogResize< T >)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               StdPlatformInit();\r
-               DlgResize_Init(FALSE);\r
-               StdShidInit();\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-#if defined(_WTL_CE_DRA) && defined(WIN32_PLATFORM_PSPC)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdOrientedDialogBase - Oriented PPC standard dialog base class\r
-\r
-template <class T>\r
-class CStdOrientedDialogBase\r
-{\r
-public:\r
-// Operation\r
-       BOOL SetOrientation(DRA::DisplayMode mode)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               ATLASSERT(mode == DRA::GetDisplayMode());\r
-               \r
-               // Derived dialog must enumerate TWO dialog templates with the same control ids and types ie:\r
-               // enum { IDD = IDD_MYDLG, IDD_LANDSCAPE = IDD_MYDLG_L };\r
-               UINT iResource = (mode == DRA::Landscape)? T::IDD_LANDSCAPE : T::IDD;\r
-\r
-               BOOL bRes = DRA::RelayoutDialog(ModuleHelper::GetResourceInstance(), pT->m_hWnd, MAKEINTRESOURCE(iResource));\r
-               pT->OnOrientation(mode);\r
-               return bRes;\r
-       }\r
-\r
-// Override\r
-       void OnOrientation(DRA::DisplayMode /*mode*/)\r
-       {}\r
-\r
-// Message handlers\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               if (wParam == SETTINGCHANGE_RESET)\r
-               {\r
-                       SetOrientation(DRA::GetDisplayMode());\r
-                       pT->StdPlatformInit();\r
-                       pT->StdShidInit();\r
-               }\r
-               else if (wParam == SPI_SETSIPINFO)\r
-               {\r
-                       pT->DoSipInfo();\r
-                       return TRUE;\r
-               }\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdOrientedDialogImplBase - Oriented PPC standard dialog base implementation\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true, class TBase = ATL::CDialogImpl<T> >\r
-class ATL_NO_VTABLE CStdOrientedDialogImplBase :\r
-               public CStdDialogImplBase< T, t_shidiFlags, t_bModal, TBase>,\r
-               public CStdOrientedDialogBase<T>\r
-{\r
-public:\r
-       BEGIN_MSG_MAP(CStdOrientedDialogImpl)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaintTitle)\r
-               MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, CStdOrientedDialogBase<T>::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, OnCloseCmd)\r
-               COMMAND_RANGE_HANDLER(ID_MENU_OK, ID_MENU_CANCEL, OnMenuClose)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-#ifdef _DEBUG\r
-               ATLASSERT(t_bModal == pT->m_bModal);\r
-#endif\r
-               if (DRA::GetDisplayMode() == DRA::Landscape)\r
-                       SetOrientation(DRA::Landscape);\r
-               pT->StdPlatformInit();\r
-               pT->StdShidInit();\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdOrientedDialogImpl - Oriented PPC standard dialog implementation\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true >\r
-class ATL_NO_VTABLE CStdOrientedDialogImpl : public CStdOrientedDialogImplBase< T, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-#ifndef _ATL_NO_HOSTING\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdAxOrientedDialogImpl - Oriented PPC standard AxDialog implementation\r
-\r
-template <class T, UINT t_shidiFlags = WTL_STD_SHIDIF, bool t_bModal = true >\r
-class ATL_NO_VTABLE CStdAxOrientedDialogImpl : public CStdOrientedDialogImplBase< T, t_shidiFlags, t_bModal, ATL::CAxDialogImpl<T> >\r
-{};\r
-#endif // _ATL_NO_HOSTING\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CStdSimpleOrientedDialog - Standard simple orientable dialog\r
-\r
-template <WORD t_wDlgTemplateID, WORD t_wDlgLandscapeID, UINT t_shidiFlags = WTL_STD_SHIDIF>\r
-class CStdSimpleOrientedDialog :\r
-               public CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags>,\r
-               public CStdOrientedDialogBase<CStdSimpleOrientedDialog<t_wDlgTemplateID, t_wDlgLandscapeID, t_shidiFlags> >\r
-{\r
-public:\r
-       typedef CStdSimpleDialog<t_wDlgTemplateID, t_shidiFlags>::baseClass baseClass;\r
-       typedef CStdOrientedDialogBase<CStdSimpleOrientedDialog<t_wDlgTemplateID, t_wDlgLandscapeID, t_shidiFlags> > baseOriented;\r
-\r
-       enum {IDD = t_wDlgTemplateID, IDD_LANDSCAPE = t_wDlgLandscapeID};\r
-\r
-       BEGIN_MSG_MAP(CStdSimpleDialog)\r
-               MESSAGE_HANDLER(WM_PAINT, OnPaintTitle)\r
-               MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, baseOriented::OnSettingChange)\r
-               MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)\r
-               COMMAND_RANGE_HANDLER(IDOK, IDCANCEL, baseClass::OnCloseCmd)\r
-               COMMAND_RANGE_HANDLER(ID_MENU_OK, ID_MENU_CANCEL, OnMenuClose)\r
-       END_MSG_MAP()\r
-\r
-               LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if (DRA::GetDisplayMode() == DRA::Landscape)\r
-                       SetOrientation(DRA::Landscape);\r
-               StdPlatformInit();\r
-               StdShidInit();\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-#endif // _WTL_CE_DRA\r
-\r
-\r
-#endif // _WTL_CE_NO_DIALOGS\r
-\r
-\r
-// --- PPC/SmartPhone application window and helpers ---\r
-\r
-#ifndef _WTL_CE_NO_APPWINDOW\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppInfoBase - Helper for application state save/restore to registry\r
-\r
-class CAppInfoBase\r
-{\r
-public:\r
-       ATL::CRegKey m_Key;\r
-\r
-       CAppInfoBase(ATL::_U_STRINGorID sAppKey)\r
-       {\r
-               m_Key.Create(HKEY_CURRENT_USER, sAppKey.m_lpstr);\r
-               ATLASSERT(m_Key.m_hKey);\r
-       }\r
-\r
-       template <class V>\r
-       LONG Save(V& val, ATL::_U_STRINGorID sName)\r
-       {\r
-               return ::RegSetValueEx(m_Key, sName.m_lpstr, 0, REG_BINARY, (LPBYTE)&val, sizeof(V));\r
-       }\r
-\r
-       template <class V>\r
-       LONG Save(int nb, V& val0, ATL::_U_STRINGorID sName)\r
-       {\r
-               return ::RegSetValueEx(m_Key, sName.m_lpstr, 0, REG_BINARY, (LPBYTE)&val0, nb * sizeof(V));\r
-       }\r
-\r
-       template <class V>\r
-       LONG Restore(V& val, ATL::_U_STRINGorID sName)\r
-       {\r
-               DWORD valtype;\r
-               DWORD bufSize = sizeof(V);\r
-               return ::RegQueryValueEx(m_Key, sName.m_lpstr, 0, &valtype, (LPBYTE)&val, &bufSize);\r
-       }\r
-\r
-       template <class V>\r
-       LONG Restore(int nb, V& val0, ATL::_U_STRINGorID sName)\r
-       {\r
-               DWORD valtype;\r
-               DWORD bufSize = nb * sizeof(V);\r
-               return ::RegQueryValueEx(m_Key, sName.m_lpstr, 0, &valtype, (LPBYTE)&val0, &bufSize);\r
-       }\r
-\r
-#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-#if (_ATL_VER < 0x0800)\r
-       LONG Save(_CSTRING_NS::CString& sval, ATL::_U_STRINGorID sName)\r
-       {\r
-               return m_Key.SetValue(sval, sName.m_lpstr);\r
-       }\r
-\r
-       LONG Restore(_CSTRING_NS::CString& sval, ATL::_U_STRINGorID sName)\r
-       {\r
-               DWORD size = MAX_PATH;\r
-               LONG res = m_Key.QueryValue(sval.GetBuffer(size), sName.m_lpstr, &size);\r
-               sval.ReleaseBuffer();\r
-               return res;\r
-       }\r
-#else // !(_ATL_VER < 0x0800)\r
-       LONG Save(_CSTRING_NS::CString& sval, ATL::_U_STRINGorID sName)\r
-       {\r
-               return m_Key.SetStringValue(sName.m_lpstr, sval);\r
-       }\r
-\r
-       LONG Restore(_CSTRING_NS::CString& sval, ATL::_U_STRINGorID sName)\r
-       {\r
-               DWORD size = MAX_PATH;\r
-               LONG res = m_Key.QueryStringValue(sName.m_lpstr, sval.GetBuffer(size), &size);\r
-               sval.ReleaseBuffer();\r
-               return res;\r
-       }\r
-#endif // !(_ATL_VER < 0x0800)\r
-#else\r
-  #pragma message("Warning: CAppInfoBase compiles without CString support. Do not use CString in Save or Restore.")\r
-#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)\r
-       \r
-#if (_ATL_VER < 0x0800)\r
-       LONG Save(LPCTSTR sval, ATL::_U_STRINGorID sName)\r
-       {\r
-               return m_Key.SetValue(sval, sName.m_lpstr);\r
-       }\r
-\r
-       LONG Restore(LPTSTR sval, ATL::_U_STRINGorID sName, DWORD *plength)\r
-       {\r
-               return m_Key.QueryValue(sval, sName.m_lpstr, plength);\r
-       }\r
-#else // !(_ATL_VER < 0x0800)\r
-       LONG Save(LPCTSTR sval, ATL::_U_STRINGorID sName)\r
-       {\r
-               return m_Key.SetStringValue(sName.m_lpstr, sval);\r
-       }\r
-\r
-       LONG Restore(LPTSTR sval, ATL::_U_STRINGorID sName, DWORD *plength)\r
-       {\r
-               return m_Key.QueryStringValue(sName.m_lpstr, sval, plength);\r
-       }\r
-#endif // !(_ATL_VER < 0x0800)\r
-       \r
-       LONG Delete(ATL::_U_STRINGorID sName)\r
-       {\r
-               return  m_Key.DeleteValue(sName.m_lpstr);\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppInfoT - CAppInfoBase constructed from a class with T::GetAppKey() \r
-\r
-// Macro for declaring AppKey\r
-#define DECLARE_APPKEY(uAppKey) \\r
-       static LPCTSTR GetAppKey() \\r
-       { \\r
-               static LPCTSTR sAppKey = ATL::_U_STRINGorID(uAppKey).m_lpstr; \\r
-               return sAppKey; \\r
-       }\r
-\r
-template <class T>\r
-class CAppInfoT : public CAppInfoBase\r
-{\r
-public:\r
-       CAppInfoT() : CAppInfoBase(T::GetAppKey()){}\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppWindowBase - Base class for PPC/SmartPhone "well-behaved" application window or dialog\r
-\r
-// Macros for declaring frame WNDCLASS and AppKey\r
-#define DECLARE_APP_FRAME_CLASS(WndClassName, uCommonResourceID, uAppKey) \\r
-       DECLARE_FRAME_WND_CLASS(WndClassName, uCommonResourceID) \\r
-       DECLARE_APPKEY(uAppKey)\r
-\r
-#define DECLARE_APP_FRAME_CLASS_EX(WndClassName, uCommonResourceID, style, bkgnd, uAppKey) \\r
-       DECLARE_FRAME_WND_CLASS_EX(WndClassName, uCommonResourceID, style, bkgnd) \\r
-       DECLARE_APPKEY(uAppKey)\r
-\r
-template <class T>\r
-class CAppWindowBase\r
-{\r
-public:\r
-       typedef class CAppInfoT< T > CAppInfo;\r
-\r
-#ifndef WIN32_PLATFORM_WFSP\r
-       SHACTIVATEINFO m_sai; // NoOp on SmartPhones\r
-#endif // WIN32_PLATFORM_WFSP\r
-\r
-       bool m_bHibernate;\r
-\r
-       CAppWindowBase< T >() : m_bHibernate(false)\r
-       {\r
-#ifndef WIN32_PLATFORM_WFSP\r
-               SHACTIVATEINFO sai = { sizeof(SHACTIVATEINFO) };\r
-               m_sai = sai;\r
-#endif // WIN32_PLATFORM_WFSP\r
-       };\r
-\r
-       // Same as WTL 7.1 AppWizard generated ActivatePreviousInstance + SendMessage WM_COPYDATA\r
-       static HRESULT ActivatePreviousInstance(HINSTANCE hInstance, LPCTSTR  lpstrCmdLine, bool bDialog)\r
-       {\r
-               // requires T does DECLARE_APP_FRAME_CLASS, DECLARE_APP_FRAME_CLASS_EX or DECLARE_APP_DLG_CLASS\r
-               CFrameWndClassInfo& classInfo = T::GetWndClassInfo();\r
-\r
-               ATLVERIFY(::LoadString(hInstance, classInfo.m_uCommonResourceID, classInfo.m_szAutoName, sizeof(classInfo.m_szAutoName)/sizeof(classInfo.m_szAutoName[0])) != 0);\r
-\r
-               classInfo.m_wc.lpszClassName = classInfo.m_szAutoName;\r
-\r
-               const TCHAR* pszClass = classInfo.m_wc.lpszClassName;\r
-\r
-               if(NULL == pszClass || '\0' == *pszClass)\r
-               {\r
-                       return E_FAIL;\r
-               }\r
-\r
-               const DWORD dRetryInterval = 100;\r
-               const int iMaxRetries = 25;\r
-\r
-               for(int i = 0; i < iMaxRetries; ++i)\r
-               {\r
-                       HANDLE hMutex = CreateMutex(NULL, FALSE, pszClass);\r
-\r
-                       DWORD dw = GetLastError();\r
-\r
-                       if(NULL == hMutex)\r
-                       {\r
-                               HRESULT hr;\r
-\r
-                               switch(dw)\r
-                               {\r
-                               case ERROR_INVALID_HANDLE:\r
-                                       // A non-mutext object with this name already exists.\r
-                                       hr = E_INVALIDARG;\r
-                                       break;\r
-                               default:\r
-                                       // This should never happen...\r
-                                       hr = E_FAIL;\r
-                               }\r
-\r
-                               return hr;\r
-                       }\r
-\r
-                       // If the mutex already exists, then there should be another instance running\r
-                       if(dw == ERROR_ALREADY_EXISTS)\r
-                       {\r
-                               CloseHandle(hMutex);\r
-                               \r
-                               HWND hwnd = NULL;\r
-                               if (bDialog)\r
-                                       hwnd = FindWindow(NULL, pszClass);\r
-                               else\r
-                                       hwnd = FindWindow(pszClass, NULL);\r
-\r
-                               if(hwnd == NULL)\r
-                               {\r
-                                       Sleep(dRetryInterval);\r
-                                       continue;\r
-                               }\r
-                               else\r
-                               {\r
-                                       // Transmit our params to previous instance\r
-                                       if (lpstrCmdLine && *lpstrCmdLine)\r
-                                       {\r
-                                               COPYDATASTRUCT cd = { NULL, sizeof(TCHAR) * (wcslen(lpstrCmdLine) + 1), (PVOID)lpstrCmdLine };\r
-                                               ::SendMessage(hwnd, WM_COPYDATA, NULL, (LPARAM)&cd);\r
-                                       }\r
-                                       // Set the previous instance as the foreground window\r
-                                       if(0 != SetForegroundWindow(reinterpret_cast<HWND>(reinterpret_cast<ULONG>(hwnd) | 0x1)))\r
-                                               return S_FALSE;\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               return S_OK;\r
-                       }\r
-               }\r
-               return S_OK;\r
-       }\r
-\r
-// Operations overriden in derived class\r
-       bool AppHibernate(bool /*bHibernate*/)\r
-       {\r
-               return false;\r
-       }\r
-\r
-       bool AppNewInstance(LPCTSTR /*lpstrCmdLine*/)\r
-       {\r
-               return false;\r
-       }\r
-\r
-       void AppSave()\r
-       {\r
-       }\r
-\r
-#ifdef WIN32_PLATFORM_WFSP \r
-       void AppBackKey() \r
-       {\r
-               ::SHNavigateBack();\r
-       }\r
-#endif\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CAppWindowBase)\r
-               MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)\r
-#ifdef WIN32_PLATFORM_WFSP\r
-               MESSAGE_HANDLER(WM_HOTKEY, OnHotKey)\r
-#else\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-#endif // WIN32_PLATFORM_WFSP\r
-               MESSAGE_HANDLER(WM_HIBERNATE, OnHibernate)\r
-               MESSAGE_HANDLER(WM_COPYDATA, OnNewInstance)\r
-               MESSAGE_HANDLER(WM_CLOSE, OnClose)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if (m_bHibernate)\r
-                       m_bHibernate = pT->AppHibernate(false);\r
-#ifndef WIN32_PLATFORM_WFSP\r
-               ::SHHandleWMActivate(pT->m_hWnd, wParam, lParam, &m_sai, 0);\r
-#else\r
-               wParam;\r
-               lParam;\r
-#endif // WIN32_PLATFORM_WFSP\r
-                return bHandled = FALSE;\r
-       }\r
-\r
-#ifdef WIN32_PLATFORM_WFSP\r
-// SmartPhone VK_TBACK key standard management\r
-       LRESULT OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               const UINT uModif = (UINT)LOWORD(lParam);\r
-               const UINT uVirtKey = (UINT)HIWORD(lParam);\r
-               if(uVirtKey == VK_TBACK)\r
-                       if (AtlIsEditFocus())\r
-                               ::SHSendBackToFocusWindow(uMsg, wParam, lParam);\r
-                       else if (uModif & MOD_KEYUP)\r
-                               pT->AppBackKey();\r
-               return 1;\r
-       }\r
-\r
-#else // !WIN32_PLATFORM_WFSP\r
-// PPC SIP handling\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               bHandled = FALSE;\r
-               return ::SHHandleWMSettingChange(pT->m_hWnd, wParam, lParam, &m_sai);\r
-       }\r
-#endif // !WIN32_PLATFORM_WFSP\r
-\r
-       LRESULT OnHibernate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               return m_bHibernate = pT->AppHibernate(true);\r
-       }\r
-\r
-       LRESULT OnNewInstance(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               PCOPYDATASTRUCT pcds = (PCOPYDATASTRUCT)lParam;\r
-               return pT->AppNewInstance((LPCTSTR)pcds->lpData);\r
-       }\r
-\r
-       LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->AppSave();\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppWindow - PPC/SmartPhone "well-behaved" application window class\r
-\r
-template <class T>\r
-class CAppWindow : public CAppWindowBase< T >\r
-{\r
-public:\r
-       // Same as WTL 7.1 AppWizard generated Run + lpstrCmdLine in CreateEx\r
-       static int AppRun(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWNORMAL)\r
-       {\r
-               CMessageLoop theLoop;\r
-               _Module.AddMessageLoop(&theLoop);\r
-\r
-               T wndMain;\r
-\r
-               if(wndMain.CreateEx(NULL, NULL, 0, 0, lpstrCmdLine) == NULL)\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Main window creation failed!\n"));\r
-                       return 0;\r
-               }\r
-\r
-               wndMain.ShowWindow(nCmdShow);\r
-\r
-               int nRet = theLoop.Run();\r
-\r
-               _Module.RemoveMessageLoop();\r
-               return nRet;\r
-       }\r
-\r
-       static HRESULT ActivatePreviousInstance(HINSTANCE hInstance, LPCTSTR  lpstrCmdLine)\r
-       {\r
-               return CAppWindowBase< T >::ActivatePreviousInstance(hInstance, lpstrCmdLine, false);\r
-       }\r
-};\r
-\r
-\r
-#ifndef _WTL_CE_NO_DIALOGS\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppDialog - PPC/SmartPhone "well-behaved" dialog application class\r
-\r
-// Macro for declaring dialog WNDCLASS and AppKey\r
-#define DECLARE_APP_DLG_CLASS(WndClassName, uCommonResourceID, uAppKey) \\r
-       static WTL::CFrameWndClassInfo& GetWndClassInfo() \\r
-       { \\r
-               static WTL::CFrameWndClassInfo wc = \\r
-               { \\r
-                       { 0, (WNDPROC)StartDialogProc, \\r
-                       0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, WndClassName }, \\r
-                       NULL, NULL, IDC_ARROW, TRUE, 0, _T(""), uCommonResourceID \\r
-               }; \\r
-               return wc; \\r
-       }; \\r
-       DECLARE_APPKEY(uAppKey)\r
-\r
-template <class T>\r
-class CAppDialog : public CAppWindowBase< T >\r
-{\r
-public:\r
-       static int AppRun(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWNORMAL)\r
-       {\r
-               CMessageLoop theLoop;\r
-               _Module.AddMessageLoop(&theLoop);\r
-\r
-               T dlgMain;\r
-\r
-               if(dlgMain.Create(NULL, (LPARAM)lpstrCmdLine) == NULL)\r
-               {\r
-                       ATLTRACE2(atlTraceUI, 0, _T("Main dialog creation failed!\n"));\r
-                       return 0;\r
-               }\r
-\r
-               dlgMain.ShowWindow(nCmdShow);\r
-\r
-               int nRet = theLoop.Run();\r
-\r
-               _Module.RemoveMessageLoop();\r
-               return nRet;\r
-       }\r
-\r
-       static HRESULT ActivatePreviousInstance(HINSTANCE hInstance, LPCTSTR  lpstrCmdLine)\r
-       {\r
-               return CAppWindowBase< T >::ActivatePreviousInstance(hInstance, lpstrCmdLine, true);\r
-       };\r
-};\r
-\r
-// PPC/SmartPhone standard application dialogs\r
-\r
-#ifdef WIN32_PLATFORM_WFSP\r
-#define WTL_APP_SHIDIF WTL_SP_SHIDIF\r
-#else\r
-#define WTL_APP_SHIDIF WTL_STD_SHIDIF\r
-#endif\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdDialogImplBase - Base implementation of standard application dialogs\r
-\r
-template <class T, class TImplBase, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdDialogImplBase :\r
-               public TImplBase, \r
-               public CAppDialog< T >\r
-{ \r
-public:\r
-       WTL_DLG_NOTITLE;\r
-\r
-       void StdCloseDialog(int nVal)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               if (nVal != IDCANCEL)\r
-                       pT->AppSave();\r
-               if (t_bModal == false)\r
-               {\r
-                       pT->DestroyWindow();\r
-                       ::PostQuitMessage(nVal);\r
-               }\r
-               else\r
-                       ::EndDialog(pT->m_hWnd, nVal);\r
-       }\r
-       \r
-       BEGIN_MSG_MAP(CAppStdDialogImplBase)\r
-               MESSAGE_HANDLER(WM_CLOSE, OnSystemClose)\r
-               CHAIN_MSG_MAP(TImplBase)\r
-               CHAIN_MSG_MAP(CAppDialog< T >)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSystemClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT->StdCloseDialog(IDCANCEL);\r
-               return 0;\r
-       }\r
-};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdDialogImpl - Implementation of standard application dialog \r
-\r
-template <class T, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdDialogImpl :\r
-               public CAppStdDialogImplBase<T, CStdDialogImpl<T, t_shidiFlags, t_bModal>, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdDialogResizeImpl - implementation of orientation resizing standard application dialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdDialogResizeImpl :\r
-               public CAppStdDialogImplBase<T, CStdDialogResizeImpl<T, t_shidiFlags, t_bModal>, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-#ifndef _ATL_NO_HOSTING\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdAxDialogImpl - Implementation of standard application AxDialog \r
-\r
-template <class T, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdAxDialogImpl :\r
-               public CAppStdDialogImplBase<T, CStdAxDialogImpl<T, t_shidiFlags, t_bModal>, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdAxDialogResizeImpl - implementation of orientation resizing standard application AxDialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdAxDialogResizeImpl :\r
-               public CAppStdDialogImplBase<T, CStdAxDialogResizeImpl<T, t_shidiFlags, t_bModal>, t_shidiFlags, t_bModal>\r
-{};\r
-#endif // _ATL_NO_HOSTING\r
-\r
-#if defined(_WTL_CE_DRA) && defined(WIN32_PLATFORM_PSPC)\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdOrientedDialogImpl - implementation of oriented PPC standard application dialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdOrientedDialogImpl :\r
-               public CAppStdDialogImplBase<T, CStdOrientedDialogImpl<T, t_shidiFlags, t_bModal>, t_shidiFlags, t_bModal>\r
-{};\r
-\r
-#ifndef _ATL_NO_HOSTING\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CAppStdAxOrientedDialogImpl - implementation of oriented PPC standard application AxDialog\r
-\r
-template <class T, UINT t_shidiFlags = WTL_APP_SHIDIF, bool t_bModal = false>\r
-class ATL_NO_VTABLE CAppStdAxOrientedDialogImpl :\r
-               public CAppStdDialogImplBase<T, CStdAxOrientedDialogImpl<T, t_shidiFlags, t_bModal>, t_shidiFlags, t_bModal>\r
-{};\r
-#endif // _ATL_NO_HOSTING\r
-\r
-#endif // defined(_WTL_CE_DRA) && defined(WIN32_PLATFORM_PSPC)\r
-\r
-#endif // _WTL_CE_NO_DIALOGS\r
-\r
-#endif // _WTL_CE_NO_APPWINDOW\r
-\r
-\r
-// --- Full screen support ---\r
-\r
-#ifndef _WTL_CE_NO_FULLSCREEN\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CFullScreenFrame - full screen frame implementation\r
-\r
-template <class T, bool t_bHasSip = true>\r
-class CFullScreenFrame\r
-{\r
-public:\r
-       bool m_bFullScreen;\r
-\r
-       CFullScreenFrame() : m_bFullScreen(false)\r
-       { }\r
-\r
-// Operation   \r
-       void SetFullScreen(bool bFull)\r
-       {\r
-               m_bFullScreen = bFull;\r
-               ShowTaskBar(!bFull, false);\r
-               ShowMenuBar(!bFull);\r
-       }\r
-\r
-// Manage TaskBar for modal dialogs and property sheets\r
-       template <class D>\r
-       int FSDoModal(D& dlg)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               pT;   // avoid level 4 warning\r
-               ATLASSERT(pT->IsWindow());\r
-               if (m_bFullScreen)   // Show taskbar if hidden\r
-                       ShowTaskBar(true, false);\r
-               int iRet = dlg.DoModal();\r
-               if (m_bFullScreen)   // Hide taskbar if restored\r
-                       ShowTaskBar(false);\r
-               return iRet;\r
-       }\r
-\r
-// Implementation\r
-       void ShowMenuBar(bool bShow)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               ATL::CWindow MenuBar = pT->m_hWndCECommandBar;\r
-               ATLASSERT(MenuBar.IsWindow());\r
-               MenuBar.ShowWindow(bShow ? SW_SHOWNORMAL : SW_HIDE);\r
-               pT->SizeToMenuBar();\r
-       }\r
-       \r
-       void ShowTaskBar(bool bShow, bool bRepaint = true)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(pT->IsWindow());\r
-               RECT rect = { 0 };\r
-               SystemParametersInfo(SPI_GETWORKAREA, NULL, &rect, FALSE);\r
-               if (!bShow)\r
-                       rect.top = 0;\r
-\r
-#ifdef WIN32_PLATFORM_PSPC // Pocket PC code\r
-               UINT uShow = t_bHasSip ? SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON : SHFS_SHOWTASKBAR | SHFS_HIDESIPBUTTON;         \r
-               SHFullScreen(pT->m_hWnd, bShow ? uShow : SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);\r
-#elif _WIN32_WCE > 0x500 // Smartphone 2005 code\r
-               SHFullScreen(pT->m_hWnd, bShow ? SHFS_SHOWTASKBAR : SHFS_HIDETASKBAR);\r
-#else // Smartphone 2003\r
-               HWND hTaskBar = FindWindow(_T("tray"), NULL);\r
-               ATLASSERT(::IsWindow(hTaskBar));\r
-               ::ShowWindow(hTaskBar, bShow ? SW_SHOW : SW_HIDE);\r
-#endif // WIN32_PLATFORM_PSPC\r
-\r
-               pT->MoveWindow(&rect, bRepaint);\r
-       }\r
-\r
-// Message map and handler\r
-       BEGIN_MSG_MAP(CFullScreenFrame)\r
-               MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)\r
-               MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)\r
-       END_MSG_MAP()\r
-\r
-       LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-#ifndef SETTINGCHANGE_RESET // not defined for PPC 2002\r
-       #define SETTINGCHANGE_RESET SPI_SETWORKAREA\r
-#endif\r
-               if (m_bFullScreen && (wParam & SETTINGCHANGE_RESET))\r
-                       SetFullScreen(m_bFullScreen);\r
-               return bHandled = FALSE;\r
-       }\r
-\r
-       LRESULT OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               if (m_bFullScreen)\r
-               {\r
-                       ShowTaskBar(!wParam);\r
-                       ShowMenuBar(!wParam);\r
-               }\r
-               return bHandled = FALSE;\r
-       }\r
-};\r
-\r
-#endif // _WTL_CE_NO_FULLSCREEN\r
-\r
-\r
-// --- WinCE zoom support ---\r
-\r
-#ifndef _WTL_CE_NO_ZOOMSCROLL\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CZoomScrollImpl - WinCE zooming implementation on top of CScrollImpl\r
-\r
-template <class T>\r
-class  CZoomScrollImpl: public CScrollImpl< T >\r
-{\r
-public:\r
-// Data members\r
-       _WTYPES_NS::CSize m_sizeTrue;\r
-       double  m_fzoom;\r
-\r
-// Creation\r
-       CZoomScrollImpl() : m_sizeTrue(0), m_fzoom(1.)\r
-       { }\r
-\r
-// Zoom operations and access\r
-       void SetZoomScrollSize(_WTYPES_NS::CSize sizeTrue, double fzoom = 1., BOOL bRedraw = TRUE)\r
-       {\r
-               ATLASSERT(fzoom > 0.);\r
-               m_sizeTrue = sizeTrue;\r
-               m_fzoom = fzoom;\r
-\r
-               CScrollImpl< T >::SetScrollSize(sizeTrue / fzoom, bRedraw);\r
-       }\r
-\r
-       void SetZoomScrollSize(int cx, int cy, double fzoom=1., BOOL bRedraw = TRUE)\r
-       {\r
-               SetZoomScrollSize(_WTYPES_NS::CSize(cx, cy), fzoom, bRedraw);\r
-       }\r
-\r
-       void SetZoom(double fzoom, BOOL bRedraw = TRUE)\r
-       {\r
-               _WTYPES_NS::CPoint ptCenter = WndtoTrue(m_sizeClient / 2);\r
-               _WTYPES_NS::CSize sizePage = GetScrollPage();\r
-               _WTYPES_NS::CSize sizeLine = GetScrollLine();\r
-\r
-               SetZoomScrollSize(GetScrollSize(), fzoom, bRedraw);\r
-\r
-               SetScrollLine(sizeLine);\r
-               SetScrollPage(sizePage);\r
-               _WTYPES_NS::CPoint ptOffset = ptCenter - (m_sizeClient / 2) * fzoom;\r
-               SetScrollOffset(ptOffset, bRedraw);\r
-       }\r
-\r
-       double GetZoom()\r
-       {\r
-               return m_fzoom;\r
-       }\r
-\r
-// CScrollImpl overrides\r
-       void SetScrollOffset(int x, int y, BOOL bRedraw = TRUE)\r
-       {\r
-               CScrollImpl< T >::SetScrollOffset((int)(x / m_fzoom), (int)(y / m_fzoom), bRedraw);\r
-       }\r
-\r
-       void SetScrollOffset(POINT ptOffset, BOOL bRedraw = TRUE)\r
-       {\r
-               SetScrollOffset(ptOffset.x, ptOffset.y, bRedraw);\r
-       }\r
-\r
-       void GetScrollOffset(POINT& ptOffset)\r
-       {\r
-               ptOffset.x = (LONG)(m_ptOffset.x * m_fzoom);\r
-               ptOffset.y = (LONG)(m_ptOffset.y * m_fzoom);\r
-       }\r
-\r
-       void SetScrollSize(int cx, int cy, BOOL bRedraw = TRUE)\r
-       {\r
-               SetZoomScrollSize(cx, cy, GetZoom(), bRedraw);\r
-       }\r
-\r
-       void SetScrollSize(SIZE sizeTrue, BOOL bRedraw = TRUE)\r
-       {\r
-               SetZoomScrollSize(sizeTrue, GetZoom(), bRedraw);\r
-       }\r
-\r
-       void GetScrollSize(SIZE& sizeTrue) const\r
-       {\r
-               sizeTrue = m_sizeTrue;\r
-       }\r
-\r
-       void SetScrollPage(int cxPage, int cyPage)\r
-       {\r
-               SetScrollPage(_WTYPES_NS::CSize(cxPage, cyPage));\r
-       }\r
-\r
-       void SetScrollPage(SIZE sizePage)\r
-       {\r
-               CScrollImpl< T >::SetScrollPage(sizePage / m_fzoom);\r
-       }\r
-\r
-       void GetScrollPage(SIZE& sizePage) const\r
-       {\r
-               sizePage = m_sizePage * m_fzoom;\r
-       }\r
-\r
-       void SetScrollLine(int cxLine, int cyLine)\r
-       {\r
-               SetScrollLine(_WTYPES_NS::CSize(cxLine, cyLine));\r
-       }\r
-\r
-       void SetScrollLine(SIZE sizeLine)\r
-       {\r
-               CScrollImpl< T >::SetScrollLine(sizeLine / m_fzoom);\r
-       }\r
-\r
-       void GetScrollLine(SIZE& sizeLine) const\r
-       {\r
-               sizeLine = m_sizeLine * m_fzoom;\r
-       }\r
-\r
-// Data access complements\r
-       _WTYPES_NS::CSize GetScrollSize()\r
-       {\r
-               return m_sizeTrue;\r
-       }\r
-\r
-       _WTYPES_NS::CSize GetScrollPage()\r
-       {\r
-               return m_sizePage * m_fzoom;\r
-       }\r
-\r
-       _WTYPES_NS::CSize GetScrollLine()\r
-       {\r
-               return m_sizeLine * m_fzoom;\r
-       }\r
-\r
-       _WTYPES_NS::CPoint GetScrollOffset()\r
-       {\r
-               return (_WTYPES_NS::CSize)m_ptOffset * m_fzoom;\r
-       }\r
-\r
-// Helper coordinate functions\r
-       _WTYPES_NS::CPoint WndtoTrue(CPoint ptW)\r
-       {\r
-               return (_WTYPES_NS::CSize)ptW * GetZoom() + GetScrollOffset();\r
-       }\r
-\r
-       void WndtoTrue(LPPOINT aptW, int nPts)   // in place coord transformation\r
-       {\r
-               for (int i = 0 ; i < nPts ; i++)\r
-                       aptW[i] = WndtoTrue(aptW[i]);\r
-       }\r
-\r
-       void WndtoTrue(LPRECT prectW)   // in place coord transformation\r
-       {\r
-               WndtoTrue((LPPOINT)prectW, 2);\r
-       }\r
-\r
-       _WTYPES_NS::CPoint TruetoWnd(CPoint ptT)\r
-       {\r
-               return (ptT - GetScrollOffset()) / GetZoom();\r
-       }\r
-\r
-       void TruetoWnd(LPPOINT aptT, int nPts)   // in place coord transformation\r
-       {\r
-               for (int i = 0 ; i < nPts ; i++)\r
-                       aptT[i] = TruetoWnd(aptT[i]);\r
-       }\r
-\r
-       void TruetoWnd(LPRECT prectT)   // in place coord transformation\r
-       {\r
-               TruetoWnd((LPPOINT)prectT, 2);\r
-       }\r
-\r
-// Drawing operations : assume adequate setting of data members\r
-       BOOL Draw(HBITMAP hbm, HDC hdestDC, DWORD dwROP = SRCCOPY)\r
-       {\r
-               CDC memDC = CreateCompatibleDC(hdestDC);\r
-               CBitmapHandle bmpOld = memDC.SelectBitmap(hbm);\r
-               BOOL bRes = Draw(memDC, hdestDC, dwROP);\r
-               memDC.SelectBitmap(bmpOld);\r
-               return bRes;\r
-       }\r
-\r
-       BOOL Draw(HDC hsourceDC, HDC hdestDC, DWORD dwROP = SRCCOPY)\r
-       {\r
-               CDCHandle destDC = hdestDC;\r
-               destDC.SetViewportOrg(0,0);\r
-               _WTYPES_NS::CPoint ptOffset = GetScrollOffset();\r
-               _WTYPES_NS::CSize sizeZClient = m_sizeClient * GetZoom();\r
-               return destDC.StretchBlt(0, 0, m_sizeClient.cx, m_sizeClient.cy, hsourceDC, ptOffset.x, ptOffset.y, sizeZClient.cx, sizeZClient.cy, dwROP);\r
-       }\r
-\r
-#ifdef _IMAGING_H\r
-       BOOL Draw(IImage* pIImage, HDC hdestDC)\r
-       {\r
-               CDCHandle destDC = hdestDC;\r
-               destDC.SetViewportOrg(0,0);\r
-               return SUCCEEDED(pIImage->Draw(destDC, _WTYPES_NS::CRect(-_WTYPES_NS::CPoint(m_ptOffset), m_sizeAll), NULL));\r
-       }\r
-#endif\r
-\r
-// Message map and handlers\r
-       BEGIN_MSG_MAP(CZoomScrollImpl< T >)\r
-               MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)\r
-               CHAIN_MSG_MAP(CScrollImpl< T >)\r
-       END_MSG_MAP()\r
-       \r
-       LRESULT OnEraseBkgnd(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)\r
-       {\r
-               T* pT = static_cast<T*>(this);\r
-               ATLASSERT(::IsWindow(pT->m_hWnd));\r
-               if ((GetScrollExtendedStyle() & SCRL_ERASEBACKGROUND))\r
-               {\r
-                       _WTYPES_NS::CRect rect;\r
-                       pT->GetClientRect(rect);\r
-                       _WTYPES_NS::CSize sizeClient=rect.Size();\r
-\r
-                       if (m_sizeAll.cx < sizeClient.cx || m_sizeAll.cy < sizeClient.cy)\r
-                       {\r
-                               CDCHandle hdc = (HDC)wParam;\r
-                               HBRUSH hbr = GetSysColorBrush((int)T::GetWndClassInfo().m_wc.hbrBackground - 1);\r
-\r
-                               if (m_sizeAll.cx < sizeClient.cx)\r
-                               {\r
-                                       _WTYPES_NS::CRect rectBG(_WTYPES_NS::CPoint(m_sizeAll.cx, 0), sizeClient);\r
-                                       hdc.FillRect(rectBG, hbr);\r
-                               }\r
-\r
-                               if (m_sizeAll.cy < sizeClient.cy)\r
-                               {\r
-                                       _WTYPES_NS::CRect rectBG(_WTYPES_NS::CPoint(0, m_sizeAll.cy), sizeClient);\r
-                                       hdc.FillRect(rectBG, hbr);\r
-                               }\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       bHandled = FALSE;\r
-               }\r
-\r
-               return 1;\r
-       }\r
-};\r
-\r
-#endif // _WTL_CE_NO_ZOOMSCROLL\r
-\r
-#ifndef _WTL_CE_NO_CONTROLS\r
-\r
-// --- PPC bottom TabView control ---\r
-\r
-#if defined(__ATLCTRLX_H__) && defined(WIN32_PLATFORM_PSPC)\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CBottomTabViewImpl\r
-\r
-template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>\r
-class ATL_NO_VTABLE CBottomTabViewImpl : public CTabViewImpl<T, TBase, TWinTraits>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(NULL, 0, COLOR_APPWORKSPACE)\r
-\r
-// Implementation overrideables\r
-       bool CreateTabControl()\r
-       {\r
-               m_tab.Create(m_hWnd, rcDefault, NULL, WS_CHILD | TCS_BOTTOM, 0, m_nTabID);\r
-\r
-               ATLASSERT(m_tab.m_hWnd != NULL);\r
-               if(m_tab.m_hWnd == NULL)\r
-                       return false;\r
-\r
-               m_tab.SendMessage(CCM_SETVERSION, COMCTL32_VERSION);\r
-               m_tab.SetItemExtra(sizeof(TABVIEWPAGE));\r
-\r
-               T* pT = static_cast<T*>(this);\r
-               m_cyTabHeight = pT->CalcTabHeight();\r
-\r
-               return true;\r
-       }\r
-\r
-       int CalcTabHeight()\r
-       {\r
-               int nCount = m_tab.GetItemCount();\r
-               TCITEMEXTRA tcix = { 0 };\r
-               tcix.tciheader.mask = TCIF_TEXT;\r
-               tcix.tciheader.pszText = _T("NS");\r
-               int nIndex = m_tab.InsertItem(nCount, tcix);\r
-\r
-               RECT rect = { 0 };\r
-               SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);\r
-               RECT rcWnd = rect;\r
-\r
-               m_tab.AdjustRect(FALSE, &rect);\r
-               rcWnd.top = rect.bottom;\r
-               ::AdjustWindowRectEx(&rcWnd, m_tab.GetStyle(), FALSE, m_tab.GetExStyle());\r
-               m_tab.DeleteItem(nIndex);\r
-\r
-               return rcWnd.bottom - rcWnd.top;\r
-       }\r
-\r
-       void UpdateLayout()\r
-       {\r
-               RECT rect;\r
-               GetClientRect(&rect);\r
-\r
-               if(m_tab.IsWindow() && ((m_tab.GetStyle() & WS_VISIBLE) != 0))\r
-                       m_tab.SetWindowPos(NULL, 0, rect.bottom - m_cyTabHeight, rect.right - rect.left, m_cyTabHeight, SWP_NOZORDER /*| SWP_SHOWWINDOW*/);\r
-\r
-               if(m_nActivePage != -1)\r
-                               ::SetWindowPos(GetPageHWND(m_nActivePage), NULL, 0, 0, rect.right - rect.left, rect.bottom - m_cyTabHeight, SWP_NOZORDER);\r
-       }\r
-\r
-};\r
-\r
-class CBottomTabView : public CBottomTabViewImpl<CBottomTabView>\r
-{\r
-public:\r
-       DECLARE_WND_CLASS_EX(_T("WTL_BottomTabView"), 0, COLOR_APPWORKSPACE)\r
-};\r
-\r
-#endif // defined(__ATLCTRLX_H__) && defined(WIN32_PLATFORM_PSPC)\r
-\r
-\r
-// --- PPC/SmartPhone controls ---\r
-\r
-////////////////////////////////////////////////////////////////////////////////\r
-// These are wrapper classes for the Pocket PC 2002/2003 and SmartPhone 2003 controls\r
-// To implement a window based on a control, use following:\r
-// Example: Implementing a window based on a Html control\r
-//\r
-// class CMyHtml : CWindowImpl<CMyHtml, CHtmlCtrl>\r
-// {\r
-// public:\r
-//      BEGIN_MSG_MAP(CMyHtml)\r
-//          // put your message handler entries here\r
-//      END_MSG_MAP()\r
-// };\r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CHtmlCtrl\r
-\r
-template <class TBase>\r
-class CHtmlCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CHtmlCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CHtmlCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               ATLASSERT(hWnd != NULL);   // Did you remember to call InitHTMLControl(hInstance) ??\r
-               return hWnd;\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_HTML;\r
-       }\r
-\r
-#if (_WIN32_WCE >= 400)\r
-       void AddStyle(LPCWSTR pszStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ADDSTYLE, 0, (LPARAM)pszStyle);\r
-       }\r
-#endif // (_WIN32_WCE >= 400)\r
-\r
-       void AddText(BOOL bPlainText, LPCSTR pszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ADDTEXT, (WPARAM)bPlainText, (LPARAM)pszText);\r
-       }\r
-\r
-       void AddHTML(LPCSTR pszHTML)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ADDTEXT, (WPARAM)FALSE, (LPARAM)pszHTML);\r
-       }\r
-\r
-       void AddText(BOOL bPlainText, LPCWSTR pszText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ADDTEXTW, (WPARAM)bPlainText, (LPARAM)pszText);\r
-       }\r
-\r
-       void AddHTML(LPCWSTR pszHTML)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ADDTEXTW, (WPARAM)FALSE, (LPARAM)pszHTML);\r
-       }\r
-\r
-       void Anchor(LPCSTR pszAnchor)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ANCHOR, 0, (LPARAM)pszAnchor);\r
-       }\r
-\r
-       void Anchor(LPCWSTR pszAnchor)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ANCHORW, 0, (LPARAM)pszAnchor);\r
-       }\r
-\r
-#if (_WIN32_WCE >= 420)\r
-       void GetBrowserDispatch(IDispatch** ppDispatch)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(ppDispatch);\r
-               ATLASSERT(*ppDispatch==NULL);\r
-               ::SendMessage(m_hWnd, DTM_BROWSERDISPATCH, 0, (LPARAM)ppDispatch);\r
-       }\r
-       void GetDocumentDispatch(IDispatch** ppDispatch)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(ppDispatch);\r
-               ATLASSERT(*ppDispatch==NULL);\r
-               ::SendMessage(m_hWnd, DTM_DOCUMENTDISPATCH , 0, (LPARAM)ppDispatch);\r
-       }\r
-#endif // (_WIN32_WCE >= 420)\r
-\r
-       void Clear()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_CLEAR, 0, 0L);\r
-       }\r
-\r
-       void EnableClearType(BOOL bEnable = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ENABLECLEARTYPE, 0, (LPARAM)bEnable);\r
-       }\r
-\r
-       void EnableContextMenu(BOOL bEnable = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ENABLECONTEXTMENU, 0, (LPARAM)bEnable);\r
-       }\r
-\r
-       void EnableScripting(BOOL bEnable = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ENABLESCRIPTING, 0, (LPARAM)bEnable);\r
-       }\r
-\r
-       void EnableShrink(BOOL bEnable = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ENABLESHRINK, 0, (LPARAM)bEnable);\r
-       }\r
-\r
-       void EndOfSource()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ENDOFSOURCE, 0, 0L);\r
-       }\r
-\r
-       void ImageFail(DWORD dwCookie)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_IMAGEFAIL, 0, (LPARAM)dwCookie);\r
-       }\r
-\r
-       int GetLayoutHeight() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DTM_LAYOUTHEIGHT, 0, 0L);\r
-       }\r
-\r
-       int GetLayoutWidth() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DTM_LAYOUTWIDTH, 0, 0L);\r
-       }\r
-\r
-       void Navigate(LPCTSTR pstrURL, UINT uFlags = 0)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrURL);\r
-               ::SendMessage(m_hWnd, DTM_NAVIGATE, (WPARAM)uFlags, (LPARAM)pstrURL);\r
-       }\r
-\r
-       void SelectAll()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_SELECTALL, 0, 0L);\r
-       }\r
-\r
-       void SetImage(INLINEIMAGEINFO* pImageInfo)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pImageInfo);\r
-               ::SendMessage(m_hWnd, DTM_SETIMAGE, 0, (LPARAM)pImageInfo);\r
-       }\r
-\r
-       void ZoomLevel(int iLevel)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_ZOOMLEVEL, 0, (LPARAM)iLevel);\r
-       }\r
-\r
-#if (_WIN32_WCE >= 400)\r
-       void Stop()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DTM_STOP, 0, 0L);\r
-       }\r
-#endif // (_WIN32_WCE >= 400)\r
-\r
-       void GetScriptDispatch(IDispatch** ppDispatch)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(ppDispatch);\r
-               ATLASSERT(*ppDispatch==NULL);\r
-               ::SendMessage(m_hWnd, DTM_SCRIPTDISPATCH, 0, (LPARAM)ppDispatch);\r
-       }\r
-};\r
-\r
-typedef CHtmlCtrlT<ATL::CWindow> CHtmlCtrl;\r
-\r
-\r
-#ifdef WIN32_PLATFORM_PSPC\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CRichInkCtrl\r
-\r
-template <class TBase>\r
-class CRichInkCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CRichInkCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CRichInkCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               ATLASSERT(hWnd != NULL);   // Did you remember to call InitRichInkDLL() ??\r
-               return hWnd;\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_RICHINK;\r
-       }\r
-\r
-       BOOL CanPaste(UINT uFormat = 0) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANPASTE, (WPARAM)uFormat, 0L);\r
-       }\r
-\r
-       BOOL CanRedo() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANREDO, 0, 0L);\r
-       }\r
-\r
-       BOOL CanUndo() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0L);\r
-       }\r
-\r
-       void ClearAll(BOOL bRepaint = TRUE) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_CLEARALL, (WPARAM)bRepaint, 0L);\r
-       }\r
-\r
-       BOOL GetModify() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0L);\r
-       }\r
-\r
-       UINT GetPageStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETPAGESTYLE, 0, 0L);\r
-       }\r
-\r
-       UINT GetPenMode() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETPENMODE, 0, 0L);\r
-       }\r
-\r
-       UINT GetViewStyle() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETVIEW, 0, 0L);\r
-       }\r
-\r
-       UINT GetWrapMode() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETWRAPMODE, 0, 0L);\r
-       }\r
-\r
-       UINT GetZoomPercent() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_GETZOOMPERCENT, 0, 0L);\r
-       }\r
-\r
-       void InsertLinks(LPWSTR lpString, int cchLength = -1)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               if(cchLength == -1)\r
-                       cchLength = lstrlen(lpString);\r
-               ::SendMessage(m_hWnd, EM_INSERTLINKS, (WPARAM)cchLength, (LPARAM)lpString);\r
-       }\r
-\r
-       void RedoEvent()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_REDOEVENT, 0, 0L);\r
-       }\r
-\r
-       UINT SetInkLayer(UINT uLayer)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (UINT)::SendMessage(m_hWnd, EM_SETINKLAYER, (WPARAM)uLayer, 0L);\r
-       }\r
-\r
-       void SetPageStyle(UINT uStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETPAGESTYLE, (WPARAM)uStyle, 0L);\r
-       }\r
-\r
-       void SetPenMode(UINT uMode)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETPENMODE, (WPARAM)uMode, 0L);\r
-       }\r
-\r
-       void SetViewStyle(UINT uStyle)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETVIEW, (WPARAM)uStyle, 0L);\r
-       }\r
-\r
-       void SetViewAttributes(VIEWATTRIBUTES* pAttribs)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pAttribs);\r
-               ::SendMessage(m_hWnd, EM_SETVIEWATTRIBUTES, 0, (LPARAM)pAttribs);\r
-       }\r
-\r
-       void SetWrapMode(UINT uMode)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETWRAPMODE, (WPARAM)uMode, 0L);\r
-       }\r
-\r
-       void SetZoomPercent(UINT uPercent)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETZOOMPERCENT, (WPARAM)uPercent, 0L);\r
-       }\r
-\r
-       LONG StreamIn(UINT uFormat, EDITSTREAM& es)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_STREAMIN, (WPARAM)uFormat, (LPARAM)&es);\r
-       }\r
-\r
-       LONG StreamOut(UINT uFormat, EDITSTREAM& es)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (LONG)::SendMessage(m_hWnd, EM_STREAMOUT, (WPARAM)uFormat, (LPARAM)&es);\r
-       }\r
-\r
-       void UndoEvent()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_UNDOEVENT, 0, 0L);\r
-       }\r
-\r
-// Standard EM_xxx messages\r
-       DWORD GetSel() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (DWORD)::SendMessage(m_hWnd, EM_GETSEL, 0, 0L);\r
-       }\r
-\r
-       void GetSel(int& nStartChar, int& nEndChar) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_GETSEL, (WPARAM)&nStartChar, (LPARAM)&nEndChar);\r
-       }\r
-\r
-       void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM)bCanUndo, (LPARAM)lpszNewText);\r
-       }\r
-\r
-       void SetModify(BOOL bModified = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, EM_SETMODIFY, (WPARAM)bModified, 0L);\r
-       }\r
-\r
-       int GetTextLength() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, WM_GETTEXTLENGTH, 0, 0L);\r
-       }\r
-\r
-// Clipboard operations\r
-       void Clear()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CLEAR, 0, 0L);\r
-       }\r
-\r
-       void Copy()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_COPY, 0, 0L);\r
-       }\r
-\r
-       void Cut()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_CUT, 0, 0L);\r
-       }\r
-\r
-       void Paste()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, WM_PASTE, 0, 0L);\r
-       }\r
-};\r
-\r
-typedef CRichInkCtrlT<ATL::CWindow> CRichInkCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CInkXCtrl\r
-\r
-template <class TBase>\r
-class CInkXCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CInkXCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CInkXCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = TBase::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               ATLASSERT(hWnd != NULL);   // Did you remember to call InitInkX() ??\r
-               return hWnd;\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_INKX;\r
-       }\r
-\r
-       static UINT GetHotRecordingMessage()\r
-       {\r
-               return ::RegisterWindowMessage(szHotRecording);\r
-       }\r
-\r
-       void ClearAll()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IM_CLEARALL, 0, 0L);\r
-       }\r
-\r
-       int GetData(BYTE* lpBuffer, INT cbBuffer) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpBuffer);\r
-               return (int)::SendMessage(m_hWnd, IM_GETDATA, (WPARAM)cbBuffer, (LPARAM)lpBuffer);\r
-       }\r
-\r
-       int GetDataLen() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, IM_GETDATALEN, 0, 0L);\r
-       }\r
-\r
-       CRichInkCtrl GetRichInk() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HWND)::SendMessage(m_hWnd, IM_GETRICHINK, 0, 0L);\r
-       }\r
-\r
-       BOOL IsRecording() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, IM_RECORDING, 0, 0L);\r
-       }\r
-\r
-       void ReInit()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IM_REINIT, 0, 0L);\r
-       }\r
-\r
-       void SetData(const BYTE* lpInkData, INT cbInkData)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(lpInkData);\r
-               ::SendMessage(m_hWnd, IM_SETDATA, (WPARAM)cbInkData, (LPARAM)lpInkData);\r
-       }\r
-\r
-       void VoicePlay()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IM_VOICE_PLAY, 0, 0L);\r
-       }\r
-\r
-       BOOL IsVoicePlaying() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, IM_VOICE_PLAYING, 0, 0L);\r
-       }\r
-\r
-       BOOL VoiceRecord()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, IM_VOICE_RECORD, 0, 0L);\r
-       }\r
-\r
-       void VoiceStop()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IM_VOICE_STOP, 0, 0L);\r
-       }\r
-\r
-       void ShowVoiceBar(BOOL bShow = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, IM_VOICEBAR, (WPARAM)bShow, 0L);\r
-       }\r
-};\r
-\r
-typedef CInkXCtrlT<ATL::CWindow> CInkXCtrl;\r
-\r
-#endif // WIN32_PLATFORM_PSPC\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CVoiceRecorderCtrl\r
-\r
-template <class TBase>\r
-class CVoiceRecorderCtrlT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CVoiceRecorderCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CVoiceRecorderCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, const POINT pt, LPTSTR pstrFileName, UINT nID, DWORD dwStyle = 0)\r
-       {\r
-               ATLASSERT(pstrFileName != NULL);\r
-               CM_VOICE_RECORDER cmvr = { 0 };\r
-               cmvr.cb = sizeof(CM_VOICE_RECORDER);\r
-               cmvr.dwStyle = dwStyle;\r
-               cmvr.xPos = pt.x;\r
-               cmvr.yPos = pt.y;\r
-               cmvr.hwndParent = hWndParent;\r
-               cmvr.id = nID;\r
-               cmvr.lpszRecordFileName = pstrFileName;\r
-               m_hWnd = VoiceRecorder_Create(&cmvr);\r
-               return m_hWnd;\r
-       }\r
-\r
-       HWND Create(LPCM_VOICE_RECORDER pAttribs)\r
-       {\r
-               ATLASSERT(pAttribs);\r
-               m_hWnd = VoiceRecorder_Create(pAttribs);\r
-               return m_hWnd;\r
-       }\r
-\r
-// Attributes\r
-       void Record()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, VRM_RECORD, 0, 0L);\r
-       }\r
-\r
-       void Play()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, VRM_PLAY, 0, 0L);\r
-       }\r
-\r
-       void Stop()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, VRM_STOP, 0, 0L);\r
-       }\r
-\r
-       void Cancel()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, VRM_CANCEL, 0, 0L);\r
-       }\r
-\r
-       void Done()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, VRM_OK, 0, 0L);\r
-       }\r
-};\r
-\r
-typedef CVoiceRecorderCtrlT<ATL::CWindow> CVoiceRecorderCtrl;\r
-\r
-\r
-#ifdef WIN32_PLATFORM_PSPC\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CDocListCtrl\r
-\r
-template <class TBase>\r
-class CDocListCtrlT : public TBase\r
-{\r
-public:\r
-// Attributes\r
-       DOCLISTCREATE m_dlc;\r
-       TCHAR m_szPath[MAX_PATH];\r
-\r
-// Constructors\r
-       CDocListCtrlT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CDocListCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, WORD wId, LPCTSTR pszFolder = NULL, LPCTSTR pstrFilter = NULL,\r
-                       WORD wFilterIndex = 0, DWORD dwFlags = DLF_SHOWEXTENSION)\r
-       {\r
-               ATLASSERT(pstrFilter != NULL);   // It seems to need a filter badly!!\r
-               ::ZeroMemory(&m_dlc, sizeof(DOCLISTCREATE));\r
-               ::ZeroMemory(m_szPath, sizeof(m_szPath));\r
-               if(pszFolder != NULL)\r
-                       ::lstrcpyn(m_szPath, pszFolder, MAX_PATH - 1);\r
-               m_dlc.dwStructSize = sizeof(DOCLISTCREATE);\r
-               m_dlc.hwndParent = hWndParent;\r
-               m_dlc.pszFolder = m_szPath;\r
-               m_dlc.pstrFilter = pstrFilter;\r
-               m_dlc.wFilterIndex = wFilterIndex;\r
-               m_dlc.wId = wId;\r
-               m_dlc.dwFlags = dwFlags;\r
-               m_hWnd = DocList_Create(&m_dlc);\r
-               return m_hWnd;\r
-       }\r
-\r
-       HWND Create(DOCLISTCREATE* pDlc)\r
-       {\r
-               m_dlc = *pDlc;\r
-               m_hWnd = DocList_Create(&m_dlc);\r
-               return m_hWnd;\r
-       }\r
-\r
-// Attributes\r
-       void DeleteSel()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_DELETESEL, 0, 0L);\r
-       }\r
-\r
-       void DisableUpdates()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_DISABLEUPDATES, 0, 0L);\r
-       }\r
-\r
-       void EnableUpdates()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_ENABLEUPDATES, 0, 0L);\r
-       }\r
-\r
-       int GetFilterIndex() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DLM_GETFILTERINDEX, 0, 0L);\r
-       }\r
-\r
-       int GetItemCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DLM_GETITEMCOUNT, 0, 0L);\r
-       }\r
-\r
-       int GetNextItem(int iIndex, DWORD dwRelation = LVNI_ALL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DLM_GETNEXTITEM, (WPARAM)iIndex, (LPARAM)dwRelation);\r
-       }\r
-\r
-       int GetFirstItem(DWORD dwRelation = LVNI_ALL) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DLM_GETNEXTITEM, (WPARAM)-1, (LPARAM)dwRelation);\r
-       }\r
-\r
-       BOOL GetNextWave(int* pIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pIndex);\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_GETNEXTWAVE, 0, (LPARAM)pIndex);\r
-       }\r
-\r
-       BOOL GetPrevWave(int* pIndex) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pIndex);\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_GETPREVWAVE, 0, (LPARAM)pIndex);\r
-       }\r
-\r
-       int GetSelCount() const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DLM_GETSELCOUNT, 0, 0L);\r
-       }\r
-\r
-       BOOL GetSelPathName(LPTSTR pstrPath, int cchMax) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrPath);\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_GETSELPATHNAME, (WPARAM)cchMax, (LPARAM)pstrPath);\r
-       }\r
-\r
-       void ReceiveIR(LPCTSTR pstrPath) const\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrPath);\r
-               ::SendMessage(m_hWnd, DLM_RECEIVEIR, 0, (LPARAM)pstrPath);\r
-       }\r
-\r
-       void Refresh()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_REFRESH, 0, 0L);\r
-       }\r
-\r
-       BOOL RenameMoveSelectedItems()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_RENAMEMOVE, 0, 0L);\r
-       }\r
-\r
-       int SelectAll()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (int)::SendMessage(m_hWnd, DLM_SELECTALL, 0, 0L);\r
-       }\r
-\r
-       HRESULT SelectItem(LPCTSTR pstrPath, BOOL bVisible = TRUE)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrPath);\r
-               return (HRESULT)::SendMessage(m_hWnd, DLM_SELECTITEM, (WPARAM)bVisible, (LPARAM)pstrPath);\r
-       }\r
-\r
-       void SendEMail(LPCTSTR pstrAttachment)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_SENDEMAIL, 0, (LPARAM)pstrAttachment);\r
-       }\r
-\r
-       void SendIR(LPCTSTR pstrPath)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_SENDIR, 0, (LPARAM)pstrPath);\r
-       }\r
-\r
-       HRESULT SetFilterIndex(int iIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HRESULT)::SendMessage(m_hWnd, DLM_SETFILTERINDEX, (WPARAM)iIndex, 0L);\r
-       }\r
-\r
-       void SetFolder(LPCTSTR pstrPath)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrPath);\r
-               ::SendMessage(m_hWnd, DLM_SETFOLDER, 0, (LPARAM)pstrPath);\r
-       }\r
-\r
-       BOOL SetItemState(int iIndex, const LVITEM* pItem)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pItem);\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_SETITEMSTATE, (WPARAM)iIndex, (LPARAM)pItem);\r
-       }\r
-\r
-       BOOL SetItemState(int iIndex, UINT uState, UINT uMask)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               LV_ITEM lvi = { 0 };\r
-               lvi.stateMask = uMask;\r
-               lvi.state = uState;\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_SETITEMSTATE, (WPARAM)iIndex, (LPARAM)&lvi);\r
-       }\r
-\r
-       void SetOneItem(int iIndex, LPCVOID pPA)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_SETONEITEM, (WPARAM)iIndex, (LPARAM)pPA);\r
-       }\r
-\r
-       void SetSelect(int iIndex)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ::SendMessage(m_hWnd, DLM_SETSELECT, (WPARAM)iIndex, 0L);\r
-       }\r
-\r
-       void SetSelPathName(LPCTSTR pstrPath)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrPath);\r
-               ::SendMessage(m_hWnd, DLM_SETSELPATHNAME, 0, (LPARAM)pstrPath);\r
-       }\r
-\r
-       BOOL SetSortOrder()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_SETSORTORDER, 0, 0L);\r
-       }\r
-\r
-       HRESULT Update()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (HRESULT)::SendMessage(m_hWnd, DLM_UPDATE, 0, 0L);\r
-       }\r
-\r
-       BOOL ValidateFolder()\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return (BOOL)::SendMessage(m_hWnd, DLM_VALIDATEFOLDER, 0, 0L);\r
-       }\r
-\r
-// Functions\r
-       BOOL GetFirstSelectedWaveFile(int* pIndex, LPTSTR szPath, const size_t cchPath)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return DocList_GetFirstSelectedWaveFile(m_hWnd, pIndex, szPath, cchPath);\r
-       }\r
-\r
-       BOOL GetNextSelectedWaveFile(int* pIndex, LPTSTR szPath, const size_t cchPath)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               return DocList_GetNextSelectedWaveFile(m_hWnd, pIndex, szPath, cchPath);\r
-       }\r
-};\r
-\r
-typedef CDocListCtrlT<ATL::CWindow> CDocListCtrl;\r
-\r
-#endif // WIN32_PLATFORM_PSPC\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CCapEdit\r
-\r
-template <class TBase>\r
-class CCapEditT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CCapEditT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CCapEditT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = /*TBase*/CWindow::Create(GetWndClassName(), hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               ATLASSERT(hWnd != NULL);   // Did you remember to call SHInitExtraControls() ??\r
-               return hWnd;\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_CAPEDIT;\r
-       }\r
-};\r
-\r
-typedef CCapEditT<WTL::CEdit> CCapEdit;\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTTStatic\r
-\r
-#ifndef WIN32_PLATFORM_WFSP // Tooltips not supported on SmartPhone\r
-\r
-template <class TBase>\r
-class CTTStaticT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CTTStaticT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CTTStaticT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = TBase::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               ATLASSERT(hWnd != NULL);   // Did you remember to call SHInitExtraControls() ??\r
-               return hWnd;\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_TSTATIC;\r
-       }\r
-\r
-// Operations\r
-       BOOL SetToolTipText(LPCTSTR pstrTipText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrTipText);\r
-               ATLASSERT(lstrlen(pstrTipText)<= 253);\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR pstr = buff.Allocate(lstrlen(pstrTipText) + 3);\r
-               if(pstr == NULL)\r
-                       return FALSE;\r
-               ::lstrcpy(pstr, _T("~~"));\r
-               ::lstrcat(pstr, pstrTipText);\r
-               return SetWindowText(pstr);\r
-       }\r
-};\r
-\r
-typedef CTTStaticT<WTL::CStatic> CTTStatic;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CTTButton\r
-\r
-template <class TBase>\r
-class CTTButtonT : public TBase\r
-{\r
-public:\r
-// Constructors\r
-       CTTButtonT(HWND hWnd = NULL) : TBase(hWnd)\r
-       { }\r
-\r
-       CTTButtonT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szWindowName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-               HWND hWnd = TBase::Create(hWndParent, rect.m_lpRect, szWindowName, dwStyle, dwExStyle, MenuOrID.m_hMenu, lpCreateParam);\r
-               ATLASSERT(hWnd != NULL);   // Did you remember to call SHInitExtraControls() ??\r
-               return hWnd;\r
-       }\r
-\r
-// Attributes\r
-       static LPCTSTR GetWndClassName()\r
-       {\r
-               return WC_TBUTTON;\r
-       }\r
-\r
-// Operations\r
-       BOOL SetToolTipText(LPCTSTR pstrTipText)\r
-       {\r
-               ATLASSERT(::IsWindow(m_hWnd));\r
-               ATLASSERT(pstrTipText);\r
-               ATLASSERT(lstrlen(pstrTipText)<= 253);\r
-               CTempBuffer<TCHAR, _WTL_STACK_ALLOC_THRESHOLD> buff;\r
-               LPTSTR pstr = buff.Allocate(lstrlen(pstrTipText) + 3);\r
-               if(pstr == NULL)\r
-                       return FALSE;\r
-               ::lstrcpy(pstr, _T("~~"));\r
-               ::lstrcat(pstr, pstrTipText);\r
-               return SetWindowText(pstr);\r
-       }\r
-};\r
-\r
-typedef CTTButtonT<WTL::CButton> CTTButton;\r
-\r
-#endif // !WIN32_PLATFORM_WFSP\r
-\r
-\r
-// --- SmartPhone specific controls ---\r
-\r
-#ifdef WIN32_PLATFORM_WFSP\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSpinCtrlT - CSpinCtrl : SmartPhone adapted UpDown control\r
-\r
-template <class TBase>\r
-class CSpinCtrlT : public CUpDownCtrlT< TBase >\r
-{\r
-public:\r
-// Constructors\r
-       CSpinCtrlT(HWND hWnd = NULL) : CUpDownCtrlT< TBase >(hWnd)\r
-       { }\r
-\r
-       CSpinCtrlT< TBase >& operator =(HWND hWnd)\r
-       {\r
-               m_hWnd = hWnd;\r
-               return *this;\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, HWND hBuddy, DWORD dwStyle, int nID, LPCTSTR szExpandedName = NULL)\r
-       {\r
-               ATLASSERT(::IsWindow(hWndParent));\r
-               CUpDownCtrlT< TBase >::Create(hWndParent, NULL, szExpandedName, dwStyle, 0, nID, NULL);\r
-               ATLASSERT(m_hWnd != NULL);   // Did you remember to call AtlInitCommonControls(ICC_UPDOWN_CLASS)?\r
-               if (hBuddy != NULL)\r
-               {\r
-                       ATLASSERT(::IsWindow(hBuddy));\r
-                       SetBuddy(hBuddy);\r
-               }\r
-               return m_hWnd;\r
-       }\r
-};\r
-\r
-typedef CSpinCtrlT<ATL::CWindow> CSpinCtrl;\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSpinned - SmartPhone association of control and Spin\r
-\r
-template <class TBase, bool t_bExpandOnly>\r
-class CSpinned : public TBase\r
-{\r
-public:\r
-       CSpinCtrl m_SpinCtrl;\r
-       DWORD m_dwSpinnedStyle;\r
-\r
-// Constructors\r
-       CSpinned(HWND hWnd = NULL) : TBase(hWnd)\r
-       {\r
-               m_dwSpinnedStyle = WS_VISIBLE | UDS_ALIGNRIGHT | UDS_EXPANDABLE;\r
-               \r
-               if (t_bExpandOnly == true)\r
-                       m_dwSpinnedStyle |= UDS_NOSCROLL;\r
-               else\r
-                       m_dwSpinnedStyle |= UDS_HORZ | UDS_ARROWKEYS | UDS_SETBUDDYINT | UDS_WRAP;\r
-\r
-               if (hWnd != NULL)\r
-                       AttachOrCreateSpinCtrl();\r
-       }\r
-\r
-       CSpinned<TBase, t_bExpandOnly>& operator =(HWND hWnd)\r
-       {\r
-               Attach(hWnd);\r
-               return *this;\r
-       }\r
-\r
-       void Attach(HWND hWnd)\r
-       {\r
-               ATLASSERT(!IsWindow());\r
-               TBase* pT = static_cast<TBase*>(this);\r
-               pT->m_hWnd = hWnd;\r
-               if (hWnd != NULL)\r
-                       AttachOrCreateSpinCtrl();\r
-       }\r
-\r
-       HWND Create(HWND hWndParent, ATL::_U_RECT rect = NULL, LPCTSTR szExpandedName = NULL,\r
-                       DWORD dwStyle = 0, DWORD dwExStyle = 0,\r
-                       ATL::_U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL)\r
-       {\r
-\r
-               TBase* pT = static_cast<TBase*>(this);\r
-               TBase::Create(hWndParent, rect, NULL, dwStyle, dwExStyle, MenuOrID, lpCreateParam);\r
-               ATLASSERT(pT->m_hWnd != NULL);\r
-\r
-               m_SpinCtrl.Create(hWndParent, pT->m_hWnd, m_dwSpinnedStyle, ATL_IDW_SPIN_ID + (int)MenuOrID.m_hMenu, szExpandedName);\r
-\r
-               ATLASSERT(m_SpinCtrl.m_hWnd != NULL);   // Did you remember to call AtlInitCommonControls(ICC_UPDOWN_CLASS)?\r
-\r
-               return pT->m_hWnd;\r
-       }\r
-\r
-// Attributes\r
-       CSpinCtrl& GetSpinCtrl()\r
-       {\r
-               return m_SpinCtrl;\r
-       }\r
-\r
-// Implementation\r
-       // Attach our existing SpinCtrl or create one\r
-       bool AttachOrCreateSpinCtrl()\r
-       {\r
-               TBase* pT = static_cast<TBase*>(this);\r
-\r
-               HWND hSpin = ::GetDlgItem(pT->GetParent(), ATL_IDW_SPIN_ID + pT->GetDlgCtrlID());\r
-\r
-               if (hSpin != NULL)\r
-               {\r
-                       m_SpinCtrl.Attach(hSpin);\r
-#ifdef DEBUG\r
-                       TCHAR sClassName[16];\r
-                       ::GetClassName(hSpin, sClassName, 16);\r
-                       ATLASSERT(!_tcscmp(sClassName, UPDOWN_CLASS));\r
-                       ATLASSERT(m_SpinCtrl.GetBuddy().m_hWnd == pT->m_hWnd);\r
-#endif // DEBUG\r
-               }\r
-               else\r
-               {\r
-                       m_SpinCtrl.Create(pT->GetParent(), pT->m_hWnd, m_dwSpinnedStyle, ATL_IDW_SPIN_ID + pT->GetDlgCtrlID());\r
-               }\r
-\r
-               return m_SpinCtrl.m_hWnd != NULL;\r
-       }\r
-};\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// CSpinListBox - SmartPhone spinned ListBox control\r
-// CExpandListBox - SmartPhone expandable ListBox control\r
-// CExpandEdit - SmartPhone expandable Edit control\r
-// CExpandCapEdit - SmartPhone expandable CapEdit control\r
-\r
-typedef CSpinned<CListBox, false>   CSpinListBox;\r
-typedef CSpinned<CListBox, true>    CExpandListBox;\r
-typedef CSpinned<CEdit, true>          CExpandEdit;\r
-typedef CSpinned<CCapEdit, true>    CExpandCapEdit;\r
-\r
-#endif // WIN32_PLATFORM_WFSP\r
-\r
-#endif // _WTL_CE_NO_CONTROLS\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLWINCE_H__\r
diff --git a/WTL80/include/atlwinx.h b/WTL80/include/atlwinx.h
deleted file mode 100644 (file)
index 9767fa1..0000000
+++ /dev/null
@@ -1,529 +0,0 @@
-// Windows Template Library - WTL version 8.0\r
-// Copyright (C) Microsoft Corporation. All rights reserved.\r
-//\r
-// This file is a part of the Windows Template Library.\r
-// The use and distribution terms for this software are covered by the\r
-// Common Public License 1.0 (http://opensource.org/osi3.0/licenses/cpl1.0.php)\r
-// which can be found in the file CPL.TXT at the root of this distribution.\r
-// By using this software in any fashion, you are agreeing to be bound by\r
-// the terms of this license. You must not remove this notice, or\r
-// any other, from this software.\r
-\r
-#ifndef __ATLWINX_H__\r
-#define __ATLWINX_H__\r
-\r
-#pragma once\r
-\r
-#ifndef __cplusplus\r
-       #error ATL requires C++ compilation (use a .cpp suffix)\r
-#endif\r
-\r
-#ifndef __ATLAPP_H__\r
-       #error atlwinx.h requires atlapp.h to be included first\r
-#endif\r
-\r
-#if (_ATL_VER >= 0x0700)\r
-  #include <atlwin.h>\r
-#endif // (_ATL_VER >= 0x0700)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Classes in this file:\r
-//\r
-// _U_RECT\r
-// _U_MENUorID\r
-// _U_STRINGorID\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Command Chaining Macros\r
-\r
-#define CHAIN_COMMANDS(theChainClass) \\r
-       if(uMsg == WM_COMMAND) \\r
-               CHAIN_MSG_MAP(theChainClass)\r
-\r
-#define CHAIN_COMMANDS_ALT(theChainClass, msgMapID) \\r
-       if(uMsg == WM_COMMAND) \\r
-               CHAIN_MSG_MAP_ALT(theChainClass, msgMapID)\r
-\r
-#define CHAIN_COMMANDS_MEMBER(theChainMember) \\r
-       if(uMsg == WM_COMMAND) \\r
-               CHAIN_MSG_MAP_MEMBER(theChainMember)\r
-\r
-#define CHAIN_COMMANDS_ALT_MEMBER(theChainMember, msgMapID) \\r
-       if(uMsg == WM_COMMAND) \\r
-               CHAIN_MSG_MAP_ALT_MEMBER(theChainMember, msgMapID)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Macros for parent message map to selectively reflect control messages\r
-\r
-// NOTE: ReflectNotifications is a member of ATL's CWindowImplRoot\r
-//  (and overridden in 2 cases - CContainedWindowT and CAxHostWindow)\r
-//  Since we can't modify ATL, we'll provide the needed additions\r
-//  in a separate function (that is not a member of CWindowImplRoot)\r
-\r
-namespace WTL\r
-{\r
-\r
-inline LRESULT WtlReflectNotificationsFiltered(HWND hWndParent, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled,\r
-                                               UINT uMsgFilter = WM_NULL, UINT_PTR idFromFilter = 0, HWND hWndChildFilter = NULL)\r
-{\r
-       if((uMsgFilter != WM_NULL) && (uMsgFilter != uMsg))\r
-       {\r
-               // The notification message doesn't match the filter.\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       HWND hWndChild = NULL;\r
-       UINT_PTR idFrom = 0;\r
-\r
-       switch(uMsg)\r
-       {\r
-       case WM_COMMAND:\r
-               if(lParam != NULL)      // not from a menu\r
-               {\r
-                       hWndChild = (HWND)lParam;\r
-                       idFrom = (UINT_PTR)LOWORD(wParam);\r
-               }\r
-               break;\r
-       case WM_NOTIFY:\r
-               hWndChild = ((LPNMHDR)lParam)->hwndFrom;\r
-               idFrom = ((LPNMHDR)lParam)->idFrom;\r
-               break;\r
-#ifndef _WIN32_WCE\r
-       case WM_PARENTNOTIFY:\r
-               switch(LOWORD(wParam))\r
-               {\r
-               case WM_CREATE:\r
-               case WM_DESTROY:\r
-                       hWndChild = (HWND)lParam;\r
-                       idFrom = (UINT_PTR)HIWORD(wParam);\r
-                       break;\r
-               default:\r
-                       hWndChild = ::GetDlgItem(hWndParent, HIWORD(wParam));\r
-                       idFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);\r
-                       break;\r
-               }\r
-               break;\r
-#endif // !_WIN32_WCE\r
-       case WM_DRAWITEM:\r
-               if(wParam)      // not from a menu\r
-               {\r
-                       hWndChild = ((LPDRAWITEMSTRUCT)lParam)->hwndItem;\r
-                       idFrom = (UINT_PTR)wParam;\r
-               }\r
-               break;\r
-       case WM_MEASUREITEM:\r
-               if(wParam)      // not from a menu\r
-               {\r
-                       hWndChild = ::GetDlgItem(hWndParent, ((LPMEASUREITEMSTRUCT)lParam)->CtlID);\r
-                       idFrom = (UINT_PTR)wParam;\r
-               }\r
-               break;\r
-       case WM_COMPAREITEM:\r
-               if(wParam)      // not from a menu\r
-               {\r
-                       hWndChild = ((LPCOMPAREITEMSTRUCT)lParam)->hwndItem;\r
-                       idFrom = (UINT_PTR)wParam;\r
-               }\r
-               break;\r
-       case WM_DELETEITEM:\r
-               if(wParam)      // not from a menu\r
-               {\r
-                       hWndChild = ((LPDELETEITEMSTRUCT)lParam)->hwndItem;\r
-                       idFrom = (UINT_PTR)wParam;\r
-               }\r
-               break;\r
-       case WM_VKEYTOITEM:\r
-       case WM_CHARTOITEM:\r
-       case WM_HSCROLL:\r
-       case WM_VSCROLL:\r
-               hWndChild = (HWND)lParam;\r
-               idFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);\r
-               break;\r
-       case WM_CTLCOLORBTN:\r
-       case WM_CTLCOLORDLG:\r
-       case WM_CTLCOLOREDIT:\r
-       case WM_CTLCOLORLISTBOX:\r
-       case WM_CTLCOLORMSGBOX:\r
-       case WM_CTLCOLORSCROLLBAR:\r
-       case WM_CTLCOLORSTATIC:\r
-               hWndChild = (HWND)lParam;\r
-               idFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);\r
-               break;\r
-       default:\r
-               break;\r
-       }\r
-\r
-       if((hWndChild == NULL) ||\r
-               ((hWndChildFilter != NULL) && (hWndChildFilter != hWndChild)))\r
-       {\r
-               // Either hWndChild isn't valid, or\r
-               // hWndChild doesn't match the filter.\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       if((idFromFilter != 0) && (idFromFilter != idFrom))\r
-       {\r
-               // The dialog control id doesn't match the filter.\r
-               bHandled = FALSE;\r
-               return 1;\r
-       }\r
-\r
-       ATLASSERT(::IsWindow(hWndChild));\r
-       LRESULT lResult = ::SendMessage(hWndChild, OCM__BASE + uMsg, wParam, lParam);\r
-       if((lResult == 0) && (uMsg >= WM_CTLCOLORMSGBOX) && (uMsg <= WM_CTLCOLORSTATIC))\r
-       {\r
-               // Try to prevent problems with WM_CTLCOLOR* messages when\r
-               // the message wasn't really handled\r
-               bHandled = FALSE;\r
-       }\r
-\r
-       return lResult;\r
-}\r
-\r
-}; // namespace WTL\r
-\r
-// Try to prevent problems with WM_CTLCOLOR* messages when\r
-// the message wasn't really handled\r
-#define REFLECT_NOTIFICATIONS_EX() \\r
-{ \\r
-       bHandled = TRUE; \\r
-       lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-       if((lResult == 0) && (uMsg >= WM_CTLCOLORMSGBOX) && (uMsg <= WM_CTLCOLORSTATIC)) \\r
-               bHandled = FALSE; \\r
-       if(bHandled) \\r
-               return TRUE; \\r
-}\r
-\r
-#define REFLECT_NOTIFICATIONS_MSG_FILTERED(uMsgFilter) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, 0, NULL); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFICATIONS_ID_FILTERED(idFromFilter) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, WM_NULL, idFromFilter, NULL); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFICATIONS_HWND_FILTERED(hWndChildFilter) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, WM_NULL, 0, hWndChildFilter); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFICATIONS_MSG_ID_FILTERED(uMsgFilter, idFromFilter) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, idFromFilter, NULL); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFICATIONS_MSG_HWND_FILTERED(uMsgFilter, hWndChildFilter) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, 0, hWndChildFilter); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_COMMAND(id, code) \\r
-       if(uMsg == WM_COMMAND && id == LOWORD(wParam) && code == HIWORD(wParam)) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_COMMAND_ID(id) \\r
-       if(uMsg == WM_COMMAND && id == LOWORD(wParam)) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_COMMAND_CODE(code) \\r
-       if(uMsg == WM_COMMAND && code == HIWORD(wParam)) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_COMMAND_RANGE(idFirst, idLast) \\r
-       if(uMsg == WM_COMMAND && LOWORD(wParam) >= idFirst  && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_COMMAND_RANGE_CODE(idFirst, idLast, code) \\r
-       if(uMsg == WM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst  && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFY(id, cd) \\r
-       if(uMsg == WM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom && cd == ((LPNMHDR)lParam)->code) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFY_ID(id) \\r
-       if(uMsg == WM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFY_CODE(cd) \\r
-       if(uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFY_RANGE(idFirst, idLast) \\r
-       if(uMsg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECT_NOTIFY_RANGE_CODE(idFirst, idLast, cd) \\r
-       if(uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Reflected message handler macros for message maps (for ATL 3.0)\r
-\r
-#if (_ATL_VER < 0x0700)\r
-\r
-#define REFLECTED_COMMAND_HANDLER(id, code, func) \\r
-       if(uMsg == OCM_COMMAND && id == LOWORD(wParam) && code == HIWORD(wParam)) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_COMMAND_ID_HANDLER(id, func) \\r
-       if(uMsg == OCM_COMMAND && id == LOWORD(wParam)) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_COMMAND_CODE_HANDLER(code, func) \\r
-       if(uMsg == OCM_COMMAND && code == HIWORD(wParam)) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_COMMAND_RANGE_HANDLER(idFirst, idLast, func) \\r
-       if(uMsg == OCM_COMMAND && LOWORD(wParam) >= idFirst  && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_COMMAND_RANGE_CODE_HANDLER(idFirst, idLast, code, func) \\r
-       if(uMsg == OCM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst  && LOWORD(wParam) <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_NOTIFY_HANDLER(id, cd, func) \\r
-       if(uMsg == OCM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom && cd == ((LPNMHDR)lParam)->code) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_NOTIFY_ID_HANDLER(id, func) \\r
-       if(uMsg == OCM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_NOTIFY_CODE_HANDLER(cd, func) \\r
-       if(uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_NOTIFY_RANGE_HANDLER(idFirst, idLast, func) \\r
-       if(uMsg == OCM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#define REFLECTED_NOTIFY_RANGE_CODE_HANDLER(idFirst, idLast, cd, func) \\r
-       if(uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-#endif // (_ATL_VER < 0x0700)\r
-\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Dual argument helper classes (for ATL 3.0)\r
-\r
-#if (_ATL_VER < 0x0700)\r
-\r
-namespace ATL\r
-{\r
-\r
-class _U_RECT\r
-{\r
-public:\r
-       _U_RECT(LPRECT lpRect) : m_lpRect(lpRect)\r
-       { }\r
-       _U_RECT(RECT& rc) : m_lpRect(&rc)\r
-       { }\r
-       LPRECT m_lpRect;\r
-};\r
-\r
-class _U_MENUorID\r
-{\r
-public:\r
-       _U_MENUorID(HMENU hMenu) : m_hMenu(hMenu)\r
-       { }\r
-       _U_MENUorID(UINT nID) : m_hMenu((HMENU)LongToHandle(nID))\r
-       { }\r
-       HMENU m_hMenu;\r
-};\r
-\r
-class _U_STRINGorID\r
-{\r
-public:\r
-       _U_STRINGorID(LPCTSTR lpString) : m_lpstr(lpString)\r
-       { }\r
-       _U_STRINGorID(UINT nID) : m_lpstr(MAKEINTRESOURCE(nID))\r
-       { }\r
-       LPCTSTR m_lpstr;\r
-};\r
-\r
-}; // namespace ATL\r
-\r
-#endif // (_ATL_VER < 0x0700)\r
-\r
-\r
-namespace WTL\r
-{\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// Forward notifications support for message maps (for ATL 3.0)\r
-\r
-#if (_ATL_VER < 0x0700)\r
-\r
-// forward notifications support\r
-#define FORWARD_NOTIFICATIONS() \\r
-       { \\r
-               bHandled = TRUE; \\r
-               lResult = WTL::Atl3ForwardNotifications(m_hWnd, uMsg, wParam, lParam, bHandled); \\r
-               if(bHandled) \\r
-                       return TRUE; \\r
-       }\r
-\r
-static LRESULT Atl3ForwardNotifications(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)\r
-{\r
-       LRESULT lResult = 0;\r
-       switch(uMsg)\r
-       {\r
-       case WM_COMMAND:\r
-       case WM_NOTIFY:\r
-#ifndef _WIN32_WCE\r
-       case WM_PARENTNOTIFY:\r
-#endif // !_WIN32_WCE\r
-       case WM_DRAWITEM:\r
-       case WM_MEASUREITEM:\r
-       case WM_COMPAREITEM:\r
-       case WM_DELETEITEM:\r
-       case WM_VKEYTOITEM:\r
-       case WM_CHARTOITEM:\r
-       case WM_HSCROLL:\r
-       case WM_VSCROLL:\r
-       case WM_CTLCOLORBTN:\r
-       case WM_CTLCOLORDLG:\r
-       case WM_CTLCOLOREDIT:\r
-       case WM_CTLCOLORLISTBOX:\r
-       case WM_CTLCOLORMSGBOX:\r
-       case WM_CTLCOLORSCROLLBAR:\r
-       case WM_CTLCOLORSTATIC:\r
-               lResult = ::SendMessage(::GetParent(hWnd), uMsg, wParam, lParam);\r
-               break;\r
-       default:\r
-               bHandled = FALSE;\r
-               break;\r
-       }\r
-       return lResult;\r
-}\r
-\r
-#endif // (_ATL_VER < 0x0700)\r
-\r
-}; // namespace WTL\r
-\r
-#endif // __ATLWINX_H__\r
diff --git a/WTL80/readme.htm b/WTL80/readme.htm
deleted file mode 100644 (file)
index f057233..0000000
+++ /dev/null
@@ -1,3339 +0,0 @@
-<html>\r
-\r
-<head>\r
-<meta http-equiv="Content-Language" content="en-us">\r
-<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
-<title>Windows Template Library</title>\r
-<style type="text/css">\r
-.style1 {\r
-       font-family: Arial;\r
-       font-weight: bold;\r
-       font-size: x-small;\r
-}\r
-.style2 {\r
-       font-family: Arial;\r
-       font-size: x-small;\r
-}\r
-.style3 {\r
-       text-align: right;\r
-}\r
-</style>\r
-</head>\r
-\r
-<body>\r
-\r
-<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber3">\r
-  <tr>\r
-    <td class="style3">\r
-       <p style="text-align: left"><font face="Arial"><b>Windows Template Library - WTL Version 8.0</b></font><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-       (build 7161) 6/10/07</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td><hr></td>\r
-  </tr>\r
-  <tr>\r
-    <td><font face="Arial" size="2">Copyright &#169; 2007 Microsoft Corporation.\r
-All rights reserved.</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td>&nbsp;</td>\r
-  </tr>\r
-  <tr>\r
-    <td><font face="Arial" size="2">This file is a part of the Windows Template \r
-       Library.<br>\r
-       The use and distribution terms for this software are covered by the<br>\r
-       Common Public License 1.0 (<a target="_blank" href="http://opensource.org/osi3.0/licenses/cpl1.0.php">http://opensource.org/osi3.0/licenses/cpl1.0.php</a>)<br>\r
-       which can be found in the file CPL.TXT at the root of this distribution.<br>\r
-       By using this software in any fashion, you are agreeing to be bound by<br>\r
-       the terms of this license. You must not remove this notice, or<br>\r
-       any other, from this software.</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td><hr></td>\r
-  </tr>\r
-</table>\r
-\r
-<p style=margin:0in>&nbsp;</p>\r
-\r
-<p style=margin:0in>&nbsp;</p>\r
-\r
-<p style=margin:0in><font face="Arial" size="2">Welcome to the Windows Template Library, version \r
-8.0. This document contains the following topics:</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<ul style="margin-top:0in;margin-bottom:0in">\r
-       <li><font face="Arial" size="2"><a href="#Introduction">Introduction</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Features And Installation">Features \r
-  And Installation</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Packing List">Packing List</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Class Overview">Class Overview</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#ATL/WTL AppWizard">ATL/WTL AppWizard</a></font></li>\r
-       <li><a href="#Support for Windows CE"><font face="Arial" size="2">S</font></a><font face="Arial" size="2"><a href="#Support for Windows CE">upport \r
-  for Windows CE</a></font></li>\r
-       <li><font face="Arial" size="2">\r
-       <a href="#Support for Visual C++ 2005 Express">Support for Visual C++ 2005 \r
-       Express</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Notes">Notes</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Changes Between WTL 8.0 And 7.5">Changes Between WTL \r
-       8.0 And 7.5</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Changes Between WTL 7.5 And 7.1">Changes Between WTL 7.5 And 7.1</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Changes Between WTL 7.1 And 7.0">Changes Between WTL \r
-  7.1 And 7.0</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Changes Between WTL 7.0 And 3.1">Changes Between WTL \r
-  7.0 And 3.1</a></font></li>\r
-       <li><font face="Arial" size="2"><a href="#Changes Between WTL 3.1 And 3.0">Changes Between WTL 3.1 And 3.0</a></font></li>\r
-</ul>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial">\r
-<b><a name="Introduction"></a>Introduction</b></font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Windows Template Library, or WTL, is a set of \r
-classes that extend ATL to support more complex user interfaces for either \r
-applications or various UI components, while maintaining the big advantage of \r
-ATL - small and fast code. WTL classes were designed to be the best and the \r
-easiest way to implement rich Win32 based UI for ATL based applications, \r
-servers, components, and controls.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">WTL provides support for implementing \r
-many \r
-user interface elements, from frame and popup windows, to MDI, standard and \r
-common controls, common dialogs, property sheets and pages, GDI objects, UI \r
-updating, scrollable windows, splitter windows, command bars, etc. The WTL \r
-classes are mostly templated and use minimal instance data and inline functions. \r
-They were not designed as a framework, so they do not force a particular \r
-application model, and can accommodate any. The classes do not use hooks or \r
-thread local storage, so they have no restrictions that those techniques impose. \r
-They also have no inter-dependencies and can be freely mixed with straight SDK \r
-code. In summary, WTL delivers very small and efficient code, very close in size \r
-and speed to SDK programs, while presenting a more logical, object oriented \r
-model to a programmer.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial">\r
-<b><a name="Features And Installation"></a>Features And Installation</b></font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">This is the sixth public release \r
-of WTL, after WTL 3.0, 3.1, 7.0, 7.1, and 7.5. It is also the second release of WTL \r
-under the Common Public License, enabling developers from the WTL community to \r
-contribute to the library.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">WTL classes can be used with either VC++ 6.0 and ATL 3.0, VC++ .NET \r
-2002 and ATL 7.0, VC++ .NET 2003 and ATL 7.1, VC++ 2005 with ATL 8.0, or EVC++ 4.0 or 3.0 with ATL for \r
-Windows CE. AppWizard for VC++ .NET 2002 and 2003, and Visual C++ 2005 is \r
-included.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">The WTL classes are provided in \r
-header files located in the include directory. The only header files that must \r
-be included is atlapp.h, while others can be used when needed. The name of the \r
-file doesn't mean that you have to create an application, just that \r
-atlapp.h contains base definitions required for WTL projects.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">To install WTL, just copy the whole directory \r
-structure, or unpack the archive file, to the location of your choice. Please be sure to\r
-<b>add the WTL\include \r
-directory</b> to the list of include directories in VC++, so that the compiler \r
-can find them when you include them in your projects..</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Setup programs for the AppWizard are provided. After executing the setup scripts, ATL/WTL AppWizard will appear in the list of AppWizards when you select File.New.Project \r
-in VC++ IDE. The file AppWiz\setup70.js is the setup script for VC++ .NET 2002, AppWiz\setup71.js is for VC++ \r
-.NET 2003, and AppWiz\setup80.js is for VC++ 2005. AppWizCE\setup80.js is setup \r
-script for VC++ 2005 SmartDevice projects.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">To manually install AppWizard \r
-for VC++ .NET 2002/2003, copy all WTLAppWiz.* files from AppWiz\Files to VC++ .NET \r
-projects directory, %VC7DIR%\Vc7\vcprojects, where %VC7DIR% is the directory \r
-where VC++ .NET 2002/2003 is installed. After that,&nbsp;open WTLAppWiz.vsz and modify the \r
-like that contains ABSOLUTE_PATH to contain %WTLDIR%\AppWiz\Files, where \r
-%WTLDIR% is the directory where WTL files are.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Platform support and \r
-requirements:</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Compiler/IDE/ATL:</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Visual C++ 6.0&nbsp;&nbsp; (ATL 3.0)</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Visual C++.NET 2002&nbsp;&nbsp; (ATL 7.0)</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Visual C++.NET 2003&nbsp;&nbsp; (ATL 7.1)</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Visual C++ 2005&nbsp;&nbsp; (ATL 8.0)</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; SDK \r
-(optional):</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Any Platform SDK from January 2000 release up to the latest Windows SDK</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Windows CE \r
-development:</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-eMbedded Visual C++ 3.0 - Pocket PC, Pocket PC 2002</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-eMbedded Visual C++ 4.0 - STANDARDSDK_410, Pocket PC 2003, Smartphone 2003,\r
-</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-STANDARDSDK_500, Pocket PC 2003 SE, Smartphone 2003 SE</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Visual C++ 2005 - Pocket PC 2003 SE, Smartphone 2003 SE, STANDARDSDK_500,</font></p>\r
-<p style=margin:0in><span class="style2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-</span><font face="Arial" size="2">Windows Mobile 5.0 (Pocket PC and Smartphone),<br>\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
-Windows Mobile 6.0 (Standard and Professional)</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial">\r
-<b><a name="Packing List"></a>Packing List</b></font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="497" id="AutoNumber2">\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">File Name</font><font face="Arial">:</font></td>\r
-    <td width="358"><font face="Arial" size="2">Description:</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2"><hr></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">readme.htm</font></td>\r
-    <td width="358"><font face="Arial" size="2">this file</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">CPL.TXT</font></td>\r
-    <td width="358"><font face="Arial" size="2">Common Public License</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2">&nbsp;</td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2"><font face="Arial" size="2">include\</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlapp.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">message loop, interfaces, \r
-    general app stuff</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlcrack.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">message cracker macros</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlctrls.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">standard and common control \r
-    classes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlctrlw.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">command bar class</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlctrlx.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">bitmap button, check list view, \r
-    and other controls</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlddx.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">data exchange for dialogs and \r
-    windows</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atldlgs.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">common dialog classes, property \r
-    sheet and page classes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlfind.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">Find/Replace support for Edit \r
-       and RichEdit</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlframe.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">frame window classes, MDI, \r
-    update UI classes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlgdi.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">DC classes, GDI object classes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlmisc.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">WTL ports of CPoint, CRect, \r
-    CSize, CString, etc.</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlprint.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">printing and print preview</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlres.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">standard resource IDs</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlresce.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">standard resource IDs for \r
-    Windows CE</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlscrl.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">scrollable windows</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlsplit.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">splitter windows</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atltheme.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">Windows XP theme classes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atluser.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">menu class, USER object classes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlwince.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">specific support for Windows CE \r
-       Mobile platforms</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; atlwinx.h</font></td>\r
-    <td width="358"><font face="Arial" size="2">extensions of ATL windowing \r
-    support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2">&nbsp;</td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2"><font face="Arial" size="2">Samples\</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Aero\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Vista Aero glass showcase</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Alpha\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Windows XP 32-bit (alpha) \r
-    toolbar images</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; BmpView\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">bitmap file view sample</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; GuidGen\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">WTL version of the GuidGen \r
-    sample</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; ImageView\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Full-featured PPC frame-view \r
-       application</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; MDIDocVw\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">WTL version of the MDI sample</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; MiniPie\...</font></td>\r
-    <td width="358" class="style2">p<font size="2">ort of the SDK sample for \r
-       Mobile devices</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; MTPad\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">multithreaded notepad sample</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; SPControls\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Barebone SmartPhone dialog \r
-       application</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; TabBrowser\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Web browser using TabView</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Wizard97Test\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Wizard97 showcase \r
-    sample</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; WTLExplorer\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">Explorer-like application \r
-    sample</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2">&nbsp;</td>\r
-  </tr>\r
-       <tr>\r
-    <td width="494" colspan="2"><font face="Arial" size="2">AppWiz\</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; setup70.js</font></td>\r
-    <td width="358"><font face="Arial" size="2">AppWizard setup program for VC++ \r
-    .NET 2002</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; setup71.js</font></td>\r
-    <td width="358"><font face="Arial" size="2">AppWizard setup program for VC++ \r
-    .NET 2003</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; setup80.js</font></td>\r
-    <td width="358"><font face="Arial" size="2">AppWizard setup program for VC++ \r
-    2005</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; setup80x.js</font></td>\r
-    <td width="358"><font face="Arial" size="2">AppWizard setup program for VC++ \r
-    2005 Express</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Files\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">WTL AppWizard for VC++ .NET 2002 and \r
-    2003 files</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2">&nbsp;</td>\r
-  </tr>\r
-       <tr>\r
-    <td width="494" colspan="2"><font face="Arial" size="2">AppWizCE\</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; setup80.js</font></td>\r
-    <td width="358"><font face="Arial" size="2">AppWizard setup program for VC++ \r
-    2005</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Files\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">WTL AppWizard for VC++ 2005 files</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2">&nbsp;</td>\r
-  </tr>\r
-  <tr>\r
-    <td width="494" colspan="2"><font face="Arial" size="2">AppWizMobile\</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; setup80.js</font></td>\r
-    <td width="358"><font face="Arial" size="2">AppWizard Mobile setup program for VC++ \r
-    2005</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="136"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Files\...</font></td>\r
-    <td width="358"><font face="Arial" size="2">WTL AppWizard Mobile for VC++ 2005 files</font></td>\r
-  </tr>\r
-  </table>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial">\r
-<b><a name="Class Overview"></a>Class Overview</b></font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber4">\r
-  <tr>\r
-    <td><font face="Arial" size="2">usage:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-    </font></td>\r
-    <td><font face="Arial" size="2"><b>mi base</b></font></td>\r
-    <td>&nbsp;&nbsp; -</td>\r
-    <td><font face="Arial" size="2">&nbsp;&nbsp; a base class (multiple \r
-    inheritance)</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td>&nbsp;</td>\r
-    <td><font face="Arial" size="2"><b>client</b></font></td>\r
-    <td>&nbsp;&nbsp; -</td>\r
-    <td><font face="Arial" size="2">&nbsp;&nbsp; wrapper class for a handle</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td>&nbsp;</td>\r
-    <td><font face="Arial" size="2"><b>as-is</b></font></td>\r
-    <td>&nbsp;&nbsp; -</td>\r
-    <td><font face="Arial" size="2">&nbsp;&nbsp; to be used directly</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td>&nbsp;</td>\r
-    <td><font face="Arial" size="2"><b>impl</b></font></td>\r
-    <td>&nbsp;&nbsp; -</td>\r
-    <td><font face="Arial" size="2">&nbsp;&nbsp; implements a window (has \r
-    WindowProc) or other support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td>&nbsp;</td>\r
-    <td><font face="Arial" size="2"><b>helper</b></font></td>\r
-    <td>&nbsp;&nbsp; -</td>\r
-    <td><font face="Arial" size="2">&nbsp;&nbsp; a helper class</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td>&nbsp;</td>\r
-    <td><font face="Arial" size="2"><b>base</b></font></td>\r
-    <td>&nbsp;&nbsp; -</td>\r
-    <td><font face="Arial" size="2">&nbsp;&nbsp; implementation base class</font></td>\r
-  </tr>\r
-</table>\r
-<p style=margin:0in>&nbsp;</p>\r
-<table border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" width="600">\r
-  <tr>\r
-    <td width="220"><b><font face="Arial" size="2">class name:</font></b></td>\r
-    <td width="114"><b><font face="Arial" size="2">usage:</font></b></td>\r
-    <td width="253"><b><font face="Arial" size="2">description:</font></b></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font size="2" face="Arial"><br>App/module support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAppModule</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">app support, CComModule derived</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CServerAppModule</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">module for COM servers</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMessageLoop</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">message loop</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMessageFilter</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi base</font></td>\r
-    <td width="255"><font face="Arial" size="2">message filter interface</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CIdleHandler</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi base</font></td>\r
-    <td width="255"><font face="Arial" size="2">idle time handler interface</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Frame windows</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFrameWindowImplBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFrameWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">frame window support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">COwnerDraw</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi base</font></td>\r
-    <td width="255"><font face="Arial" size="2">owner-draw msg map and handlers</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDialogResize</font>\r
-    </b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi base</font></td>\r
-    <td width="255"><font face="Arial" size="2">support for resizing dialogs</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDoubleBufferImpl</font>\r
-    </b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">double-buffer painting support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDoubleBufferWindowImpl</font>\r
-    </b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">double-buffer painting window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>MDI windows</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMDIWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">MDI methods</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMDIFrameWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">MDI frame window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMDIChildWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">MDI child window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Update UI</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CUpdateUIBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CUpdateUI</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi base class</font></td>\r
-    <td width="255"><font face="Arial" size="2">provides support for UI update</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDynamicUpdateUI</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi base class</font></td>\r
-    <td width="255"><font face="Arial" size="2">provides dynamic support for UI update</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Standard controls</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStatic</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">static ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CButton</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">button ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CListBox</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">list box ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CComboBox</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">combo box ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CEdit</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">edit ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CEditCommands</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">standard edit command support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CScrollBar</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">scroll bar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Common controls</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CImageList</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">image list</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CListViewCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">list view ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTreeViewCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">tree view ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTreeItem</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">helper</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTreeViewCtrlEx</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">uses CTreeItem</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CHeaderCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">header bar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CToolBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">toolbar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStatusBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">status bar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTabCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">tab ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CToolTipCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">tool tip ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CToolInfo</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">helper</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTrackBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">trackbar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CUpDownCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">up-down ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CProgressBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">progress bar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CHotKeyCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">hot key ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAnimateCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">animation ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRichEditCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">rich edit ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRichEditCommands</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">std rich edit commands support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDragListBox</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">drag list box</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDragListNotifyImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi class</font></td>\r
-    <td width="255"><font face="Arial" size="2">support for notifications</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CReBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">rebar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CComboBoxEx</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">extended combo box</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDateTimePickerCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">date-time ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFlatScrollBarImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">flat scroll bars support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFlatScrollBar</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">flat scroll bars support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CIPAddressCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">IP address ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMonthCalendarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">month calendar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCustomDraw</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi class</font></td>\r
-    <td width="255"><font face="Arial" size="2">custom draw handling support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Windows CE controls</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCECommandBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">command bar ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCECommandBandsCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">command bands ctrl</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Property sheet &amp; page</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPropertySheetWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPropertySheetImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">property sheet </font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPropertySheet</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPropertyPageWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPropertyPageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">property page</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPropertyPage</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAxPropertyPageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">property page with ActiveX</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAxPropertyPage</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97SheetWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97SheetImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Wizard97 property sheet</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97Sheet</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97PageWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97PageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Wizard97 property page</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97ExteriorPageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Wizard97 exterior page</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWizard97InteriorPageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Wizard97 interior page</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardFrameWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardFrameImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Aero Wizard frame</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardFrame</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardPageWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardPageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Aero Wizard page</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardPage</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardAxPageImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Aero Wizard page with ActiveX</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAeroWizardAxPage</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Common dialogs</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFileDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">GetOpenFileName/GetSaveFileName</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFileDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMultiFileDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Multi-select GetOpenFileName</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMultiFileDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CShellFileDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CShellFileOpenDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Shell File Open dialog</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CShellFileOpenDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CShellFileSaveDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Shell File Save dialog</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CShellFileSaveDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFolderDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">directory picker</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFolderDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFontDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">ChooseFont common dialog</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFontDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRichEditFontDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">ChooseFont for rich edit</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRichEditFontDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CColorDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">ChooseColor common dialog</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CColorDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">PrintDlg common dialog</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintDialogExImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">new Win2000 print dialog</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintDialogEx</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPageSetupDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">PageSetupDlg common dialog</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPageSetupDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFindReplaceDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">FindText/ReplaceText</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFindReplaceDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>User support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMenu</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">menu support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMenuItemInfo</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">MENUITEMINFO wrapper</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAccelerator</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">accelerator table</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CIcon</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">icon object</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCursor</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">cursor object</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CResource</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">generic resource object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>GDI support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDC</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">DC support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPaintDC</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">for handling WM_PAINT</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CClientDC</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">for GetDC</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWindowDC</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">for GetWindowDC</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMemoryDC</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">in-memory DC</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPen</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">GDI pen object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBrush</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">GDI brush object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CLogFont</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">LOGFONT wrapper</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFont</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">GDI font object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBitmap</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">GDI bitmap object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPalette</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">GDI palette object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRgn</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">GDI region object</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Enhanced controls</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCommandBarCtrlImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">command bar</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCommandBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBitmapButtonImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">bitmap button</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBitmapButton</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCheckListViewCtrlImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">check list box</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCheckListViewCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CHyperLinkImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">hyper link control</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CHyperLink</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWaitCursor</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">wait cursor</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCustomWaitCursor</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">custom and animated wait cursor</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMultiPaneStatusBarCtrlImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">status bar with multiple panes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMultiPaneStatusBarCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPaneContainerImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">pane window container</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPaneContainer</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSortListViewImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">sorting list view control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSortListViewCtrlImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSortListViewCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTabViewImpl;</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">tab view window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTabView</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Scrolling window support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CScrollImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">scrolling support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CScrollWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">scrollable window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMapScrollImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">scrolling support with map modes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMapScrollWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">scrollable window with map modes</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CZoomScrollImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">zooming support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CZoomScrollWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">zooming window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CScrollContainerImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">scroll container window</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CScrollContainer</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Splitter window support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSplitterImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">splitter support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSplitterWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">splitter window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSplitterWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Theming support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTheme</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">Windows XP theme</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CThemeImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">theming support for a window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Buffered paint and animation support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBufferedPaint</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">buffered paint</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBufferedPaintImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">buffered paint support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBufferedPaintWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">window with buffered paint</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBufferedAnimation</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255" class="style2">b<font size="2">uffered animation</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBufferedAnimationImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">buffered animation support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CBufferedAnimationWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">window with buffered animation</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Edit and RichEdit Find/Replace support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CEditFindReplaceImplBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255" class="style2">&nbsp;</td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CEditFindReplaceImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">Edit Find/Replace support</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRichEditFindReplaceImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255" class="style2"><font face="Arial" size="2">RichEdit Find/Replace support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Printing support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrinterInfo</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">print info support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrinter</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">printer handle wrapper</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDevMode</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">DEVMODE wrapper</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrinterDC</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">printing DC support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintJobInfo</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">print job info</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintJob</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">print job support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintPreview</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">print preview support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintPreviewWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">print preview window</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPrintPreviewWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CZoomPrintPreviewWindowImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">zooming print preview window</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CZoomPrintPreviewWindow</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Miscellaneous</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSize</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">WTL port of MFC's CSize</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CPoint</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">WTL port of MFC's CPoint</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRect</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">WTL port of MFC's CRect</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CString</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">WTL port of MFC's CString</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CWinDataExchange</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">data exchange for controls</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRecentDocumentList</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi or as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">support for MRU list</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFindFile</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">file search support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>In-memory dialog</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CMemDlgTemplate</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">In-memory dialog template</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CIndirectDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">In-memory dialog class</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Task dialog</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTaskDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Task Dialog in Vista</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTaskDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">&nbsp;</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td colspan="3" width="593"><font face="Arial" size="2"><br>Windows CE support</font></td>\r
-  </tr>\r
-  <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdDialogBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">standard dialog base class</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">standard dialog implementation</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdSimpleDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">standard simple dialog</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdDialogResizeBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">orientation aware standard dialog base class</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdDialogResizeImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">orientation aware standard dialog implementation</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdSimpleDialogResizeImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">standard resizing simple dialog implementation</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdOrientedDialogBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">oriented dialog base class</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdOrientedDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">oriented dialog implementation</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CStdSimpleOrientedDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">as-is</font></td>\r
-    <td width="255"><font face="Arial" size="2">standard simple oriented dialog</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAppInfoBase</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">base</font></td>\r
-    <td width="255"><font face="Arial" size="2">application state save/restore to registry</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAppInfoT</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">CAppInfoBase constructed from a CAppWindow&lt;T&gt;</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAppWindow&lt;&gt;</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">PPC/SmartPhone well-behaved application window class</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAppDialog</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">PPC/SmartPhone well-behaved application non-modal dialog class</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CAppStdDialogImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">PPC/SmartPhone implementation of non-modal standard dialog application</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CFullScreenFrame</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">impl</font></td>\r
-    <td width="255"><font face="Arial" size="2">Full screen frame class</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CZoomScrollImpl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">mi</font></td>\r
-    <td width="255"><font face="Arial" size="2">WinCE zooming implementation</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CHtmlCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">HTML control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CRichInkCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">RichInk control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CInkXCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">InkX control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CVoiceRecorderCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">VoiceRecorder control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CDocListCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">DocList control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CCapEdit</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">CapEdit control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTTStatic</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">TT Static control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CTTButton</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">TT Button control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSpinCtrl</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">Spin control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CSpinListBox</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">Spin List Box control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CExpandListBox</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">Expand List Box control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CExpandEdit</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">Expand Edit control</font></td>\r
-  </tr>\r
-       <tr>\r
-    <td width="221"><b><font face="Arial" size="2">CExpandCapEdit</font></b></td>\r
-    <td width="115"><font face="Arial" size="2">client</font></td>\r
-    <td width="255"><font face="Arial" size="2">Expand CapEdit control</font></td>\r
-  </tr>\r
-</table>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial">\r
-<b><a name="ATL/WTL AppWizard"></a>ATL/WTL AppWizard</b></font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">ATL/WTL AppWizard generates starting code for a \r
-WTL application. It has options to create code for different application types and features.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">You can choose the following options:</font></p>\r
-<ul style='margin-top:0in;margin-bottom:0in'>\r
-  <li><font face="Arial" size="2">Application type (SDI, multi thread SDI, MDI, \r
-  TabView, Explorer, dialog based)</font></li>\r
-  <li><font face="Arial" size="2">Support for hosting ActiveX controls</font></li>\r
-  <li><font face="Arial" size="2">COM server support</font></li>\r
-  <li><font face="Arial" size="2">Class implementation in .CPP files</font></li>\r
-  <li><font face="Arial" size="2">Common Control manifest</font></li>\r
-       <li class="style2">U<font size="2">nicode character set</font></li>\r
-  <li><font face="Arial" size="2">Toolbar, rebar, command bar, status bar</font></li>\r
-  <li><font face="Arial" size="2">View window, and it's type (generic, dialog \r
-  based form, or a list box, edit, list view, tree view, rich edit based, HTML \r
-  page, scroll window)</font></li>\r
-  <li><font face="Arial" size="2">For dialog based apps or a form based view \r
-  window - support for hosting ActiveX controls in the dialog</font></li>\r
-</ul>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">ATL/WTL AppWizard supports VC++ \r
-.NET 2002 and 2003,and VC++ 2005.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Support for Windows CE"></a>Support for \r
-Windows CE</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">WTL now fully supports building \r
-projects for the Windows CE platforms. This initial support for Windows CE was implemented primarily for \r
-eMbedded Visual C++ 4.0 with Pocket PC 2003 and \r
-SmartPhone 2003 SDKs. However, it can be used with other versions and \r
-configurations. For instance, Standard SDK 4.1 or 5.0 is supported as well. Considerable effort was made to provide the best Windows CE support, \r
-however, there might be some limitations because different platforms provide different \r
-programming support. SmartDevice projects with Visual Studio 2005 are also \r
-supported, and it also includes an AppWizard for VS2005.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">The support for Windows CE was \r
-not designed to port projects for the desktop version of Windows as-is to the \r
-Windows CE platforms, but to allow use of the same library, WTL, for both \r
-desktop Windows and Windows CE. Applications for Windows CE are often designed \r
-in a different way, and they use different platform services. WTL depends on the \r
-version of ATL provided with each Windows CE platform, and supports controls and \r
-services that are appropriate and supported for each Windows CE platform.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Support for Visual C++ 2005 Express"></a>Support for \r
-Visual C++ 2005 Express</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">WTL 8.0 supports using Visual \r
-C++ Express Edition to build projects. Since Visual C++ 2005 Express ships without ATL, you have \r
-to use a version of ATL that ships with the Platform SDK.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">The WTL App Wizard can be \r
-installed by running AppWiz\setup80x.js program. The App Wizard generates code \r
-in the stdafx.h file that allows use of ATL3 from the Platform SDK. That code is \r
-used if WTL_USE_SDK_ATL3 is defined, so you can comment the line in stdafx.h \r
-that defines WTL_USE_SDK_ATL3 to use the project with different versions of \r
-Visual C++ or ATL.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Note that Release builds will \r
-generate some warnings, since ATL3 from Platform SDK is an old version of ATL \r
-which doesn't quite match the newer compiler and CRT files. You can ignore those \r
-warnings, as they do not indicate any real problems with the code.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Notes"></a>Notes</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; WTL provides \r
-several classes that are also present in ATL 7.0 and 7.1. The classes are: <b>\r
-CSize</b>, <b>CPoint</b>, <b>CRect</b>, and <b>CString</b> in atlmisc.h. \r
-While their existence will not cause any problems, their usage might. You should \r
-qualify the class you want to use with a namespace to resolve ambiguity, either \r
-ATL or WTL namespace, depending on which implementation you want to use. \r
-Alternatively, you can conditionally exclude WTL implementations, by defining \r
-preprocessor symbol <b>_WTL_NO_WTYPES</b> for CSize, CPoint, and CRect; and <b>_WTL_NO_CSTRING</b> \r
-for CString.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; If \r
-you use WTL 8.0 with VC++ 6.0/ATL 3.0 and define _ATL_STATIC_REGISTRY, you'll \r
-get errors referring to the ambiguous symbol ATL. This is caused by a bug in ATL \r
-3.0 - in atlbase.h, the file statreg.h is included inside of the ATL namespace, \r
-and it contains another namespace ATL declaration. Because of that, the compiler \r
-cannot decide between ATL:: and ATL::ATL:: namespaces. The solution is either to \r
-fix the atlbase.h, or to surround atlbase.h include declaration with following \r
-statements:</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>&nbsp;&nbsp;&nbsp; #define \r
-ATL&nbsp;&nbsp; ATLFIX</b></font></p>\r
-<p style=margin:0in><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; #include &lt;atlapp.h&gt;</font></p>\r
-<p style=margin:0in><font face="Arial" size="2">\r
-<b>&nbsp;&nbsp;&nbsp; #undef ATL</b></font></p>\r
-<p style=margin:0in><font face="Arial" size="2">\r
-<b>&nbsp;&nbsp;&nbsp; namespace ATL = ::ATLFIX;</b></font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; \r
-Windows XP allows applications to use Common Controls version 6, which supports \r
-only Unicode applications. While WTL allows creation of Ansi applications that \r
-use Common Controls 6, that should be used only for test programs and is not \r
-recommended or supported for released projects. If you want to use Common \r
-Controls 6, build your application as Unicode.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; \r
-If you build your app that hosts ActiveX controls \r
-with VC++ 7.x, you can see this assert failing:<br>\r
-<span class="style2"><strong><br>\r
-&nbsp;&nbsp;&nbsp; !InlineIsEqualGUID(*m_plibid, GUID_NULL) &amp;&amp; &quot;Did you forget \r
-to pass the LIBID to CComModule::Init?&quot;<br>\r
-<br>\r
-</strong></span>There are two ways to fix this:</font></p>\r
-<ul>\r
-       <li>\r
-       <p style=margin:0in><span class="style2">In the main .CPP file of your \r
-       project, replace the line<br>\r
-       <strong>&nbsp;&nbsp;&nbsp; hRes = _Module.Init(NULL, hInstance);<br>\r
-       </strong>with this one<br>\r
-       <strong>&nbsp;&nbsp;&nbsp; hRes = _Module.Init(NULL, hInstance, &amp;LIBID_ATLLib);<br>\r
-&nbsp;</strong></span></p>\r
-       </li>\r
-       <li>\r
-       <p style=margin:0in><span class="style2">Compile you project with _ATL_DLL \r
-       defined (dynamic link to ATL)</span></p>\r
-       </li>\r
-</ul>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; \r
-Several of the sample programs included with WTL were extended to support \r
-building for Windows CE. These samples are not specially redesigned for Windows \r
-CE, but just modified to allow you to compile and run them on the Windows CE \r
-platforms. The samples are: BmpView, GuidGen, and MTPad.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; WTL \r
-supports building projects with EVC++ 3.0 only for Pocket PC and Pocket PC 2002 \r
-platforms, as other platforms don't provide minimum support for ATL or other \r
-required libraries.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2"><b>~</b>&nbsp;&nbsp;&nbsp; The \r
-old AppWizards for VC++ 6.0 and eVC++ 4.0/3.0 are not included in this version \r
-of WTL because they cannot be a part of an Open Source project. They are still \r
-available in the previous release, WTL 7.1.</font></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Changes Between WTL 8.0 And 7.5"></a>Changes Between WTL 8.0 And 7.5</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">New and improved:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">RunTimeHelper functions for \r
-       correct struct sizes on different versions of Windows<br>ModuleHelper functions for uniform support of ATL3 and ATL7 module classes<br>SecureHelper functions for support of secure and non-secure run-time \r
-       functions<br>Support for new Vista features:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Support for new messages for common controls, dialogs, etc.</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Support for TaskDialog</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">New Shell file dialogs (IFileOpenDialog and IFileSaveDialog)</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">New Aero Wizard support classes</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">New classes for Buffered Paint and Buffered Animation</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">New TabView classes<br>New dialog class that uses in-memory dialog templates<br>New CMultiFileDialogImpl and CMultiFileDialog classes that support \r
-       multi-select file dialogs<br>Added message cracker handler prototypes for all handlers<br>Replaced use of _alloca with CTempBuffer everywhere (and added CTempBuffer \r
-       version for ATL3)<br>New classes for find/replace support for Edit or RichEdit<br>New class CFileDialogEx that supports GetOpenFileNameEx for Windows Mobile 5<br>\r
-       New features for the App Wizard:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">New default version values</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Unicode build option</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Support for TabView applications</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Support for Explorer applications</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">Updates for the desktop App Wizard:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Added calls to set font for views based on controls that use font</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Added scroll window as another view type</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">Support for VC2005 Express:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Setup for VS2005x</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Changes in default.js to take into account that VC2005x does not have a \r
-       resource editor</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Generated code allows use of ATL3 from the Platform SDK</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">New AppWizard for Mobile 2003 and 2005 platforms<br>\r
-       New samples:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Aero - demonstrates the \r
-               Vista Glass UI</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">MiniPie - Windows Mobile 2005 PPC and Smartphone sample</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">TabBrowser - a web browser using TabView class</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">MTPad sample updated to show usage of CRichEditFindReplaceImpl and \r
-       CEditCommands/CRichEditComma</font></p>\r
-</blockquote>\r
-  <p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Fixes and enhancements:</font></p>\r
-  <blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">Command Bar:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added support for menu items \r
-       with bitmaps on Vista</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Keyboard cues shown \r
-       even if the window is disabled</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CFolderDialog:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added support for PIDLs in \r
-       addition to the file path</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Replaced use of SHGetMalloc \r
-       with CoTaskMemFree</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Scroll Windows:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CZoomScrollImpl - some \r
-       methods should be overridable</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added support for \r
-       WM_MOUSEHWHEEL in CScrollImpl</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">App Wizard:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: AppWizard fails to add \r
-       files if C:\Temp does not exist</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: App Wizard generates \r
-       security warning when loaded</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: App Wizard generates \r
-       level 4 warning for modal dlg project</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: App Wizard setupXX.js \r
-       scripts silently fail on Vista</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Added code to \r
-       unregister message filer and idle processing</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Added WS_CLIPSIBLINGS \r
-       to dialog forms to avoid rebar drawing problems</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">App Wizard CE:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: App Wizard CE should \r
-       not have rich edit as a view option</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: App Wizard CE generates \r
-       level 4 warnings for single instance apps</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added support for Windows \r
-       Mobile 6 SDKs</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Cracked Handlers:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Corrected MSG_WM_TIMER \r
-       and handler prototype, removed unused argument (breaking change)</font></p>\r
-       </li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: atlcrack.h does not \r
-       support WTL namespace</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CDialogResize:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added SetIcon(NULL, FALSE) \r
-       for CDialogResize to remove the generic icon for resizable dialogs</font></p>\r
-       </li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Enabled size/move for \r
-       both X and Y</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added center flags for \r
-       controls</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CFrameWindowImpl:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Const issue with title \r
-       argument of AddSimpleReBarBand</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: DECLARE_FRAME_WND_CLASS \r
-       definition missing WTL namespace</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Windows CE:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Some symbols not \r
-       defined for CE 4.0</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Incorrect WinCE \r
-       exclusions</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Pocket PC - assert \r
-       after navigating a CHyperLink</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Property sheet with \r
-       listview on WM5.0 causes stack overflow</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CFindFile::GetFilePath() \r
-       fails on diskless root requests</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: VS 2005 dialog editor \r
-       bug - DS_FIXEDSYS used but not defined</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Windows Mobile 2005 \r
-       compatibility issues</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CFullScreenFrame on \r
-       Smartphone 20003</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: SmartPhone back key \r
-       handling in CAppWindow</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added orientation aware \r
-       support to CAppStdDialogImpl</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added CAxDialogImpl base for \r
-       CStdDialogImpl, CStdDialogResizeImpl and CStdOrientedDialogImpl</font></p>\r
-       </li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added various CStdDialogxxx \r
-       enhancements</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CStdDialogBase does not \r
-       scale dialog title on VGA</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: DIBINFO16 triggers code \r
-       analysis warning</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added LPCTSTR \r
-       AtlLoadString(UINT uID) - CE only overload</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added imaging draw support \r
-       to CZoomScrollImpl</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added CBottomTabViewImpl and \r
-       CBottomTabView classes for PPC</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CFindFile:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CFindFile class uses \r
-       CRT functions</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: FindFile() uses lstrcpy \r
-       without checking length</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">General:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Adding ReBar bands \r
-       fails with new Windows SDK</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added support for relative \r
-       include paths</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Using std::min and \r
-       std::max</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Problems using WTL with \r
-       MFC</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Improved support for Secure \r
-       CRT</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Changed implementation of \r
-       CSize, CPoint, CRect, and CString to be inside class definitions</font></p>\r
-       </li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">atltheme.h: Corrected method \r
-       signatures for differences in uxtheme.h versions</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Replaced malloc/free with \r
-       new/delete where appropriate</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Misc:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CString::FormatV can \r
-       cause GPF with Unicode strings</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">CHyperLink: Added handler \r
-       for WM_SIZE</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CTheme needs \r
-       constructor from HTHEME handle</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added Add* methods to \r
-       several control classes in atlctrls.h to augment Insert* methods</font></p>\r
-       </li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Incorrect casting in \r
-       CRichEditCtrl::GetLine()</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: \r
-       CTreeViewCtrl::GetItemState changed to return only state-bits as specified \r
-       by mask</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CBitmapButton::DoPaint \r
-       - wrong button image</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Added another variant of \r
-       CDCT::Drawtext with LPTSTR argument that allows text change</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: \r
-       CRecentDocumentListBase::AddToList() uses lstrcpy</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: AtlLoadString(uID, \r
-       lpBuffer, nBufferMax) has unnecessary code</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: CCursor::LoadOEMCursor \r
-       asserts on IDC_HAND</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Memory leak when using \r
-       CRT functions while printing</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">Fix: Undefined CString \r
-       namespace</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">CPaneContainer: Added border \r
-       styles</font></p></li>\r
-       <li>\r
-       <p style=margin:0in><font face="Arial" size="2">CSplitterImpl: Added \r
-       SetSplitterPosPct, and changed App Wizard code to use it</font></p></li>\r
-       </ul>\r
-  </blockquote>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Changes Between WTL 7.5 And 7.1"></a>Changes Between WTL 7.5 And 7.1</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">New and improved:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">VS2005 Compatibility: \r
-       Added support for Visual Studio 2005 - both desktop and Windows CE<br>\r
-       Classes for icons, cursors, accelerator tables<br>\r
-       CSortListViewImpl, CSortListViewCtrlImpl, and CSortListViewCtrl classes<br>\r
-       Impl classes for Wizard 97 style wizards: CWizard97Sheet, \r
-       CWizard97Page, CWizard97ExteriorPage, CWizard97InteriorPage<br>\r
-       CMemoryDC and CDoubleBufferWindowImpl classes<br>\r
-       Windows CE specific classes in new header, atlwince.h<br>\r
-       CScrollContainer class<br>\r
-       CZoomScrollImpl and CZoomScrollWindowImpl classes<br>\r
-       CZoomPrintPreviewWindowImpl and CZoomPrintPreviewWindow classes<br>\r
-       Global functions: AtlGetBitmapResourceInfo, \r
-       AtlGetBitmapResourceBitsPerPixel<br>\r
-       New REFLECT_* macros to enable selective reflection of messages<br>\r
-       App Wizard: Added App Wizard for VS2005<br>\r
-       App Wizard: Added App Wizard for Windows CE for VS2005<br>\r
-       New samples: WTLExplorer, ImageView, SPControls<br>\r
-&nbsp;</font></p>\r
-</blockquote>\r
-  <p style=margin:0in><font face="Arial" size="2">Fixes and enhancements:</font></p>\r
-  <blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">Command Bar:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">DrawBitmapDisabled() \r
-               doesn't work correctly on Longhorn</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Submenu size not correct if \r
-       command bar is off-screen</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Added handler for \r
-       WM_SETTINGCHANGE to improve theme color changes</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Better support for \r
-       8/16/24-bit images</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Command Bar with 2 Levels of \r
-       submenus remains active</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Hook procedure fails to call \r
-       next hook</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">OnDestroy() should not \r
-       decrement hook use if AttachToWindow() is used</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">MDI Command Bar:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Grows bigger if you \r
-               switch between two maximized MDI child window types</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Move all hook messages \r
-               processing to a separate function and use pT</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">MDI icon &amp; buttons should \r
-       have themed background</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Should make MDI buttons gray \r
-       when inactive<br>&nbsp;</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">CString:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Helper functions not \r
-               overloaded properly</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Some return types are \r
-               'const CString&amp;' and could be just 'CString&amp;'</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">FormatV() passes size in \r
-       characters to _alloca, should be in bytes</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Fixed stack corruption in \r
-       FormatV()</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Improved boundaries checking \r
-       for integer overflows/underflows<br>&nbsp;</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">CScrollImpl:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Scroll bars problem when \r
-               changing range</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">SetScrollOffset() doesn't \r
-       move child windows</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Range and thumb drawing \r
-       problems</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Possible overflow in \r
-       OnMouseWheel()</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Support for \r
-       SIF_DISABLENOSCROLL</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Added ScrollToView methods</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CMapScrollImpl:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">SetScrollSize() incorrectly \r
-       inverts xMin and xMax</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">SetScrollSize() uses bRedraw \r
-       = NULL</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CTheme:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">GetThemeFont() bad parameter \r
-       ordering</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Uses LOGFONT and TEXTMETRIC \r
-       incorrectly (SDK header problem)</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CFrameWindowImpl:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Improved sizing for Windows \r
-       CE</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CreateSimpleToolBarCtrl() \r
-       should handle 24-bit bitmaps</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Changed WinCE \r
-       CCECommandBarCtrl typedef and added a PPC CMenuBarCtrl</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">UpdatesBarPosition() doesn't \r
-       take Windows CE command bar into account</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CDialogResize:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Enabled use for Windows CE</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Add WS_EX_DLGMODALFRAME to \r
-       prevent empty icon</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CReBarCtrl:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Background not painted when \r
-       resized</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Fixed typo in LockBands()</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">MaximizeBand needs BOOL \r
-       fIdeal argument</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CRichEdit:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">GetSelText() should \r
-               support UNICODE strings</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">GetSelText() uses lpstr instead of lpstrText</font></p></li>\r
-       </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CHyperLink:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Added _xttoi() helper to \r
-       avoid CRT in _ATL_MIN_CRT</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Fixed resource leak by \r
-       destroying tooltip window<br>&nbsp;</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in><font face="Arial" size="2">CPropertySheetImpl:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Improved support for Windows \r
-       CE</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Sheet without title \r
-       generates a memory fault on Windows CE</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CFolderDialog:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Add a way to set an initial \r
-       folder</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Uses BFFM_IUNKNOWN which is \r
-       not always defined</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Update UI:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Add support to \r
-               dynamically add UpdateUI elements</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">UIUpdateMenuBarElement() \r
-               should use EnableMenu() instead of SetMenuItemInfo() for Windows CE</font></p>\r
-               </li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">CDC:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">FillSolidRect() should \r
-               restore background color</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">GetClipRgn() method \r
-               missing</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Printing:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">\r
-               CPrinter::CreatePrinterDC() and CreatePrinterIC() members should be \r
-               const</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CDevMode::CopyToHDEVMODE() is missing a call to GlobalUnlock()</font></p>\r
-               </li>\r
-       </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">AppWizard:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Use WTL subfolder to \r
-               create WTL category for VC7.x and VC8</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Rename files from \r
-               WTLApp7x to WTLAppWiz, and add VS2005 setup file</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Fixed setup \r
-               for x64</font></p></li>\r
-       </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">General:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Redefinition of _MAX_FNAME \r
-               with Dinkumware Standard C++ Library on Windows CE</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Added ATLVERIFY macro \r
-               for ATL3</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Support warning level 4</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Missing methods \r
-               CToolBarCtrl::SetButtonInfo, InsertButton, CTabCtrl::SetItem, \r
-               CComboBoxEx::InsertItem, SetItem</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Missing support for \r
-               WM_PRINTCLIENT</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Removed usage of IsBad* \r
-               functions</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Fixed various compiler \r
-               warnings</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">TCHAR bugs in various \r
-               files</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">Improved Windows CE support and changes for Visual Studio 2005</font></p></li>\r
-       </ul>\r
-       <p style=margin:0in>&nbsp;</p>\r
-       <p style=margin:0in><font face="Arial" size="2">Misc:</font></p>\r
-       <ul style='margin-top:0in;margin-bottom:0in'>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CMDIChildWindowImpl: \r
-               HMENU should be destroyed in OnDestroy()</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CStatic: Should use \r
-               STM_SETIMAGE instead of STM_SETICON for SetIcon() on Windows CE</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CButton: GetButtonStyle() \r
-               uses wrong mask</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CImageList: Made \r
-               Duplicate() method const</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CListViewCtrl: Made \r
-               SubItemHitTest() method const</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CTreeViewCtrl: GetItem() \r
-               and SetItem() incorrectly restricted to _WIN32_IE &gt;= 0x0500</font></p>\r
-               </li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CMonthCalendarCtrl: \r
-               GetMonthRange() should be GetMaxTodayWidth()</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CDateTimePickerCtrl: \r
-               SetFormat() should have const argument</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CBitmapButtonImpl: Fixed \r
-               resource leak by destroying tooltip window</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">\r
-               CMultiPaneStatusBarCtrlImpl: Cannot handle wide panes without resource \r
-               strings</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CCheckListViewCtrlImpl: \r
-               Call CheckSelectedItems() through pT</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CPaneContainerImpl: \r
-               SetPaneContainerExtendedStyle() should use pT to call CalcSize()</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CFindFile: Enabled for \r
-               Windows CE</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CPropertyPageImpl: Added \r
-               handlers for callback messages</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">atlcrack.h: Added return \r
-               value for MSG_WM_APPCOMMAND</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CMenu: New method variants: AppendMenu, InsterMenu, ModifyMenu</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CFont: Added arguments \r
-               for bold and italic to CreatePointFont()</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CSize: Added scalar \r
-               operators for WTL::CSize and ATL::CSize</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CRecentDocumentList: \r
-               Allow changing the &quot;DocumentCount&quot; and &quot;Document%i&quot; registry values \r
-               strings</font></p></li>\r
-               <li>\r
-               <p style=margin:0in><font face="Arial" size="2">CSplitterWindowImpl: \r
-               Enabled use for Windows CE</font></p></li>\r
-       </ul>\r
-  </blockquote>\r
-<p style=margin:0in><br>\r
-&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Changes Between WTL 7.1 And 7.0"></a>Changes Between WTL 7.1 And 7.0</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">New and improved:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">VC7 Compatibility: Support for \r
-  ATL7 Module classes and critical sections and AppWizard setup for VC++ 7.1</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">Windows CE Support: Full \r
-  compatibility with Windows CE platforms and AppWizard for eMbedded Visual C++</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">Namespace Support: Automatic \r
-  &quot;using ATL&quot; (ATL7 only) or &quot;using WTL&quot; can now be turned off</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">CHyperLink New Features: not \r
-  underlined, underlined when hover, command button, link tags</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">CCustomWaitCursor class \r
-  supports custom and animated wait cursors</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">AtlCreateBoldFont() for \r
-  creating bold version of an existing font</font></p>\r
-</blockquote>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Fixes and enhancements:</font></p>\r
-  <blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">CFrameWindowImpl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CreateSimpleToolBarCtrl() - \r
-  remove dead code, improve error checking, add a global function that uses it</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - PrepareChevronMenu() fails to \r
-  get toolbar strings for Unicode</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CFrameWindowImplBase::Create() \r
-  - improve ASSERT not to use m_hWnd if creation fails</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CFrameWndClassInfo::Register - \r
-  should use %p formatting only for _WIN32_WINNT &gt;= 0x0500 or for _WIN64</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Chevron menus not positioned \r
-  correctly with RTL</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CMDIChildWindowImpl: Problems \r
-  creating maximized child windows and handling focus</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CMDIChildWindowImpl: Should \r
-  activate on WM_MOUSEACTIVATE</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">UpdateUI:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Incorrectly clears default \r
-  item from the system menu in MDI apps</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Added UISetCheck with bool \r
-  instead of int for the check state</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">DDX:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Doesn't provide a way to \r
-  change floating point precision</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Added DDX_CONTROL_HANDLE for \r
-  non-CWindowImpl objects</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Added DDX_Check variant with \r
-  bool instead of int for the check state</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Command Bar:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - OnDrawItem() and OnMeasureItem() \r
-  don't do a good check for owner-draw menu items</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Disabled 32-bit images not \r
-  painted correctly in 3D menu mode</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Popup menus not positioned \r
-  correctly with RTL</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Uses GCL_HICONSM instead of \r
-  GCLP_HICONSM with GetClassLongPtr()</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">MDI Command Bar:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Doesn't refresh icon if MDI \r
-  children are different</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">OnAllHookMessages() - improve \r
-  code to handle MDI child window class icon</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - OnNcLButtonDown() uses \r
-  TPM_VERPOSANIMATION without checking Windows version</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Maximized MDI buttons in wrong \r
-  place for RTL</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Should adjust cxIdeal for \r
-  rebar bands for IE4</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Add support for different \r
-  top-level menu widths by handling ideal size for rebar bands</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">AppWizard:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Doesn't support MSDI \r
-  application as a COM Server</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - MDI with Form View - stack \r
-  overflow closing maximized MDI child windows</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Generates VERSION resource \r
-  name 'test1' regardless of the project name</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Dialog project with control \r
-  hosting doesn't derive a dialog from CAxDialogImpl</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - COM Server doesn't register \r
-  type library</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - COM Server doesn't register \r
-  AppID properly</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CTreeViewCtrl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - GetItemData() needs better \r
-  return value</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - GetItemState() should use \r
-  TVM_GETITEMSTATE instead of TVM_GETITEM for IE5</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">GetItem() and SetItem() - \r
-  added \r
-  new variants that use TVITEMEX</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - SortChildren() should add \r
-  recurse flag argument</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CTreeItem doesn't support \r
-  CTreeViewCtrlExT that has different TBase than CWindow</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CThemeImpl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Uses scalar delete instead of \r
-  the vector one</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - EnableThemeDialogTexture() \r
-  argument is BOOL instead of DWORD</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CFolderDialog:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - EnableOK() passes wrong \r
-  arguments to BFFM_ENABLEOK</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Always clears m_hWnd, which \r
-  causes problem for nested messages</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CDialogResize:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - DlgResize_Init() forces dialog \r
-  to be visible by using SetRedraw()</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Forcing WS_THICKFRAME is not \r
-  enough to make dialog resizable</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Min track size should be used \r
-  for child dialogs as well</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - DlgResize_PositionControl() \r
-  incorrectly checks return value from MapWindowPoints()</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CAppModule:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CAppModule methods not \r
-  thread-safe</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - AddSettingChangeNotify() \r
-  unusable in multithreaded apps because of delayed initialization</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CString:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Delete() doesn't allow \r
-  deleting more than the length of the string</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Append() can cause buffer \r
-  overrun</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - MakeReverse() can cause an \r
-  infinite loop</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - _cstrstr() unnecessarily \r
-  inefficient</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - FindOneOf() is not DBCS-aware</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Format() does not recognize %E</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - TrimLeft() and TrimRight() are \r
-  only half-way DBCS-aware</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - May cause assertions or \r
-  undefined behavior with SBCS</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CRecentDocumentList:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - SetMaxEntries() has an \r
-  incorrect ASSERT</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Add CString variant of the \r
-  GetFromList() method</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Add a way to replace command \r
-  IDs used for the MRU list</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Add a way to replace registry \r
-  key name</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Misc:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CMessageLoop::Run() - improve \r
-  the loop by checking bDoIdle before calling PeekMessage()</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CServerAppModule: Clean-up \r
-  unused code</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CServerAppModule::MonitorProc() \r
-  - no need to call _endthreadex()</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CListBox::GetText() and \r
-  CComboBox::GetLBText() (CString variants) don't check for LBERR/CB_ERR</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CAxPropertyPageImpl doesn't \r
-  create ActiveX controls with ATL7</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CDC::GetTextExtentExPoint() \r
-  missing</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CDC::SetWindowExt() should \r
-  have default value NULL for the lpSizeRet argument</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CPropertySheetWindow missing \r
-  methods for PSM_INSERTPAGE, PSM_SETHEADERTITLE, and PSM_SETHEADERSUBTITLE; \r
-  AddPage should return BOOL</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CMapScrollImpl::SetScrollSize() \r
-  uses wrong variable</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CHyperLink: WM_UPDATEUISTATE \r
-  causes repaint without WM_PAINT</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CUpDownCtrl::GetPos() returns \r
-  incorrect value</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CUpDownCtrl::GetPos32() \r
-  doesn't have default arg value</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CMultiPaneStatusBarCtrl: \r
-  Always uses size grip for positioning panes</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CTabCtrl::InsertItem() should \r
-  return int, not BOOL</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CReBarCtrl: Added LockBands() \r
-  method</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CFont: uninitialized variable \r
-  passed to DPtoLP</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CPrintDialogImpl: Crash when \r
-  displaying Print Setup dialog</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix -\r
-  CPageSetupDialogImpl::PaintHookProc() - should use T* and return UINT_PTR \r
-  instead of UINT</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CPrintJob doesn't support \r
-  printing to a file</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CSplitterImpl: Doesn't handle \r
-  WM_CAPTURECHANGED - can get in an invalid state</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CRichEditCtrl: Add method for \r
-  EM_SETTABSTOPS</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - CFindFile::GetFilePath() \r
-  checks for a trailing slash, but doesn't use that info</font></p>\r
-    </li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">General:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Problems compiling with /Zc:forScope \r
-  ('for' loop scope conformance)</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Use named constants instead of \r
-  values for pixel sizes, buffer lengths, etc.</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Support building with Managed \r
-  C++ (/CLR)</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CMenuItemInfo - add run-time \r
-  support for different versions of Windows</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">CommCtrl.h change - additional \r
-  fields in IMAGELISTDRAWPARAMS now depend on _WIN32_IE instead of _WIN32_WINNT</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Incorrect usage of CRegKey::QueryStringValue()</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Operator = for GDI and USER \r
-  wrappers leaks handle if it's managed variant</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - GDI and USER wrappers break \r
-  under self-assignments</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Fix - Chaining messages with cracked \r
-  handlers broken with ATL7</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Initialize all variables and \r
-  structures prior to use</font></p>\r
-    </li>\r
-    <li>\r
-  <p style=margin:0in><font face="Arial" size="2">Use new common control struct \r
-  names</font></p>\r
-    </li>\r
-  </ul>\r
-  </blockquote>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Changes Between WTL 7.0 And 3.1"></a>Changes Between WTL 7.0 And 3.1</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">New classes and features:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">Support for new Common Controls v6 messages</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">Support for Visual Studio .NET and ATL 7.0</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">WTLApp70 - new AppWizard for Visual Studio \r
-  .NET</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">CThemeImpl - implements support for Windows XP \r
-  themes</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">CMDICommandBarCtrl - implements Command Bar for \r
-  MDI applications</font></p>\r
-</blockquote>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Fixes and enhancements:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">Command Bar:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Bogus assert in OnDestroy</font></li>\r
-    <li><font face="Arial" size="2">Check marks can be truncated in large font \r
-    settings</font></li>\r
-    <li><font face="Arial" size="2">Use pT to access GetSystemSettings, \r
-    DrawMenuText, DrawBitmapDisabled, Draw3DCheckmark, DoPopupMenu, \r
-    DoTrackPopupMenu, TakeFocus, GiveFocusBack, so they can be overridden</font></li>\r
-    <li><font face="Arial" size="2">No hot-tracking if main window is not active</font></li>\r
-    <li><font face="Arial" size="2">Top level items not painted inactive if app \r
-    looses activation while drop down menu is displayed</font></li>\r
-    <li><font face="Arial" size="2">Added Windows XP flat menus support</font></li>\r
-    <li><font face="Arial" size="2">Drop-down menu doesn't close if clicked \r
-    again (Windows XP only)</font></li>\r
-    <li><font face="Arial" size="2">Menu item text and accelerator text too \r
-    close with some settings</font></li>\r
-    <li><font face="Arial" size="2">Keyboard can still access clipped menu items</font></li>\r
-    <li><font face="Arial" size="2">Added support for hiding keyboard navigation \r
-    indicators until Alt key is pressed (system setting)</font></li>\r
-    <li><font face="Arial" size="2">Added AddIcon and ReplaceIcon variants for \r
-    icon resources</font></li>\r
-    <li><font face="Arial" size="2">Image size calculated differently in \r
-    different places</font></li>\r
-    <li><font face="Arial" size="2">Add support for 32-bit (alpha channel) \r
-    bitmaps for Windows XP</font></li>\r
-    <li><font face="Arial" size="2">Fixed width calculation for default menu \r
-    items</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CFrameWindowImpl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">AddSimpleReBarBandCtrl sets toolbar extended \r
-    styles without preserving old ones</font></li>\r
-    <li><font face="Arial" size="2">PrepareChevronMenu should not create menu \r
-    items for buttons with TBSTATE_HIDDEN</font></li>\r
-    <li><font face="Arial" size="2">TPM_VERPOSANIMATION will not be defined in \r
-    atlframe.h if atlctrlw.h is included first</font></li>\r
-    <li><font face="Arial" size="2">CreateSimpleToolBarCtrl - height might be \r
-    too small if large font is used</font></li>\r
-    <li><font face="Arial" size="2">PrepareChevronMenu uses TB_GETBUTTONTEXT, \r
-    better use TB_GETBUTTONINFO</font></li>\r
-    <li><font face="Arial" size="2">Chevron menu doesn't close if clicked again \r
-    (Windows XP only)</font></li>\r
-    <li><font face="Arial" size="2">Should check local classes for superclassing</font></li>\r
-    <li><font face="Arial" size="2">Add support for 32-bit (alpha channel) \r
-    bitmaps for Windows XP</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Update UI:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">UISetText can clear other menu item flags</font></li>\r
-    <li><font face="Arial" size="2">CUpdateUI::UIUpdateState assigns value with \r
-    |= instead of =</font></li>\r
-    <li><font face="Arial" size="2">Added UISetDefault() and fix default state \r
-    to work with menus</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CString:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">GetBuffer() and GetBufferSetLength() should \r
-    return NULL in out-of-memory condition</font></li>\r
-    <li><font face="Arial" size="2">Added missing methods: separate c-tors for \r
-    LPCSTR and LPCWSTR, CollateNoCase, TrimRight and TrimLeft variants, Find \r
-    variants, moved FormatV to public</font></li>\r
-    <li><font face="Arial" size="2">Fix _IsValidString usage</font></li>\r
-    <li><font face="Arial" size="2">FormatV incorrectly calculates buffer size \r
-    (too big)</font></li>\r
-    <li><font face="Arial" size="2">Usage of _ttoi causes problems with _ATL_MIN_CRT \r
-    in VC7</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CDC:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">GetTabbedTextExtent() should return DWORD \r
-    instead of BOOL</font></li>\r
-    <li><font face="Arial" size="2">Add FillRect() that accept color index \r
-    instead of a brush handle</font></li>\r
-    <li><font face="Arial" size="2">DrawDragRect() leaks regions and a brush</font></li>\r
-    <li><font face="Arial" size="2">Improved DitherBlt() - added brushes as \r
-    arguments for used colors</font></li>\r
-    <li><font face="Arial" size="2">Added DrawShadowText() (uses LoadLibrary/GetProcAddress \r
-    to run on older Windows)</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CListViewCtrl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">SetItemState should use LVM_SETITEMSTATE</font></li>\r
-    <li><font face="Arial" size="2">SetItemCount should return a BOOL</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CRichEditCtrl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Added SetCharFormat() variant that accepts \r
-    flags (for SCF_ALL)</font></li>\r
-    <li><font face="Arial" size="2">CharFromPos() should pass a pointer to \r
-    POINTL in lParam</font></li>\r
-    <li><font face="Arial" size="2">GetTextRange() - should add Unicode variant \r
-    for rich edit version &gt;= 2</font></li>\r
-    <li><font face="Arial" size="2">Added another FormatRange() that can accept \r
-    a pointer to FORMATRANGE (needed for passing NULL to clear cache)</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CHyperLink:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Allow overriding of Navigate and \r
-    CalcLabelRect</font></li>\r
-    <li><font face="Arial" size="2">Doesn't handle right or center alignment</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CColorDialog:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Has static variables that were not \r
-    initialized with _ATL_MIN_CRT</font></li>\r
-    <li><font face="Arial" size="2">Fixed HookProc for ColorOK message - the \r
-    message is not sent, but the hook proc is called directly</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">atlcrack.h:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">MSG_WM_TIMER crack macro should cast to \r
-    TIMERPROC instead of TIMERPROC*</font></li>\r
-    <li><font face="Arial" size="2">Add cracked handlers for all new messages in \r
-    Common Controls 6</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">atlapp.h:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Fixed problems with atlTraceUI with ATL7</font></li>\r
-    <li><font face="Arial" size="2">#ifdefs for ATL7 were in the wrong place</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">atlctrls.h:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Add support in control classes for all new \r
-    messages in Common Controls 6</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CRecentDocumentList:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">AtlCompactPath corrupts memory if filename \r
-    is longer than requested compact size</font></li>\r
-    <li><font face="Arial" size="2">ReadFromRegistry incorrectly checks for \r
-    error when reading from registry</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CSplitterWindow:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Incorrect calculation of middle position</font></li>\r
-    <li><font face="Arial" size="2">3D border now drawn only if WS_EX_CLIENTEDGE \r
-    is set</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Printing:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Uses DWORD instead of an int for a job ID</font></li>\r
-    <li><font face="Arial" size="2">CPrintJob::CancelPrintJob shouldn't have a \r
-    return value</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Misc:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">CRegKey::QueryValue and SetValue are \r
-    deprecated in ATL7</font></li>\r
-    <li><font face="Arial" size="2">Added direct support for ATL7</font></li>\r
-    <li><font face="Arial" size="2">Replace ScreenToClient and ClientToScreen \r
-    with MapWindowPoints to support RTL layout</font></li>\r
-    <li><font face="Arial" size="2">CFindFile::GetFilePath(LPTSTR...) returns \r
-    path without the file name</font></li>\r
-    <li><font face="Arial" size="2">MDI: Updating client edge in \r
-    WM_WINDOWPOSCHANGING causes minimize/maximize/restore animation problems, \r
-    use WM_WINDOWPOSCHANGED</font></li>\r
-    <li><font face="Arial" size="2">Custom Draw: Added \r
-    CCustomDraw::OnSubItemPrePaint() overrideable method</font></li>\r
-    <li><font face="Arial" size="2">CFolderDialogImpl uses 'this' for \r
-    BROWSEINFO.lParam instead of T*</font></li>\r
-    <li><font face="Arial" size="2">CImageList::Destroy shouldn't use Detach()</font></li>\r
-    <li><font face="Arial" size="2">ATL7 has its own AtlLoadString</font></li>\r
-    <li><font face="Arial" size="2">CPropertySheet doesn't close when you press \r
-    X button</font></li>\r
-    <li><font face="Arial" size="2">Fixed problems for _U_STRINGorID and others \r
-    that moved from atlbase.h to atlwin.h in ATL7</font></li>\r
-    <li><font face="Arial" size="2">Add AtlMessageBox() that accepts either \r
-    in-memory or resource strings</font></li>\r
-    <li><font face="Arial" size="2">CScrollImpl: fixed bug with scrolling child \r
-    windows</font></li>\r
-    <li><font face="Arial" size="2">CPropertyPageImpl: Add new notification \r
-    handlers to enable direct return values (use #ifdef _WTL_NEW_PAGE_NOTIFY_HANDLERS \r
-    to use them)</font></li>\r
-    <li><font face="Arial" size="2">Add AtlInitCommonControls() to simplify use</font></li>\r
-    <li><font face="Arial" size="2">DDX: Fixed usage of the size of char arrays \r
-    for DDX</font></li>\r
-    <li><font face="Arial" size="2">CPageSetupDialog: changed usage of \r
-    CWndProcThunk because of changes in ATL7</font></li>\r
-    <li><font face="Arial" size="2">Fix confusing precedence in expressions</font></li>\r
-    <li><font face="Arial" size="2">Removed forward declarations because default \r
-    values for template arguments shouldn't be specified in two places (we don't \r
-    need them anyway)</font></li>\r
-    <li><font face="Arial" size="2">Win64: Fix /Wp64 warnings from 32-bit VC7 \r
-    compiler caused by SDK headers</font></li>\r
-    <li><font face="Arial" size="2">Fix direct usage of English strings (they \r
-    can be #defined to something else now)</font></li>\r
-    <li><font face="Arial" size="2">AtlGetCommCtrlVersion not defined if _ATL_DLL \r
-    is in ATL 3.0 (and CmdBar is using it)</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">AppWizard:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Added manifest for Common Controls 6</font></li>\r
-    <li><font face="Arial" size="2">Loading Rich Edit DLL should use HMODULE</font></li>\r
-    <li><font face="Arial" size="2">Should not use atlimpl.cpp for ATL7</font></li>\r
-    <li><font face="Arial" size="2">Added message handler prototypes to \r
-    generated files</font></li>\r
-    <li><font face="Arial" size="2">VERSION resource always has VALUE &quot;OLESelfRegister&quot; \r
-    (now only for COM servers)</font></li>\r
-    <li><font face="Arial" size="2">Added option for putting implementation in \r
-    CPP files</font></li>\r
-    <li><font face="Arial" size="2">d-tor for the thread manager class in MSDI \r
-    project executed after the heap is destroyed</font></li>\r
-    <li><font face="Arial" size="2">Wrong settings when changing to a dialog \r
-    project and back (AppWizard 6.0 only)</font></li>\r
-    <li><font face="Arial" size="2">Remove cut/copy/paste accelerators for form \r
-    view and dialogs projects</font></li>\r
-    <li><font face="Arial" size="2">Fix toolbar bitmaps so they are not \r
-    transparent (problem with Windows XP flat menus only)</font></li>\r
-    <li><font face="Arial" size="2">Used CMDICommandBarCtrl for MDI apps</font></li>\r
-    <li><font face="Arial" size="2">Add symbols required for VC7 Class Wizard to \r
-    recognize an ATL project</font></li>\r
-    <li><font face="Arial" size="2">Changed default styles for the rebar, so it \r
-    does look OK without CmdBar and with manifest</font></li>\r
-    <li><font face="Arial" size="2">Added setup programs for both AppWizards</font></li>\r
-    <li><font face="Arial" size="2">Remove ignored resource attributes: \r
-    MOVEABLE, PURE, etc. (AppWizard 7.0 only)</font></li>\r
-    <li><font face="Arial" size="2">Add call to DefWindowProc to WinMain to \r
-    resolve possible problems if MSLU is used</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Samples:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Updated toolbar bitmaps, added #ifdefs for \r
-    ATL7, added manifest file for CommCtrl6, qualified _U_RECT with WTL \r
-    namespace, updated use of deprecated CRegKey functions, added VC7 projects</font></li>\r
-    <li><font face="Arial" size="2">Added Alpha sample</font></li>\r
-  </ul>\r
-</blockquote>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><b><font face="Arial">\r
-<a name="Changes Between WTL 3.1 And 3.0"></a>Changes Between WTL 3.1 And \r
-3.0</font></b></p>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">New classes:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">CPaneContainer - implements a window that \r
-  provides a title bar and a close button (like Explorer)</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">CDialogResize - an MI class that allows \r
-  resizing of dialogs (or any windows with child windows/controls)</font></p>\r
-  <p style=margin:0in><font face="Arial" size="2">CAxPropertyPageImpl - implements a property \r
-  page that can host ActiveX controls</font></p>\r
-</blockquote>\r
-<p style=margin:0in>&nbsp;</p>\r
-<p style=margin:0in><font face="Arial" size="2">Fixes and enhancements:</font></p>\r
-<blockquote style='margin-top:0in;margin-bottom:0in'>\r
-  <p style=margin:0in><font face="Arial" size="2">CServerAppModule now clears m_hEventShutdown to \r
-  avoid calling CloseHandle twice</font></p>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CString:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">operator += now leaves original string \r
-    intact if it's out of memory</font></li>\r
-    <li><font face="Arial" size="2">Fixed bad DWORD_PTR usage in TrimRight, \r
-    TrimLeft, Replace, Remove</font></li>\r
-    <li><font face="Arial" size="2">Removed dependencies on CRT for projects \r
-    that don't use it</font></li>\r
-    <li><font face="Arial" size="2">Insert - fixed string corruption in release \r
-    builds</font></li>\r
-    <li><font face="Arial" size="2">Added optional floating point formatting \r
-    (for projects that use CRT)</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CEdit and CRichEditCtrl: SetSelAll and \r
-  SetSelNone had reversed implementation</font></p>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">atlres.h: Changed IDs so that they are \r
-  compatible with MFC's afxres.h</font></p>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Command Bar:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Added LoadMappedImages()</font></li>\r
-    <li><font face="Arial" size="2">Changed handling of left and right arrow \r
-    keys so that they don't close context menus</font></li>\r
-    <li><font face="Arial" size="2">Add code to handle left/right arrow keys \r
-    correctly on mirrored (RTL) systems</font></li>\r
-    <li><font face="Arial" size="2">Removed handler that eats parent window's \r
-    WM_SETTINGCHANGE</font></li>\r
-    <li><font face="Arial" size="2">Fixed bitmap resource leak in \r
-    Draw3DCheckmark</font></li>\r
-    <li><font face="Arial" size="2">Fixed incorrect usage of CharLower in \r
-    OnMenuChar</font></li>\r
-    <li><font face="Arial" size="2">Fixed wrong color for the disabled items in \r
-    hi-contrast mode</font></li>\r
-    <li><font face="Arial" size="2">Added code to gray menu items if main window \r
-    is inactive</font></li>\r
-    <li><font face="Arial" size="2">Fixed keyboard mnemonic handling for IE 4</font></li>\r
-    <li><font face="Arial" size="2">Fixed hook problems with multiple cmdbars in \r
-    the same thread</font></li>\r
-    <li><font face="Arial" size="2">Added support for radio menu items</font></li>\r
-    <li><font face="Arial" size="2">Added support for disabled top-level menu \r
-    items (also added in CFrameWindowImpl::PrepareChevronMenu)</font></li>\r
-    <li><font face="Arial" size="2">Added keyboard shortcut (Alt+/) to invoke \r
-    chevron menu</font></li>\r
-    <li><font face="Arial" size="2">Added support to override menu item length \r
-    in a derived class</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CBitmapButton:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Bypassed BUTTON DefWindowProc for hover \r
-    style so that the button doesn't take focus</font></li>\r
-    <li><font face="Arial" size="2">Added BMPBTN_AUTOFIRE extended style</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CDC:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Added _WTL_FORWARD_DECLARE_CSTRING define to \r
-    allow usage of methods that accept CString</font></li>\r
-    <li><font face="Arial" size="2">Fixed errors in GetTextFace and \r
-    GetMenuItemString</font></li>\r
-    <li><font face="Arial" size="2">Added GetCharWidth32</font></li>\r
-    <li><font face="Arial" size="2">Added DrawIconEx method</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CMenu:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Implement following missing methods:<br>\r
-&nbsp;&nbsp;&nbsp; GetMenuDefaultItem<br>\r
-&nbsp;&nbsp;&nbsp; GetMenuInfo<br>\r
-&nbsp;&nbsp;&nbsp; GetMenuItemRect<br>\r
-&nbsp;&nbsp;&nbsp; HiliteMenuItem<br>\r
-&nbsp;&nbsp;&nbsp; IsMenu<br>\r
-&nbsp;&nbsp;&nbsp; MenuItemFromPoint<br>\r
-&nbsp;&nbsp;&nbsp; SetMenuDefaultItem<br>\r
-&nbsp;&nbsp;&nbsp; SetMenuInfo</font></li>\r
-    <li><font face="Arial" size="2">GetMenuString - fixed to include space for \r
-    terminating NULL character in returning string</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">GDI and USER classes should destroy the \r
-  GDI/USER objects in Attach if GDI/USER resource is managed</font></p>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CFrameWindowImpl:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">OnToolTipText shouldn't save tool tip text \r
-    if it's not for a menu</font></li>\r
-    <li><font face="Arial" size="2">AddSimpleReBarBandCtrl now adds chevron \r
-    style only for toolbars with buttons</font></li>\r
-    <li><font face="Arial" size="2">AddSimpleReBarBand(Ctrl) - calc band ID if \r
-    not specified</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CRecentDocumentList:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Fix - UpdateMenu deletes wrong menu item \r
-    when the list is empty</font></li>\r
-    <li><font face="Arial" size="2">Added code to allow restricting the number \r
-    of characters displayed by MRU menu items</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Update UI:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Added support for blocking accelerators for \r
-    disabled items</font></li>\r
-    <li><font face="Arial" size="2">Improved search code assuming there are no \r
-    duplicate entries (and added checks for duplicates)</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">CSplitterWindow:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">CSplitterWindowImpl should derive from \r
-    CSplitterImpl&lt;T , t_bVertical&gt; to allow overriding of methods</font></li>\r
-    <li><font face="Arial" size="2">Added single pane mode and SetSinglePaneMode/GetSinglePaneMode</font></li>\r
-    <li><font face="Arial" size="2">Added right/bottom aligned resize mode using \r
-    extended styles SPLIT_RIGHTALIGNED/SPLIT_BOTTOMALIGNED</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">atlcrack.h: Added handlers for following new \r
-  messages:<br>\r
-&nbsp;&nbsp;&nbsp; WM_APPCOMMAND<br>\r
-&nbsp;&nbsp;&nbsp; WM_NCXBUTTONDOWN<br>\r
-&nbsp;&nbsp;&nbsp; WM_NCXBUTTONUP<br>\r
-&nbsp;&nbsp;&nbsp; WM_NCXBUTTONDBLCLK<br>\r
-&nbsp;&nbsp;&nbsp; WM_XBUTTONDOWN<br>\r
-&nbsp;&nbsp;&nbsp; WM_XBUTTONUP<br>\r
-&nbsp;&nbsp;&nbsp; WM_XBUTTONDBLCLK</font></p>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Win64:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Dialog return value should use \r
-    DWLP_MSGRESULT and SetWindowLongPtr</font></li>\r
-    <li><font face="Arial" size="2">CMenu::InsertMenu, AppendMenu, ModifyMenu \r
-    should have UINT_PTR for the menu ID</font></li>\r
-    <li><font face="Arial" size="2">Added appropriate type casts</font></li>\r
-    <li><font face="Arial" size="2">CFrameWindowImpl::m_szAutoName - changed the \r
-    size to fit the pointer value size</font></li>\r
-    <li><font face="Arial" size="2">CListViewCtrl::SortItems should use LPARAM \r
-    for user data instead of DWORD</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">Misc:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">Added optional mask argument to all methods \r
-    for setting extended styles</font></li>\r
-    <li><font face="Arial" size="2">CMDIWindow::MDIRestore - fixed to send \r
-    WM_MDIRESTORE instead of WM_MDIICONARRANGE</font></li>\r
-    <li><font face="Arial" size="2">CListViewCtrl: Added SortItemsEx method</font></li>\r
-    <li><font face="Arial" size="2">CToolBarCtrl::GetButtonInfo - fixed to \r
-    return int instead of BOOL</font></li>\r
-    <li><font face="Arial" size="2">Added CToolBarCtrl::SetButtonSize and \r
-    SetBitmapSize that accept cx and cy instead of SIZE</font></li>\r
-    <li><font face="Arial" size="2">Printing: Changed how GetNewDevModeForPage \r
-    works (comments in code)</font></li>\r
-    <li><font face="Arial" size="2">CFileDialogImpl::_OnTypeChange incorrectly \r
-    calls pT-&gt;OnSelChange instead of pT-&gt;OnTypeChange</font></li>\r
-    <li><font face="Arial" size="2">CMultiPaneStatusBarCtrl::GetPaneTipText - \r
-    fixed to use index instead of and ID internally</font></li>\r
-    <li><font face="Arial" size="2">CWinDataExchange: Added references to \r
-    arguments of DoDataExchange, so there are no level 4 warning even if the map \r
-    is empty</font></li>\r
-    <li><font face="Arial" size="2">CPropertySheetWindow: Added new, IE 5.0 \r
-    specific methods</font></li>\r
-    <li><font face="Arial" size="2">CPropertyPageImpl: Added new, IE 5.0 \r
-    specific methods</font></li>\r
-  </ul>\r
-  <p style=margin:0in>&nbsp;</p>\r
-  <p style=margin:0in><font face="Arial" size="2">AppWizard:</font></p>\r
-  <ul style='margin-top:0in;margin-bottom:0in'>\r
-    <li><font face="Arial" size="2">added calls to RemoveMessageFilter and \r
-    RemoveIdleHandler in CMainFrame::OnDestroy for COM server projects</font></li>\r
-    <li><font face="Arial" size="2">added scroll bars for HTML view</font></li>\r
-    <li><font face="Arial" size="2">CAppServerModule now handles -embedding as \r
-    well as -automation</font></li>\r
-    <li><font face="Arial" size="2">corrected code in CMainFrame::OnShowToolBar \r
-    to correctly identify the toolbar in a rebar</font></li>\r
-    <li><font face="Arial" size="2">dialog based app code now derives from \r
-    CUpdateUI as public</font></li>\r
-  </ul>\r
-</blockquote>\r
-<p style=margin:0in>&nbsp;</p>\r
-\r
-<p style=margin:0in><font face="Arial" size="2">- end of readme.htm -</font></p>\r
-\r
-</body>\r
-\r
-</html>
\ No newline at end of file
diff --git a/boost_1_44_0.7z b/boost_1_44_0.7z
deleted file mode 100644 (file)
index 13a72fa..0000000
Binary files a/boost_1_44_0.7z and /dev/null differ
diff --git a/ffmpeg 0.5/include/changelog.txt b/ffmpeg 0.5/include/changelog.txt
deleted file mode 100644 (file)
index 0c05381..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-------------------------------------------------------------------------\r
-r21 | 2008-07-17 09:47:22 +0400 | 4 lines\r
-\r
-Get rid of these compiler warnings when compiling for 32-bit:\r
-  warning C4311: 'type cast' : pointer truncation from 'void *' to 'uintptr_t'\r
-  warning C4312: 'type cast' : conversion from 'uintptr_t' to 'const void *' of greater size\r
-\r
-------------------------------------------------------------------------\r
-r20 | 2007-10-09 16:54:27 +0400 | 2 lines\r
-\r
-Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.\r
-\r
-------------------------------------------------------------------------\r
-r19 | 2007-07-04 02:14:40 +0400 | 3 lines\r
-\r
-Explicitly cast to appropriate type INT8_MIN, INT16_MIN, INT32_MIN and INT64_MIN constants.\r
-Due to their unusual definition in Visual Studio headers (-_Ix_MAX-1) they are propagated to int and thus do not have expected type, causing VS6 strict compiler to claim about type inconsistency.\r
-\r
-------------------------------------------------------------------------\r
-r18 | 2007-06-26 16:53:23 +0400 | 2 lines\r
-\r
-Better handling of (U)INTx_C macros - now they generate constants of exact width.\r
-\r
-------------------------------------------------------------------------\r
-r17 | 2007-03-29 20:16:14 +0400 | 2 lines\r
-\r
-Fix typo: Miscrosoft -> Microsoft.\r
-\r
-------------------------------------------------------------------------\r
-r16 | 2007-02-24 17:32:58 +0300 | 4 lines\r
-\r
-Remove <BaseTsd.h> include, as it is not present in Visual Studio 2005 Epxress Edition and required only for INT_PTR and UINT_PTR types.\r
-\r
-'intptr_t' and 'uintptr_t' types now defined explicitly with #ifdef _WIN64.\r
-\r
-------------------------------------------------------------------------\r
-r15 | 2007-02-11 20:53:05 +0300 | 2 lines\r
-\r
-More correct fix for compilation under VS6.\r
-\r
-------------------------------------------------------------------------\r
-r14 | 2007-02-11 20:04:32 +0300 | 2 lines\r
-\r
-Bugfix: fix compiling under VS6, when stdint.h enclosed in 'extern "C" {}'.\r
-\r
-------------------------------------------------------------------------\r
-r13 | 2006-12-13 16:53:11 +0300 | 2 lines\r
-\r
-Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static.\r
-\r
-------------------------------------------------------------------------\r
-r12 | 2006-12-13 16:42:24 +0300 | 2 lines\r
-\r
-Error message changed: VC6 supported from now.\r
-\r
-------------------------------------------------------------------------\r
-r11 | 2006-12-13 16:39:33 +0300 | 2 lines\r
-\r
-All (U)INT* types changed to (unsigned) __int*. This should make stdint.h compatible with VC6.\r
-\r
-------------------------------------------------------------------------\r
-r10 | 2006-12-13 16:20:57 +0300 | 3 lines\r
-\r
-Added INLINE_IMAXDIV define switch. \r
-If INLINE_IMAXDIV is defined imaxdiv() have static modifier. If not - it is _inline.\r
-\r
-------------------------------------------------------------------------\r
-r9 | 2006-12-13 15:53:52 +0300 | 2 lines\r
-\r
-Error message for non-MSC compiler changed.\r
-\r
-------------------------------------------------------------------------\r
-r8 | 2006-12-13 12:47:48 +0300 | 2 lines\r
-\r
-Added #ifndef for SIZE_MAX (it is defined in limits.h on MSVSC 8).\r
-\r
-------------------------------------------------------------------------\r
-r7 | 2006-12-13 01:08:02 +0300 | 2 lines\r
-\r
-License chaged to BSD-derivative.\r
-\r
-------------------------------------------------------------------------\r
-r6 | 2006-12-13 00:53:20 +0300 | 2 lines\r
-\r
-Added <wchar.h> include to avoid warnings when it is included after stdint.h.\r
-\r
-------------------------------------------------------------------------\r
-r5 | 2006-12-12 00:58:05 +0300 | 2 lines\r
-\r
-BUGFIX: Definitions of INTPTR_MIN, INTPTR_MAX and UINTPTR_MAX for WIN32 and WIN64 was mixed up.\r
-\r
-------------------------------------------------------------------------\r
-r4 | 2006-12-12 00:51:55 +0300 | 2 lines\r
-\r
-Rise #error if _MSC_VER is not defined. I.e. compiler other then Microsoft Visual C++ is used.\r
-\r
-------------------------------------------------------------------------\r
-r3 | 2006-12-11 22:54:14 +0300 | 2 lines\r
-\r
-Added <limits.h> include to stdint.h.\r
-\r
-------------------------------------------------------------------------\r
-r2 | 2006-12-11 21:39:27 +0300 | 2 lines\r
-\r
-Initial check in.\r
-\r
-------------------------------------------------------------------------\r
-r1 | 2006-12-11 21:30:23 +0300 | 1 line\r
-\r
-Initial directory structure.\r
-------------------------------------------------------------------------\r
diff --git a/ffmpeg 0.5/include/ffmpeg/adler32.h b/ffmpeg 0.5/include/ffmpeg/adler32.h
deleted file mode 100644 (file)
index 223cbfd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * copyright (c) 2006 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef ADLER32_H
-#define ADLER32_H
-
-#include <stdint.h>
-
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
-                                unsigned int len);
-
-#endif
diff --git a/ffmpeg 0.5/include/ffmpeg/avcodec.h b/ffmpeg 0.5/include/ffmpeg/avcodec.h
deleted file mode 100644 (file)
index 1432a2a..0000000
+++ /dev/null
@@ -1,2935 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H
-#define AVCODEC_H
-
-/**
- * @file avcodec.h
- * external API header
- */
-
-
-#include "avutil.h"
-#include <sys/types.h> /* size_t */
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define LIBAVCODEC_VERSION_INT  ((51<<16)+(45<<8)+0)
-#define LIBAVCODEC_VERSION      51.45.0
-#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
-
-#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
-
-#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
-#define AV_TIME_BASE            1000000
-#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
-
-/**
- * Identifies the syntax and semantics of the bitstream.
- * The principle is roughly:
- * Two decoders with the same ID can decode the same streams.
- * Two encoders with the same ID can encode compatible streams.
- * There may be slight deviations from the principle due to implementation
- * details.
- *
- * If you add a codec ID to this list, add it so that
- * 1. no value of a existing codec ID changes (that would break ABI),
- * 2. it is as close as possible to similar codecs.
- */
-enum CodecID {
-    CODEC_ID_NONE,
-    CODEC_ID_MPEG1VIDEO,
-    CODEC_ID_MPEG2VIDEO, /* preferred ID for MPEG-1/2 video decoding */
-    CODEC_ID_MPEG2VIDEO_XVMC,
-    CODEC_ID_H261,
-    CODEC_ID_H263,
-    CODEC_ID_RV10,
-    CODEC_ID_RV20,
-    CODEC_ID_MJPEG,
-    CODEC_ID_MJPEGB,
-    CODEC_ID_LJPEG,
-    CODEC_ID_SP5X,
-    CODEC_ID_JPEGLS,
-    CODEC_ID_MPEG4,
-    CODEC_ID_RAWVIDEO,
-    CODEC_ID_MSMPEG4V1,
-    CODEC_ID_MSMPEG4V2,
-    CODEC_ID_MSMPEG4V3,
-    CODEC_ID_WMV1,
-    CODEC_ID_WMV2,
-    CODEC_ID_H263P,
-    CODEC_ID_H263I,
-    CODEC_ID_FLV1,
-    CODEC_ID_SVQ1,
-    CODEC_ID_SVQ3,
-    CODEC_ID_DVVIDEO,
-    CODEC_ID_HUFFYUV,
-    CODEC_ID_CYUV,
-    CODEC_ID_H264,
-    CODEC_ID_INDEO3,
-    CODEC_ID_VP3,
-    CODEC_ID_THEORA,
-    CODEC_ID_ASV1,
-    CODEC_ID_ASV2,
-    CODEC_ID_FFV1,
-    CODEC_ID_4XM,
-    CODEC_ID_VCR1,
-    CODEC_ID_CLJR,
-    CODEC_ID_MDEC,
-    CODEC_ID_ROQ,
-    CODEC_ID_INTERPLAY_VIDEO,
-    CODEC_ID_XAN_WC3,
-    CODEC_ID_XAN_WC4,
-    CODEC_ID_RPZA,
-    CODEC_ID_CINEPAK,
-    CODEC_ID_WS_VQA,
-    CODEC_ID_MSRLE,
-    CODEC_ID_MSVIDEO1,
-    CODEC_ID_IDCIN,
-    CODEC_ID_8BPS,
-    CODEC_ID_SMC,
-    CODEC_ID_FLIC,
-    CODEC_ID_TRUEMOTION1,
-    CODEC_ID_VMDVIDEO,
-    CODEC_ID_MSZH,
-    CODEC_ID_ZLIB,
-    CODEC_ID_QTRLE,
-    CODEC_ID_SNOW,
-    CODEC_ID_TSCC,
-    CODEC_ID_ULTI,
-    CODEC_ID_QDRAW,
-    CODEC_ID_VIXL,
-    CODEC_ID_QPEG,
-    CODEC_ID_XVID,
-    CODEC_ID_PNG,
-    CODEC_ID_PPM,
-    CODEC_ID_PBM,
-    CODEC_ID_PGM,
-    CODEC_ID_PGMYUV,
-    CODEC_ID_PAM,
-    CODEC_ID_FFVHUFF,
-    CODEC_ID_RV30,
-    CODEC_ID_RV40,
-    CODEC_ID_VC1,
-    CODEC_ID_WMV3,
-    CODEC_ID_LOCO,
-    CODEC_ID_WNV1,
-    CODEC_ID_AASC,
-    CODEC_ID_INDEO2,
-    CODEC_ID_FRAPS,
-    CODEC_ID_TRUEMOTION2,
-    CODEC_ID_BMP,
-    CODEC_ID_CSCD,
-    CODEC_ID_MMVIDEO,
-    CODEC_ID_ZMBV,
-    CODEC_ID_AVS,
-    CODEC_ID_SMACKVIDEO,
-    CODEC_ID_NUV,
-    CODEC_ID_KMVC,
-    CODEC_ID_FLASHSV,
-    CODEC_ID_CAVS,
-    CODEC_ID_JPEG2000,
-    CODEC_ID_VMNC,
-    CODEC_ID_VP5,
-    CODEC_ID_VP6,
-    CODEC_ID_VP6F,
-    CODEC_ID_TARGA,
-    CODEC_ID_DSICINVIDEO,
-    CODEC_ID_TIERTEXSEQVIDEO,
-    CODEC_ID_TIFF,
-    CODEC_ID_GIF,
-    CODEC_ID_FFH264,
-    CODEC_ID_DXA,
-    CODEC_ID_DNXHD,
-    CODEC_ID_THP,
-    CODEC_ID_SGI,
-    CODEC_ID_C93,
-    CODEC_ID_BETHSOFTVID,
-    CODEC_ID_PTX,
-    CODEC_ID_TXD,
-    CODEC_ID_VP6A,
-    CODEC_ID_AMV,
-
-    /* various PCM "codecs" */
-    CODEC_ID_PCM_S16LE= 0x10000,
-    CODEC_ID_PCM_S16BE,
-    CODEC_ID_PCM_U16LE,
-    CODEC_ID_PCM_U16BE,
-    CODEC_ID_PCM_S8,
-    CODEC_ID_PCM_U8,
-    CODEC_ID_PCM_MULAW,
-    CODEC_ID_PCM_ALAW,
-    CODEC_ID_PCM_S32LE,
-    CODEC_ID_PCM_S32BE,
-    CODEC_ID_PCM_U32LE,
-    CODEC_ID_PCM_U32BE,
-    CODEC_ID_PCM_S24LE,
-    CODEC_ID_PCM_S24BE,
-    CODEC_ID_PCM_U24LE,
-    CODEC_ID_PCM_U24BE,
-    CODEC_ID_PCM_S24DAUD,
-    CODEC_ID_PCM_ZORK,
-
-    /* various ADPCM codecs */
-    CODEC_ID_ADPCM_IMA_QT= 0x11000,
-    CODEC_ID_ADPCM_IMA_WAV,
-    CODEC_ID_ADPCM_IMA_DK3,
-    CODEC_ID_ADPCM_IMA_DK4,
-    CODEC_ID_ADPCM_IMA_WS,
-    CODEC_ID_ADPCM_IMA_SMJPEG,
-    CODEC_ID_ADPCM_MS,
-    CODEC_ID_ADPCM_4XM,
-    CODEC_ID_ADPCM_XA,
-    CODEC_ID_ADPCM_ADX,
-    CODEC_ID_ADPCM_EA,
-    CODEC_ID_ADPCM_G726,
-    CODEC_ID_ADPCM_CT,
-    CODEC_ID_ADPCM_SWF,
-    CODEC_ID_ADPCM_YAMAHA,
-    CODEC_ID_ADPCM_SBPRO_4,
-    CODEC_ID_ADPCM_SBPRO_3,
-    CODEC_ID_ADPCM_SBPRO_2,
-    CODEC_ID_ADPCM_THP,
-    CODEC_ID_ADPCM_IMA_AMV,
-
-    /* AMR */
-    CODEC_ID_AMR_NB= 0x12000,
-    CODEC_ID_AMR_WB,
-
-    /* RealAudio codecs*/
-    CODEC_ID_RA_144= 0x13000,
-    CODEC_ID_RA_288,
-
-    /* various DPCM codecs */
-    CODEC_ID_ROQ_DPCM= 0x14000,
-    CODEC_ID_INTERPLAY_DPCM,
-    CODEC_ID_XAN_DPCM,
-    CODEC_ID_SOL_DPCM,
-
-    CODEC_ID_MP2= 0x15000,
-    CODEC_ID_MP3, /* preferred ID for decoding MPEG audio layer 1, 2 or 3 */
-    CODEC_ID_AAC,
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-    CODEC_ID_MPEG4AAC,
-#endif
-    CODEC_ID_AC3,
-    CODEC_ID_DTS,
-    CODEC_ID_VORBIS,
-    CODEC_ID_DVAUDIO,
-    CODEC_ID_WMAV1,
-    CODEC_ID_WMAV2,
-    CODEC_ID_MACE3,
-    CODEC_ID_MACE6,
-    CODEC_ID_VMDAUDIO,
-    CODEC_ID_SONIC,
-    CODEC_ID_SONIC_LS,
-    CODEC_ID_FLAC,
-    CODEC_ID_MP3ADU,
-    CODEC_ID_MP3ON4,
-    CODEC_ID_SHORTEN,
-    CODEC_ID_ALAC,
-    CODEC_ID_WESTWOOD_SND1,
-    CODEC_ID_GSM, /* as in Berlin toast format */
-    CODEC_ID_QDM2,
-    CODEC_ID_COOK,
-    CODEC_ID_TRUESPEECH,
-    CODEC_ID_TTA,
-    CODEC_ID_SMACKAUDIO,
-    CODEC_ID_QCELP,
-    CODEC_ID_WAVPACK,
-    CODEC_ID_DSICINAUDIO,
-    CODEC_ID_IMC,
-    CODEC_ID_MUSEPACK7,
-    CODEC_ID_MLP,
-    CODEC_ID_GSM_MS, /* as found in WAV */
-    CODEC_ID_ATRAC3,
-    CODEC_ID_VOXWARE,
-    CODEC_ID_APE,
-
-    /* subtitle codecs */
-    CODEC_ID_DVD_SUBTITLE= 0x17000,
-    CODEC_ID_DVB_SUBTITLE,
-    CODEC_ID_TEXT,  /* raw UTF-8 text */
-    CODEC_ID_XSUB,
-
-    CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG-2 TS
-                                * stream (only used by libavformat) */
-};
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/* CODEC_ID_MP3LAME is obsolete */
-#define CODEC_ID_MP3LAME CODEC_ID_MP3
-#define CODEC_ID_MPEG4AAC CODEC_ID_AAC
-#endif
-
-enum CodecType {
-    CODEC_TYPE_UNKNOWN = -1,
-    CODEC_TYPE_VIDEO,
-    CODEC_TYPE_AUDIO,
-    CODEC_TYPE_DATA,
-    CODEC_TYPE_SUBTITLE,
-    CODEC_TYPE_NB
-};
-
-/* Currently unused, may be used if 24/32 bits samples are ever supported. */
-/* all in native-endian format */
-enum SampleFormat {
-    SAMPLE_FMT_NONE = -1,
-    SAMPLE_FMT_U8,              ///< unsigned 8 bits
-    SAMPLE_FMT_S16,             ///< signed 16 bits
-    SAMPLE_FMT_S24,             ///< signed 24 bits
-    SAMPLE_FMT_S32,             ///< signed 32 bits
-    SAMPLE_FMT_FLT,             ///< float
-};
-
-/* in bytes */
-#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-
-/**
- * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * This is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end.<br>
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged
- * MPEG bitstreams could cause overread and segfault.
- */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-
-/**
- * minimum encoding buffer size
- * Used to avoid some checks during header writing.
- */
-#define FF_MIN_BUFFER_SIZE 16384
-
-/* motion estimation type, EPZS by default */
-enum Motion_Est_ID {
-    ME_ZERO = 1,
-    ME_FULL,
-    ME_LOG,
-    ME_PHODS,
-    ME_EPZS,
-    ME_X1,
-    ME_HEX,
-    ME_UMH,
-    ME_ITER,
-};
-
-enum AVDiscard{
-    /* We leave some space between them for extensions (drop some
-     * keyframes for intra-only or drop just some bidir frames). */
-    AVDISCARD_NONE   =-16, ///< discard nothing
-    AVDISCARD_DEFAULT=  0, ///< discard useless packets like 0 size packets in avi
-    AVDISCARD_NONREF =  8, ///< discard all non reference
-    AVDISCARD_BIDIR  = 16, ///< discard all bidirectional frames
-    AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
-    AVDISCARD_ALL    = 48, ///< discard all
-};
-
-typedef struct RcOverride{
-    int start_frame;
-    int end_frame;
-    int qscale; // If this is 0 then quality_factor will be used instead.
-    float quality_factor;
-} RcOverride;
-
-#define FF_MAX_B_FRAMES 16
-
-/* encoding support
-   These flags can be passed in AVCodecContext.flags before initialization.
-   Note: Not everything is supported yet.
-*/
-
-#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
-#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
-#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
-#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
-#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
-#define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
-/* The parent program guarantees that the input for B-frames containing
- * streams is not written to for at least s->max_b_frames+1 frames, if
- * this is not set the input will be copied. */
-#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
-#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
-#define CODEC_FLAG_EXTERN_HUFF     0x1000   ///< Use external Huffman table (for MJPEG).
-#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
-#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
-#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
-#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
-                                                  location instead of only at frame boundaries. */
-#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
-#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
-#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
-#define CODEC_FLAG_TRELLIS_QUANT  0x00200000 ///< Use trellis quantization.
-#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
-#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-#define CODEC_FLAG_H263P_AIC      0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction (remove this)
-#endif
-#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
-#define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
-#define CODEC_FLAG_CBP_RD         0x04000000 ///< Use rate distortion optimization for cbp.
-#define CODEC_FLAG_QP_RD          0x08000000 ///< Use rate distortion optimization for qp selectioon.
-#define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
-#define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
-#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
-#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
-#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
-#define CODEC_FLAG_CLOSED_GOP     ((int)0x80000000)
-#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
-#define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< Strictly enforce GOP size.
-#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
-#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
-#define CODEC_FLAG2_BPYRAMID      0x00000010 ///< H.264 allow B-frames to be used as references.
-#define CODEC_FLAG2_WPRED         0x00000020 ///< H.264 weighted biprediction for B-frames
-#define CODEC_FLAG2_MIXED_REFS    0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
-#define CODEC_FLAG2_8X8DCT        0x00000080 ///< H.264 high profile 8x8 transform
-#define CODEC_FLAG2_FASTPSKIP     0x00000100 ///< H.264 fast pskip
-#define CODEC_FLAG2_AUD           0x00000200 ///< H.264 access unit delimiters
-#define CODEC_FLAG2_BRDO          0x00000400 ///< B-frame rate-distortion optimization
-#define CODEC_FLAG2_INTRA_VLC     0x00000800 ///< Use MPEG-2 intra VLC table.
-#define CODEC_FLAG2_MEMC_ONLY     0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
-#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
-#define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
-#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
-#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
-
-/* Unsupported options :
- *              Syntax Arithmetic coding (SAC)
- *              Reference Picture Selection
- *              Independent Segment Decoding */
-/* /Fx */
-/* codec capabilities */
-
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
-/**
- * Codec uses get_buffer() for allocating buffers.
- * direct rendering method 1
- */
-#define CODEC_CAP_DR1             0x0002
-/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
-#define CODEC_CAP_PARSE_ONLY      0x0004
-#define CODEC_CAP_TRUNCATED       0x0008
-/* Codec can export data for HW decoding (XvMC). */
-#define CODEC_CAP_HWACCEL         0x0010
-/**
- * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
- * If this is not set, the codec is guaranteed to never be fed with NULL data.
- */
-#define CODEC_CAP_DELAY           0x0020
-/**
- * Codec can be fed a final frame with a smaller size.
- * This can be used to prevent truncation of the last audio samples.
- */
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
-
-//The following defines may change, don't expect compatibility if you use them.
-#define MB_TYPE_INTRA4x4   0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16      0x0008
-#define MB_TYPE_16x8       0x0010
-#define MB_TYPE_8x16       0x0020
-#define MB_TYPE_8x8        0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2    0x0100 //FIXME
-#define MB_TYPE_ACPRED     0x0200
-#define MB_TYPE_GMC        0x0400
-#define MB_TYPE_SKIP       0x0800
-#define MB_TYPE_P0L0       0x1000
-#define MB_TYPE_P1L0       0x2000
-#define MB_TYPE_P0L1       0x4000
-#define MB_TYPE_P1L1       0x8000
-#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
-#define MB_TYPE_QUANT      0x00010000
-#define MB_TYPE_CBP        0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
-
-/**
- * Pan Scan area.
- * This specifies the area which should be displayed.
- * Note there may be multiple such areas for one frame.
- */
-typedef struct AVPanScan{
-    /**
-     * id
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int id;
-
-    /**
-     * width and height in 1/16 pel
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int width;
-    int height;
-
-    /**
-     * position of the top left corner in 1/16 pel for up to 3 fields/frames
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int16_t position[3][2];
-}AVPanScan;
-
-#define FF_COMMON_FRAME \
-    /**\
-     * pointer to the picture planes.\
-     * This might be different from the first allocated byte\
-     * - encoding: \
-     * - decoding: \
-     */\
-    uint8_t *data[4];\
-    int linesize[4];\
-    /**\
-     * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
-     * This isn't used by libavcodec unless the default get/release_buffer() is used.\
-     * - encoding: \
-     * - decoding: \
-     */\
-    uint8_t *base[4];\
-    /**\
-     * 1 -> keyframe, 0-> not\
-     * - encoding: Set by libavcodec.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int key_frame;\
-\
-    /**\
-     * Picture type of the frame, see ?_TYPE below.\
-     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
-     * - decoding: Set by libavcodec.\
-     */\
-    int pict_type;\
-\
-    /**\
-     * presentation timestamp in time_base units (time when frame should be shown to user)\
-     * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
-     * - encoding: MUST be set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int64_t pts;\
-\
-    /**\
-     * picture number in bitstream order\
-     * - encoding: set by\
-     * - decoding: Set by libavcodec.\
-     */\
-    int coded_picture_number;\
-    /**\
-     * picture number in display order\
-     * - encoding: set by\
-     * - decoding: Set by libavcodec.\
-     */\
-    int display_picture_number;\
-\
-    /**\
-     * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
-     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
-     * - decoding: Set by libavcodec.\
-     */\
-    int quality; \
-\
-    /**\
-     * buffer age (1->was last buffer and dint change, 2->..., ...).\
-     * Set to INT_MAX if the buffer has not been used yet.\
-     * - encoding: unused\
-     * - decoding: MUST be set by get_buffer().\
-     */\
-    int age;\
-\
-    /**\
-     * is this picture used as reference\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec. (before get_buffer() call)).\
-     */\
-    int reference;\
-\
-    /**\
-     * QP table\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int8_t *qscale_table;\
-    /**\
-     * QP store stride\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int qstride;\
-\
-    /**\
-     * mbskip_table[mb]>=1 if MB didn't change\
-     * stride= mb_width = (width+15)>>4\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint8_t *mbskip_table;\
-\
-    /**\
-     * motion vector table\
-     * @code\
-     * example:\
-     * int mv_sample_log2= 4 - motion_subsample_log2;\
-     * int mb_width= (width+15)>>4;\
-     * int mv_stride= (mb_width << mv_sample_log2) + 1;\
-     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
-     * @endcode\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int16_t (*motion_val[2])[2];\
-\
-    /**\
-     * macroblock type table\
-     * mb_type_base + mb_width + 2\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint32_t *mb_type;\
-\
-    /**\
-     * log2 of the size of the block which a single vector in motion_val represents: \
-     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint8_t motion_subsample_log2;\
-\
-    /**\
-     * for some private data of the user\
-     * - encoding: unused\
-     * - decoding: Set by user.\
-     */\
-    void *opaque;\
-\
-    /**\
-     * error\
-     * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\
-     * - decoding: unused\
-     */\
-    uint64_t error[4];\
-\
-    /**\
-     * type of the buffer (to keep track of who has to deallocate data[*])\
-     * - encoding: Set by the one who allocates it.\
-     * - decoding: Set by the one who allocates it.\
-     * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\
-     */\
-    int type;\
-    \
-    /**\
-     * When decoding, this signals how much the picture must be delayed.\
-     * extra_delay = repeat_pict / (2*fps)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int repeat_pict;\
-    \
-    /**\
-     * \
-     */\
-    int qscale_type;\
-    \
-    /**\
-     * The content of the picture is interlaced.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec. (default 0)\
-     */\
-    int interlaced_frame;\
-    \
-    /**\
-     * If the content is interlaced, is top field displayed first.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int top_field_first;\
-    \
-    /**\
-     * Pan scan.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    AVPanScan *pan_scan;\
-    \
-    /**\
-     * Tell user application that palette has changed from previous frame.\
-     * - encoding: ??? (no palette-enabled encoder yet)\
-     * - decoding: Set by libavcodec. (default 0).\
-     */\
-    int palette_has_changed;\
-    \
-    /**\
-     * codec suggestion on buffer type if != 0\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec. (before get_buffer() call)).\
-     */\
-    int buffer_hints;\
-\
-    /**\
-     * DCT coefficients\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    short *dct_coeff;\
-\
-    /**\
-     * motion referece frame index\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int8_t *ref_index[2];
-
-#define FF_QSCALE_TYPE_MPEG1 0
-#define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264  2
-
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
-#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
-
-
-#define FF_I_TYPE  1 // Intra
-#define FF_P_TYPE  2 // Predicted
-#define FF_B_TYPE  3 // Bi-dir predicted
-#define FF_S_TYPE  4 // S(GMC)-VOP MPEG4
-#define FF_SI_TYPE 5
-#define FF_SP_TYPE 6
-
-#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
-
-/**
- * Audio Video Frame.
- */
-typedef struct AVFrame {
-    FF_COMMON_FRAME
-} AVFrame;
-
-#define DEFAULT_FRAME_RATE_BASE 1001000
-
-/**
- * main external API structure
- */
-typedef struct AVCodecContext {
-    /**
-     * information on struct for av_log
-     * - set by avcodec_alloc_context
-     */
-    AVClass *av_class;
-    /**
-     * the average bitrate
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
-     */
-    int bit_rate;
-
-    /**
-     * number of bits the bitstream is allowed to diverge from the reference.
-     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: unused
-     */
-    int bit_rate_tolerance;
-
-    /**
-     * CODEC_FLAG_*.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags;
-
-    /**
-     * Some codecs need additional format info. It is stored here.
-     * If any muxer uses this then ALL demuxers/parsers AND encoders for the
-     * specific codec MUST set it correctly otherwise stream copy breaks.
-     * In general use of this field by muxers is not recommanded.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec. (FIXME: Is this OK?)
-     */
-    int sub_id;
-
-    /**
-     * Motion estimation algorithm used for video coding.
-     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
-     * 8 (umh), 9 (iter) [7, 8 are x264 specific, 9 is snow specific]
-     * - encoding: MUST be set by user.
-     * - decoding: unused
-     */
-    int me_method;
-
-    /**
-     * some codecs need / can use extradata like Huffman tables.
-     * mjpeg: Huffman tables
-     * rv10: additional flags
-     * mpeg4: global headers (they can be in the bitstream or here)
-     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
-     * than extradata_size to avoid prolems if it is read with the bitstream reader.
-     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
-     * - encoding: Set/allocated/freed by libavcodec.
-     * - decoding: Set/allocated/freed by user.
-     */
-    uint8_t *extradata;
-    int extradata_size;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identically 1.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational time_base;
-
-    /* video only */
-    /**
-     * picture width / height.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     * Note: For compatibility it is possible to set this instead of
-     * coded_width/height before decoding.
-     */
-    int width, height;
-
-#define FF_ASPECT_EXTENDED 15
-
-    /**
-     * the number of pictures in a group of pictures, or 0 for intra_only
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int gop_size;
-
-    /**
-     * Pixel format, see PIX_FMT_xxx.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum PixelFormat pix_fmt;
-
-    /**
-     * Frame rate emulation. If not zero, the lower layer (i.e. format handler)
-     * has to read frames at native frame rate.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rate_emu;
-
-    /**
-     * If non NULL, 'draw_horiz_band' is called by the libavcodec
-     * decoder to draw a horizontal band. It improves cache usage. Not
-     * all codecs can do that. You must check the codec capabilities
-     * beforehand.
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @param height the height of the slice
-     * @param y the y position of the slice
-     * @param type 1->top field, 2->bottom field, 3->frame
-     * @param offset offset into the AVFrame.data from which the slice should be read
-     */
-    void (*draw_horiz_band)(struct AVCodecContext *s,
-                            const AVFrame *src, int offset[4],
-                            int y, int type, int height);
-
-    /* audio only */
-    int sample_rate; ///< samples per second
-    int channels;
-
-    /**
-     * audio sample format
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum SampleFormat sample_fmt;  ///< sample format, currently unused
-
-    /* The following data should not be initialized. */
-    /**
-     * Samples per packet, initialized when calling 'init'.
-     */
-    int frame_size;
-    int frame_number;   ///< audio or video frame number
-    int real_pict_num;  ///< Returns the real picture number of previous encoded frame.
-
-    /**
-     * Number of frames the decoded output will be delayed relative to
-     * the encoded input.
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int delay;
-
-    /* - encoding parameters */
-    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
-    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
-
-    /**
-     * minimum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmin;
-
-    /**
-     * maximum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmax;
-
-    /**
-     * maximum quantizer difference between frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_qdiff;
-
-    /**
-     * maximum number of B-frames between non-B-frames
-     * Note: The output will be delayed by max_b_frames+1 relative to the input.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_b_frames;
-
-    /**
-     * qscale factor between IP and B-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_factor;
-
-    /** obsolete FIXME remove */
-    int rc_strategy;
-#define FF_RC_STRATEGY_XVID 1
-
-    int b_frame_strategy;
-
-    /**
-     * hurry up amount
-     * - encoding: unused
-     * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
-     * @deprecated Deprecated in favor of skip_idct and skip_frame.
-     */
-    int hurry_up;
-
-    struct AVCodec *codec;
-
-    void *priv_data;
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-    /* unused, FIXME remove*/
-    int rtp_mode;
-#endif
-
-    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
-                            /* do its best to deliver a chunk with size     */
-                            /* below rtp_payload_size, the chunk will start */
-                            /* with a start code on some codecs like H.263. */
-                            /* This doesn't take account of any particular  */
-                            /* headers inside the transmitted RTP payload.  */
-
-
-    /* The RTP callback: This function is called    */
-    /* every time the encoder has a packet to send. */
-    /* It depends on the encoder if the data starts */
-    /* with a Start Code (it should). H.263 does.   */
-    /* mb_nb contains the number of macroblocks     */
-    /* encoded in the RTP payload.                  */
-    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
-
-    /* statistics, used for 2-pass encoding */
-    int mv_bits;
-    int header_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int i_count;
-    int p_count;
-    int skip_count;
-    int misc_bits;
-
-    /**
-     * number of bits used for the previously encoded frame
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int frame_bits;
-
-    /**
-     * Private data of the user, can be used to carry app specific stuff.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    void *opaque;
-
-    char codec_name[32];
-    enum CodecType codec_type; /* see CODEC_TYPE_xxx */
-    enum CodecID codec_id; /* see CODEC_ID_xxx */
-
-    /**
-     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * A demuxer should set this to what is stored in the field used to identify the codec.
-     * If there are multiple such fields in a container then the demuxer should choose the one
-     * which maximizes the information about the used codec.
-     * If the codec tag field in a container is larger then 32 bits then the demuxer should
-     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
-     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
-     * first.
-     * - encoding: Set by user, if not then the default based on codec_id will be used.
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int codec_tag;
-
-    /**
-     * Work around bugs in encoders which sometimes cannot be detected automatically.
-     * - encoding: Set by user
-     * - decoding: Set by user
-     */
-    int workaround_bugs;
-#define FF_BUG_AUTODETECT       1  ///< autodetection
-#define FF_BUG_OLD_MSMPEG4      2
-#define FF_BUG_XVID_ILACE       4
-#define FF_BUG_UMP4             8
-#define FF_BUG_NO_PADDING       16
-#define FF_BUG_AMV              32
-#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
-#define FF_BUG_QPEL_CHROMA      64
-#define FF_BUG_STD_QPEL         128
-#define FF_BUG_QPEL_CHROMA2     256
-#define FF_BUG_DIRECT_BLOCKSIZE 512
-#define FF_BUG_EDGE             1024
-#define FF_BUG_HPEL_CHROMA      2048
-#define FF_BUG_DC_CLIP          4096
-#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
-//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
-
-    /**
-     * luma single coefficient elimination threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int luma_elim_threshold;
-
-    /**
-     * chroma single coeff elimination threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chroma_elim_threshold;
-
-    /**
-     * strictly follow the standard (MPEG4, ...).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int strict_std_compliance;
-#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to a older more strict version of the spec or reference software.
-#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
-#define FF_COMPLIANCE_NORMAL        0
-#define FF_COMPLIANCE_INOFFICIAL   -1 ///< Allow inofficial extensions.
-#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
-
-    /**
-     * qscale offset between IP and B-frames
-     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_offset;
-
-    /**
-     * Error resilience; higher values will detect more errors but may
-     * misdetect some more or less valid parts as errors.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_resilience;
-#define FF_ER_CAREFUL         1
-#define FF_ER_COMPLIANT       2
-#define FF_ER_AGGRESSIVE      3
-#define FF_ER_VERY_AGGRESSIVE 4
-
-    /**
-     * Called at the beginning of each frame to get a buffer for it.
-     * If pic.reference is set then the frame will be read later by libavcodec.
-     * avcodec_align_dimensions() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     * - encoding: unused
-     * - decoding: Set by libavcodec., user can override.
-     */
-    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called to release buffers which where allocated with get_buffer.
-     * A released buffer can be reused in get_buffer().
-     * pic.data[*] must be set to NULL.
-     * - encoding: unused
-     * - decoding: Set by libavcodec., user can override.
-     */
-    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * If 1 the stream has a 1 frame delay during decoding.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int has_b_frames;
-
-    /**
-     * number of bytes per packet if constant and known or 0
-     * Used by some WAV based audio codecs.
-     */
-    int block_align;
-
-    int parse_only; /* - decoding only: If true, only parsing is done
-                       (function avcodec_parse_frame()). The frame
-                       data is returned. Only MPEG codecs support this now. */
-
-    /**
-     * 0-> h263 quant 1-> mpeg quant
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mpeg_quant;
-
-    /**
-     * pass1 encoding statistics output buffer
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    char *stats_out;
-
-    /**
-     * pass2 encoding statistics input buffer
-     * Concatenated stuff from stats_out of pass1 should be placed here.
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    char *stats_in;
-
-    /**
-     * ratecontrol qmin qmax limiting method
-     * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_qsquish;
-
-    float rc_qmod_amp;
-    int rc_qmod_freq;
-
-    /**
-     * ratecontrol override, see RcOverride
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    RcOverride *rc_override;
-    int rc_override_count;
-
-    /**
-     * rate control equation
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    char *rc_eq;
-
-    /**
-     * maximum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_max_rate;
-
-    /**
-     * minimum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_min_rate;
-
-    /**
-     * decoder bitstream buffer size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_buffer_size;
-    float rc_buffer_aggressivity;
-
-    /**
-     * qscale factor between P and I-frames
-     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_factor;
-
-    /**
-     * qscale offset between P and I-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_offset;
-
-    /**
-     * initial complexity for pass1 ratecontrol
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_initial_cplx;
-
-    /**
-     * DCT algorithm, see FF_DCT_* below
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dct_algo;
-#define FF_DCT_AUTO    0
-#define FF_DCT_FASTINT 1
-#define FF_DCT_INT     2
-#define FF_DCT_MMX     3
-#define FF_DCT_MLIB    4
-#define FF_DCT_ALTIVEC 5
-#define FF_DCT_FAAN    6
-
-    /**
-     * luminance masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float lumi_masking;
-
-    /**
-     * temporary complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float temporal_cplx_masking;
-
-    /**
-     * spatial complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float spatial_cplx_masking;
-
-    /**
-     * p block masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float p_masking;
-
-    /**
-     * darkness masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float dark_masking;
-
-
-    /* for binary compatibility */
-    int unused;
-
-    /**
-     * IDCT algorithm, see FF_IDCT_* below.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int idct_algo;
-#define FF_IDCT_AUTO          0
-#define FF_IDCT_INT           1
-#define FF_IDCT_SIMPLE        2
-#define FF_IDCT_SIMPLEMMX     3
-#define FF_IDCT_LIBMPEG2MMX   4
-#define FF_IDCT_PS2           5
-#define FF_IDCT_MLIB          6
-#define FF_IDCT_ARM           7
-#define FF_IDCT_ALTIVEC       8
-#define FF_IDCT_SH4           9
-#define FF_IDCT_SIMPLEARM     10
-#define FF_IDCT_H264          11
-#define FF_IDCT_VP3           12
-#define FF_IDCT_IPP           13
-#define FF_IDCT_XVIDMMX       14
-#define FF_IDCT_CAVS          15
-#define FF_IDCT_SIMPLEARMV5TE 16
-#define FF_IDCT_SIMPLEARMV6   17
-#define FF_IDCT_SIMPLEVIS     18
-
-    /**
-     * slice count
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user (or 0).
-     */
-    int slice_count;
-    /**
-     * slice offsets in the frame in bytes
-     * - encoding: Set/allocated by libavcodec.
-     * - decoding: Set/allocated by user (or NULL).
-     */
-    int *slice_offset;
-
-    /**
-     * error concealment flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_concealment;
-#define FF_EC_GUESS_MVS   1
-#define FF_EC_DEBLOCK     2
-
-    /**
-     * dsp_mask could be add used to disable unwanted CPU features
-     * CPU features (i.e. MMX, SSE. ...)
-     *
-     * With the FORCE flag you may instead enable given CPU features.
-     * (Dangerous: Usable in case of misdetection, improper usage however will
-     * result into program crash.)
-     */
-    unsigned dsp_mask;
-#define FF_MM_FORCE    0x80000000 /* Force usage of selected flags (OR) */
-    /* lower 16 bits - CPU features */
-#define FF_MM_MMX      0x0001 /* standard MMX */
-#define FF_MM_3DNOW    0x0004 /* AMD 3DNOW */
-#define FF_MM_MMXEXT   0x0002 /* SSE integer functions or AMD MMX ext */
-#define FF_MM_SSE      0x0008 /* SSE functions */
-#define FF_MM_SSE2     0x0010 /* PIV SSE2 functions */
-#define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
-#define FF_MM_SSE3     0x0040 /* Prescott SSE3 functions */
-#define FF_MM_SSSE3    0x0080 /* Conroe SSSE3 functions */
-#define FF_MM_IWMMXT   0x0100 /* XScale IWMMXT */
-
-    /**
-     * bits per sample/pixel from the demuxer (needed for huffyuv).
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user.
-     */
-     int bits_per_sample;
-
-    /**
-     * prediction method (needed for huffyuv)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int prediction_method;
-#define FF_PRED_LEFT   0
-#define FF_PRED_PLANE  1
-#define FF_PRED_MEDIAN 2
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * the picture in the bitstream
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    AVFrame *coded_frame;
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug;
-#define FF_DEBUG_PICT_INFO   1
-#define FF_DEBUG_RC          2
-#define FF_DEBUG_BITSTREAM   4
-#define FF_DEBUG_MB_TYPE     8
-#define FF_DEBUG_QP          16
-#define FF_DEBUG_MV          32
-#define FF_DEBUG_DCT_COEFF   0x00000040
-#define FF_DEBUG_SKIP        0x00000080
-#define FF_DEBUG_STARTCODE   0x00000100
-#define FF_DEBUG_PTS         0x00000200
-#define FF_DEBUG_ER          0x00000400
-#define FF_DEBUG_MMCO        0x00000800
-#define FF_DEBUG_BUGS        0x00001000
-#define FF_DEBUG_VIS_QP      0x00002000
-#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-
-    /**
-     * error
-     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
-     * - decoding: unused
-     */
-    uint64_t error[4];
-
-    /**
-     * minimum MB quantizer
-     * - encoding: unused
-     * - decoding: unused
-     */
-    int mb_qmin;
-
-    /**
-     * maximum MB quantizer
-     * - encoding: unused
-     * - decoding: unused
-     */
-    int mb_qmax;
-
-    /**
-     * motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_cmp;
-    /**
-     * subpixel motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_sub_cmp;
-    /**
-     * macroblock comparison function (not supported yet)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_cmp;
-    /**
-     * interlaced DCT comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int ildct_cmp;
-#define FF_CMP_SAD    0
-#define FF_CMP_SSE    1
-#define FF_CMP_SATD   2
-#define FF_CMP_DCT    3
-#define FF_CMP_PSNR   4
-#define FF_CMP_BIT    5
-#define FF_CMP_RD     6
-#define FF_CMP_ZERO   7
-#define FF_CMP_VSAD   8
-#define FF_CMP_VSSE   9
-#define FF_CMP_NSSE   10
-#define FF_CMP_W53    11
-#define FF_CMP_W97    12
-#define FF_CMP_DCTMAX 13
-#define FF_CMP_DCT264 14
-#define FF_CMP_CHROMA 256
-
-    /**
-     * ME diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dia_size;
-
-    /**
-     * amount of previous MV predictors (2a+1 x 2a+1 square)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int last_predictor_count;
-
-    /**
-     * prepass for motion estimation
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_me;
-
-    /**
-     * motion estimation prepass comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_pre_cmp;
-
-    /**
-     * ME prepass diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_dia_size;
-
-    /**
-     * subpel ME quality
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_subpel_quality;
-
-    /**
-     * callback to negotiate the pixelFormat
-     * @param fmt is the list of formats which are supported by the codec,
-     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
-     * The first is always the native one.
-     * @return the chosen format
-     * - encoding: unused
-     * - decoding: Set by user, if not set the native format will be chosen.
-     */
-    enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-    /**
-     * DTG active format information (additional aspect ratio
-     * information only used in DVB MPEG-2 transport streams)
-     * 0 if not set.
-     *
-     * - encoding: unused
-     * - decoding: Set by decoder.
-     */
-    int dtg_active_format;
-#define FF_DTG_AFD_SAME         8
-#define FF_DTG_AFD_4_3          9
-#define FF_DTG_AFD_16_9         10
-#define FF_DTG_AFD_14_9         11
-#define FF_DTG_AFD_4_3_SP_14_9  13
-#define FF_DTG_AFD_16_9_SP_14_9 14
-#define FF_DTG_AFD_SP_4_3       15
-
-    /**
-     * maximum motion estimation search range in subpel units
-     * If 0 then no limit.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_range;
-
-    /**
-     * intra quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_quant_bias;
-#define FF_DEFAULT_QUANT_BIAS 999999
-
-    /**
-     * inter quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_quant_bias;
-
-    /**
-     * color table ID
-     * - encoding: unused
-     * - decoding: Which clrtable should be used for 8bit RGB images.
-     *             Tables have to be stored somewhere. FIXME
-     */
-    int color_table_id;
-
-    /**
-     * internal_buffer count
-     * Don't touch, used by libavcodec default_get_buffer().
-     */
-    int internal_buffer_count;
-
-    /**
-     * internal_buffers
-     * Don't touch, used by libavcodec default_get_buffer().
-     */
-    void *internal_buffer;
-
-#define FF_LAMBDA_SHIFT 7
-#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
-#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
-#define FF_LAMBDA_MAX (256*128-1)
-
-#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
-    /**
-     * Global quality for codecs which cannot change it per frame.
-     * This should be proportional to MPEG-1/2/4 qscale.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int global_quality;
-
-#define FF_CODER_TYPE_VLC       0
-#define FF_CODER_TYPE_AC        1
-#define FF_CODER_TYPE_RAW       2
-#define FF_CODER_TYPE_RLE       3
-#define FF_CODER_TYPE_DEFLATE   4
-    /**
-     * coder type
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int coder_type;
-
-    /**
-     * context model
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int context_model;
-#if 0
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
-#endif
-
-    /**
-     * slice flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int slice_flags;
-#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
-#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
-
-    /**
-     * XVideo Motion Acceleration
-     * - encoding: forbidden
-     * - decoding: set by decoder
-     */
-    int xvmc_acceleration;
-
-    /**
-     * macroblock decision mode
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_decision;
-#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
-#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
-#define FF_MB_DECISION_RD     2        ///< rate distoration
-
-    /**
-     * custom intra quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *intra_matrix;
-
-    /**
-     * custom inter quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *inter_matrix;
-
-    /**
-     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * - encoding: unused
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int stream_codec_tag;
-
-    /**
-     * scene change detection threshold
-     * 0 is default, larger means fewer detected scene changes.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_threshold;
-
-    /**
-     * minimum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmin;
-
-    /**
-     * maximum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmax;
-
-    /**
-     * palette control structure
-     * - encoding: ??? (no palette-enabled encoder yet)
-     * - decoding: Set by user.
-     */
-    struct AVPaletteControl *palctrl;
-
-    /**
-     * noise reduction strength
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int noise_reduction;
-
-    /**
-     * Called at the beginning of a frame to get cr buffer for it.
-     * Buffer type (size, hints) must be the same. libavcodec won't check it.
-     * libavcodec will pass previous buffer in pic, function should return
-     * same buffer or new buffer with old frame "painted" into it.
-     * If pic.data[0] == NULL must behave like get_buffer().
-     * - encoding: unused
-     * - decoding: Set by libavcodec., user can override
-     */
-    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Number of bits which should be loaded into the rc buffer before decoding starts.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_initial_buffer_occupancy;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_threshold;
-
-    /**
-     * CODEC_FLAG2_*
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags2;
-
-    /**
-     * Simulates errors in the bitstream to test error concealment.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int error_rate;
-
-    /**
-     * MP3 antialias algorithm, see FF_AA_* below.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int antialias_algo;
-#define FF_AA_AUTO    0
-#define FF_AA_FASTINT 1 //not implemented yet
-#define FF_AA_INT     2
-#define FF_AA_FLOAT   3
-    /**
-     * quantizer noise shaping
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int quantizer_noise_shaping;
-
-    /**
-     * thread count
-     * is used to decide how many independent tasks should be passed to execute()
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_count;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * @param count the number of things to execute
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
-
-    /**
-     * thread opaque
-     * Can be used by execute() to store some per AVCodecContext stuff.
-     * - encoding: set by execute()
-     * - decoding: set by execute()
-     */
-    void *thread_opaque;
-
-    /**
-     * Motion estimation threshold below which no motion estimation is
-     * performed, but instead the user specified motion vectors are used.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int me_threshold;
-
-    /**
-     * Macroblock threshold below which the user specified macroblock types will be used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int mb_threshold;
-
-    /**
-     * precision of the intra DC coefficient - 8
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int intra_dc_precision;
-
-    /**
-     * noise vs. sse weight for the nsse comparsion function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int nsse_weight;
-
-    /**
-     * Number of macroblock rows at the top which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int skip_top;
-
-    /**
-     * Number of macroblock rows at the bottom which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int skip_bottom;
-
-    /**
-     * profile
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int profile;
-#define FF_PROFILE_UNKNOWN -99
-#define FF_PROFILE_AAC_MAIN 0
-#define FF_PROFILE_AAC_LOW  1
-#define FF_PROFILE_AAC_SSR  2
-#define FF_PROFILE_AAC_LTP  3
-
-    /**
-     * level
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int level;
-#define FF_LEVEL_UNKNOWN -99
-
-    /**
-     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int lowres;
-
-    /**
-     * Bitstream width / height, may be different from width/height if lowres
-     * or other things are used.
-     * - encoding: unused
-     * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
-     */
-    int coded_width, coded_height;
-
-    /**
-     * frame skip threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_threshold;
-
-    /**
-     * frame skip factor
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_factor;
-
-    /**
-     * frame skip exponent
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_exp;
-
-    /**
-     * frame skip comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_cmp;
-
-    /**
-     * Border processing masking, raises the quantizer for mbs on the borders
-     * of the picture.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float border_masking;
-
-    /**
-     * minimum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmin;
-
-    /**
-     * maximum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmax;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_penalty_compensation;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_loop_filter;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_idct;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_frame;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bidir_refine;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int brd_scale;
-
-    /**
-     * constant rate factor - quality-based VBR - values ~correspond to qps
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float crf;
-
-    /**
-     * constant quantization parameter rate control method
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cqp;
-
-    /**
-     * minimum GOP size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int keyint_min;
-
-    /**
-     * number of reference frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int refs;
-
-    /**
-     * chroma qp offset from luma
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chromaoffset;
-
-    /**
-     * Influences how often B-frames are used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bframebias;
-
-    /**
-     * trellis RD quantization
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int trellis;
-
-    /**
-     * Reduce fluctuations in qp (before curve compression).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float complexityblur;
-
-    /**
-     * in-loop deblocking filter alphac0 parameter
-     * alpha is in the range -6...6
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int deblockalpha;
-
-    /**
-     * in-loop deblocking filter beta parameter
-     * beta is in the range -6...6
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int deblockbeta;
-
-    /**
-     * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int partitions;
-#define X264_PART_I4X4 0x001  /* Analyse i4x4 */
-#define X264_PART_I8X8 0x002  /* Analyse i8x8 (requires 8x8 transform) */
-#define X264_PART_P8X8 0x010  /* Analyse p16x8, p8x16 and p8x8 */
-#define X264_PART_P4X4 0x020  /* Analyse p8x4, p4x8, p4x4 */
-#define X264_PART_B8X8 0x100  /* Analyse b16x8, b8x16 and b8x8 */
-
-    /**
-     * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int directpred;
-
-    /**
-     * Audio cutoff bandwidth (0 means "automatic"), currently used only by FAAC.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cutoff;
-
-    /**
-     * Multiplied by qscale for each frame and added to scene_change_score.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_factor;
-
-    /**
-     *
-     * Note: Value depends upon the compare function used for fullpel ME.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mv0_threshold;
-
-    /**
-     * Adjusts sensitivity of b_frame_strategy 1.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int b_sensitivity;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int compression_level;
-#define FF_COMPRESSION_DEFAULT -1
-
-    /**
-     * Sets whether to use LPC mode - used by FLAC encoder.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int use_lpc;
-
-    /**
-     * LPC coefficient precision - used by FLAC encoder
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lpc_coeff_precision;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_prediction_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_prediction_order;
-
-    /**
-     * search method for selecting prediction order
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int prediction_order_method;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_partition_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_partition_order;
-
-    /**
-     * GOP timecode frame start number, in non drop frame format
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int64_t timecode_frame_start;
-
-    /**
-     * Decoder should decode to this many channels if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int request_channels;
-} AVCodecContext;
-
-/**
- * AVCodec.
- */
-typedef struct AVCodec {
-    /**
-     * Name of the codec implementation.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     * This is the primary way to find a codec from the user perspective.
-     */
-    const char *name;
-    enum CodecType type;
-    enum CodecID id;
-    int priv_data_size;
-    int (*init)(AVCodecContext *);
-    int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
-    int (*close)(AVCodecContext *);
-    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
-                  uint8_t *buf, int buf_size);
-    int capabilities;
-    struct AVCodec *next;
-    void (*flush)(AVCodecContext *);
-    const AVRational *supported_framerates; ///array of supported framerates, or NULL if any, array is terminated by {0,0}
-    const enum PixelFormat *pix_fmts;       ///array of supported pixel formats, or NULL if unknown, array is terminanted by -1
-} AVCodec;
-
-/**
- * four components are given, that's all.
- * the last component is alpha
- */
-typedef struct AVPicture {
-    uint8_t *data[4];
-    int linesize[4];       ///< number of bytes per line
-} AVPicture;
-
-/**
- * AVPaletteControl
- * This structure defines a method for communicating palette changes
- * between and demuxer and a decoder.
- *
- * @deprecated Use AVPacket to send palette changes instead.
- * This is totally broken.
- */
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
-typedef struct AVPaletteControl {
-
-    /* Demuxer sets this to 1 to indicate the palette has changed;
-     * decoder resets to 0. */
-    int palette_changed;
-
-    /* 4-byte ARGB palette entries, stored in native byte order; note that
-     * the individual palette components should be on a 8-bit scale; if
-     * the palette data comes from an IBM VGA native format, the component
-     * data is probably 6 bits in size and needs to be scaled. */
-    unsigned int palette[AVPALETTE_COUNT];
-
-} AVPaletteControl attribute_deprecated;
-
-typedef struct AVSubtitleRect {
-    uint16_t x;
-    uint16_t y;
-    uint16_t w;
-    uint16_t h;
-    uint16_t nb_colors;
-    int linesize;
-    uint32_t *rgba_palette;
-    uint8_t *bitmap;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
-    uint16_t format; /* 0 = graphics */
-    uint32_t start_display_time; /* relative to packet pts, in ms */
-    uint32_t end_display_time; /* relative to packet pts, in ms */
-    uint32_t num_rects;
-    AVSubtitleRect *rects;
-} AVSubtitle;
-
-
-/* resample.c */
-
-struct ReSampleContext;
-struct AVResampleContext;
-
-typedef struct ReSampleContext ReSampleContext;
-
-ReSampleContext *audio_resample_init(int output_channels, int input_channels,
-                                     int output_rate, int input_rate);
-int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
-void audio_resample_close(ReSampleContext *s);
-
-struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
-int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
-void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
-void av_resample_close(struct AVResampleContext *c);
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/* YUV420 format is assumed ! */
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated;
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated ImgReSampleContext *img_resample_init(int output_width, int output_height,
-                                      int input_width, int input_height);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
-                                      int iwidth, int iheight,
-                                      int topBand, int bottomBand,
-                                      int leftBand, int rightBand,
-                                      int padtop, int padbottom,
-                                      int padleft, int padright);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated void img_resample(struct ImgReSampleContext *s,
-                  AVPicture *output, const AVPicture *input);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated void img_resample_close(struct ImgReSampleContext *s);
-
-#endif
-
-/**
- * Allocate memory for a picture.  Call avpicture_free to free it.
- *
- * @param picture the picture to be filled in
- * @param pix_fmt the format of the picture
- * @param width the width of the picture
- * @param height the height of the picture
- * @return zero if successful, a negative value if not
- */
-int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
-
-/**
- * Free a picture previously allocated by avpicture_alloc().
- *
- * @param picture the AVPicture to be freed
- */
-void avpicture_free(AVPicture *picture);
-
-/**
- * Fill in the AVPicture fields.
- * The fields of the given AVPicture are filled in by using the 'ptr' address
- * which points to the image data buffer. Depending on the specified picture
- * format, one or multiple image data pointers and line sizes will be set.
- * If a planar format is specified, several pointers will be set pointing to
- * the different picture planes and the line sizes of the different planes
- * will be stored in the lines_sizes array.
- *
- * @param picture AVPicture whose fields are to be filled in
- * @param ptr Buffer which will contain or contains the actual image data
- * @param pix_fmt The format in which the picture data is stored.
- * @param width the width of the image in pixels
- * @param height the height of the image in pixels
- * @return size of the image data in bytes
- */
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
-                   int pix_fmt, int width, int height);
-int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
-                     unsigned char *dest, int dest_size);
-
-/**
- * Calculate the size in bytes that a picture of the given width and height
- * would occupy if stored in the given picture format.
- *
- * @param pix_fmt the given picture format
- * @param width the width of the image
- * @param height the height of the image
- * @return Image data size in bytes
- */
-int avpicture_get_size(int pix_fmt, int width, int height);
-void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
-const char *avcodec_get_pix_fmt_name(int pix_fmt);
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
-enum PixelFormat avcodec_get_pix_fmt(const char* name);
-unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
-
-#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
-#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
-#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
-#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
-#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
-#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
-
-/**
- * Computes what kind of losses will occur when converting from one specific
- * pixel format to another.
- * When converting from one pixel format to another, information loss may occur.
- * For example, when converting from RGB24 to GRAY, the color information will
- * be lost. Similarly, other losses occur when converting from some formats to
- * other formats. These losses can involve loss of chroma, but also loss of
- * resolution, loss of color depth, loss due to the color space conversion, loss
- * of the alpha bits or loss due to color quantization.
- * avcodec_get_fix_fmt_loss() informs you about the various types of losses
- * which will occur when converting from one pixel format to another.
- *
- * @param[in] dst_pix_fmt destination pixel format
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @return Combination of flags informing you what kind of losses will occur.
- */
-int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
-                             int has_alpha);
-
-/**
- * Finds the best pixel format to convert to given a certain source pixel
- * format.  When converting from one pixel format to another, information loss
- * may occur.  For example, when converting from RGB24 to GRAY, the color
- * information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
- * the given pixel formats should be used to suffer the least amount of loss.
- * The pixel formats from which it chooses one, are determined by the
- * \p pix_fmt_mask parameter.
- *
- * @code
- * src_pix_fmt = PIX_FMT_YUV420P;
- * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);
- * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
- * @endcode
- *
- * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
- * @return The best pixel format to convert to or -1 if none was found.
- */
-int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
-                              int has_alpha, int *loss_ptr);
-
-
-/**
- * Print in buf the string corresponding to the pixel format with
- * number pix_fmt, or an header if pix_fmt is negative.
- *
- * @param buf[in] the buffer where to write the string
- * @param buf_size[in] the size of buf
- * @param pix_fmt[in] the number of the pixel format to print the corresponding info string, or
- * a negative value to print the corresponding header.
- * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
- */
-void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
-
-#define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */
-#define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */
-
-/**
- * Tell if an image really has transparent alpha values.
- * @return ored mask of FF_ALPHA_xxx constants
- */
-int img_get_alpha_info(const AVPicture *src,
-                       int pix_fmt, int width, int height);
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/**
- * convert among pixel formats
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated int img_convert(AVPicture *dst, int dst_pix_fmt,
-                const AVPicture *src, int pix_fmt,
-                int width, int height);
-#endif
-
-/* deinterlace a picture */
-/* deinterlace - if not supported return -1 */
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
-                          int pix_fmt, int width, int height);
-
-/* external high level API */
-
-extern AVCodec *first_avcodec;
-
-/* returns LIBAVCODEC_VERSION_INT constant */
-unsigned avcodec_version(void);
-/* returns LIBAVCODEC_BUILD constant */
-unsigned avcodec_build(void);
-
-/**
- * Initializes libavcodec.
- *
- * @warning This function \e must be called before any other libavcodec
- * function.
- */
-void avcodec_init(void);
-
-void register_avcodec(AVCodec *format);
-
-/**
- * Finds an encoder with a matching codec ID.
- *
- * @param id CodecID of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder(enum CodecID id);
-
-/**
- * Finds an encoder with the specified name.
- *
- * @param name name of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder_by_name(const char *name);
-
-/**
- * Finds a decoder with a matching codec ID.
- *
- * @param id CodecID of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder(enum CodecID id);
-
-/**
- * Finds an decoder with the specified name.
- *
- * @param name name of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder_by_name(const char *name);
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
-
-/**
- * Sets the fields of the given AVCodecContext to default values.
- *
- * @param s The AVCodecContext of which the fields should be set to default values.
- */
-void avcodec_get_context_defaults(AVCodecContext *s);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
-
-/**
- * Allocates an AVCodecContext and sets its fields to default values.  The
- * resulting struct can be deallocated by simply calling av_free().
- *
- * @return An AVCodecContext filled with default values or NULL on failure.
- * @see avcodec_get_context_defaults
- */
-AVCodecContext *avcodec_alloc_context(void);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-AVCodecContext *avcodec_alloc_context2(enum CodecType);
-
-/**
- * Sets the fields of the given AVFrame to default values.
- *
- * @param pic The AVFrame of which the fields should be set to default values.
- */
-void avcodec_get_frame_defaults(AVFrame *pic);
-
-/**
- * Allocates an AVFrame and sets its fields to default values.  The resulting
- * struct can be deallocated by simply calling av_free().
- *
- * @return An AVFrame filled with default values or NULL on failure.
- * @see avcodec_get_frame_defaults
- */
-AVFrame *avcodec_alloc_frame(void);
-
-int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
-
-/**
- * Checks if the given dimension of a picture is valid, meaning that all
- * bytes of the picture can be addressed with a signed int.
- *
- * @param[in] w Width of the picture.
- * @param[in] h Height of the picture.
- * @return Zero if valid, a negative value if invalid.
- */
-int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
-enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-int avcodec_thread_init(AVCodecContext *s, int thread_count);
-void avcodec_thread_free(AVCodecContext *s);
-int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
-//FIXME func typedef
-
-/**
- * Initializes the AVCodecContext to use the given AVCodec. Prior to using this
- * function the context has to be allocated.
- *
- * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
- * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
- * retrieving a codec.
- *
- * @warning This function is not thread safe!
- *
- * @code
- * avcodec_register_all();
- * codec = avcodec_find_decoder(CODEC_ID_H264);
- * if (!codec)
- *     exit(1);
- *
- * context = avcodec_alloc_context();
- *
- * if (avcodec_open(context, codec) < 0)
- *     exit(1);
- * @endcode
- *
- * @param avctx The context which will be set up to use the given codec.
- * @param codec The codec to use within the context.
- * @return zero on success, a negative value on error
- * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder
- */
-int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-
-/**
- * @deprecated Use avcodec_decode_audio2() instead.
- */
-attribute_deprecated int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
-                         int *frame_size_ptr,
-                         uint8_t *buf, int buf_size);
-
-/**
- * Decodes an audio frame from \p buf into \p samples.
- * The avcodec_decode_audio2() function decodes an audio frame from the input
- * buffer \p buf of size \p buf_size. To decode it, it makes use of the
- * audio codec which was coupled with \p avctx using avcodec_open(). The
- * resulting decoded frame is stored in output buffer \p samples.  If no frame
- * could be decompressed, \p frame_size_ptr is zero. Otherwise, it is the
- * decompressed frame size in \e bytes.
- *
- * @warning You \e must set \p frame_size_ptr to the allocated size of the
- * output buffer before calling avcodec_decode_audio2().
- *
- * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer \p buf should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer \p buf and output buffer \p
- * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance. In practice, the
- * bitstream should have 4 byte alignment at minimum and all sample data should
- * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If
- * the linesize is not a multiple of 16 then there's no sense in aligning the
- * start of the buffer to 16.
- *
- * @param avctx the codec context
- * @param[out] samples the output buffer
- * @param[in,out] frame_size_ptr the output buffer size in bytes
- * @param[in] buf the input buffer
- * @param[in] buf_size the input buffer size in bytes
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
-                         int *frame_size_ptr,
-                         uint8_t *buf, int buf_size);
-
-/**
- * Decodes a video frame from \p buf into \p picture.
- * The avcodec_decode_video() function decodes a video frame from the input
- * buffer \p buf of size \p buf_size. To decode it, it makes use of the
- * video codec which was coupled with \p avctx using avcodec_open(). The
- * resulting decoded frame is stored in \p picture.
- *
- * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer \p buf should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer \p buf and output buffer \p
- * samples. The alignment requirements depend on the CPU: on some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance. In practice, the
- * bitstream should have 4 byte alignment at minimum and all sample data should
- * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If
- * the linesize is not a multiple of 16 then there's no sense in aligning the
- * start of the buffer to 16.
- *
- * @param avctx the codec context
- * @param[out] picture The AVFrame in which the decoded video frame will be stored.
- * @param[in] buf the input buffer
- * @param[in] buf_size the size of the input buffer in bytes
- * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_picture_ptr,
-                         uint8_t *buf, int buf_size);
-
-/* Decode a subtitle message. Return -1 if error, otherwise return the
- * number of bytes used. If no subtitle could be decompressed,
- * got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
-int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
-                            int *got_sub_ptr,
-                            const uint8_t *buf, int buf_size);
-int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
-                        int *data_size_ptr,
-                        uint8_t *buf, int buf_size);
-
-/**
- * Encodes an audio frame from \p samples into \p buf.
- * The avcodec_encode_audio() function encodes an audio frame from the input
- * buffer \p samples. To encode it, it makes use of the audio codec which was
- * coupled with \p avctx using avcodec_open(). The resulting encoded frame is
- * stored in output buffer \p buf.
- *
- * @note The output buffer should be at least \c FF_MIN_BUFFER_SIZE bytes large.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer
- * @param[in] buf_size the output buffer size
- * @param[in] samples the input buffer containing the samples
- * @return On error a negative value is returned, on succes zero or the number
- * of bytes used from the input buffer.
- */
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                         const short *samples);
-
-/**
- * Encodes a video frame from \p pict into \p buf.
- * The avcodec_encode_video() function encodes a video frame from the input
- * \p pict. To encode it, it makes use of the video codec which was coupled with
- * \p avctx using avcodec_open(). The resulting encoded bytes representing the
- * frame are stored in the output buffer \p buf. The input picture should be
- * stored using a specific format, namely \c avctx.pix_fmt.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer for the bitstream of encoded frame
- * @param[in] buf_size the size of the output buffer in bytes
- * @param[in] pict the input picture to encode
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used from the input buffer.
- */
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                         const AVFrame *pict);
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                            const AVSubtitle *sub);
-
-int avcodec_close(AVCodecContext *avctx);
-
-void avcodec_register_all(void);
-
-/**
- * Flush buffers, should be called when seeking or when switching to a different stream.
- */
-void avcodec_flush_buffers(AVCodecContext *avctx);
-
-void avcodec_default_free_buffers(AVCodecContext *s);
-
-/* misc useful functions */
-
-/**
- * Returns a single letter to describe the given picture type \p pict_type.
- *
- * @param[in] pict_type the picture type
- * @return A single character representing the picture type.
- */
-char av_get_pict_type_char(int pict_type);
-
-/**
- * Returns codec bits per sample.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_bits_per_sample(enum CodecID codec_id);
-
-/**
- * Returns sample format bits per sample.
- *
- * @param[in] sample_fmt the sample format
- * @return Number of bits per sample or zero if unknown for the given sample format.
- */
-int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
-
-/* frame parsing */
-typedef struct AVCodecParserContext {
-    void *priv_data;
-    struct AVCodecParser *parser;
-    int64_t frame_offset; /* offset of the current frame */
-    int64_t cur_offset; /* current offset
-                           (incremented by each av_parser_parse()) */
-    int64_t last_frame_offset; /* offset of the last frame */
-    /* video info */
-    int pict_type; /* XXX: Put it back in AVCodecContext. */
-    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
-    int64_t pts;     /* pts of the current frame */
-    int64_t dts;     /* dts of the current frame */
-
-    /* private data */
-    int64_t last_pts;
-    int64_t last_dts;
-    int fetch_timestamp;
-
-#define AV_PARSER_PTS_NB 4
-    int cur_frame_start_index;
-    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
-    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
-    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
-    int flags;
-#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
-
-    int64_t offset;      ///< byte offset from starting packet start
-    int64_t last_offset;
-} AVCodecParserContext;
-
-typedef struct AVCodecParser {
-    int codec_ids[5]; /* several codec IDs are permitted */
-    int priv_data_size;
-    int (*parser_init)(AVCodecParserContext *s);
-    int (*parser_parse)(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size);
-    void (*parser_close)(AVCodecParserContext *s);
-    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-    struct AVCodecParser *next;
-} AVCodecParser;
-
-extern AVCodecParser *av_first_parser;
-
-void av_register_codec_parser(AVCodecParser *parser);
-AVCodecParserContext *av_parser_init(int codec_id);
-int av_parser_parse(AVCodecParserContext *s,
-                    AVCodecContext *avctx,
-                    uint8_t **poutbuf, int *poutbuf_size,
-                    const uint8_t *buf, int buf_size,
-                    int64_t pts, int64_t dts);
-int av_parser_change(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe);
-void av_parser_close(AVCodecParserContext *s);
-
-
-typedef struct AVBitStreamFilterContext {
-    void *priv_data;
-    struct AVBitStreamFilter *filter;
-    AVCodecParserContext *parser;
-    struct AVBitStreamFilterContext *next;
-} AVBitStreamFilterContext;
-
-
-typedef struct AVBitStreamFilter {
-    const char *name;
-    int priv_data_size;
-    int (*filter)(AVBitStreamFilterContext *bsfc,
-                  AVCodecContext *avctx, const char *args,
-                  uint8_t **poutbuf, int *poutbuf_size,
-                  const uint8_t *buf, int buf_size, int keyframe);
-    void (*close)(AVBitStreamFilterContext *bsfc);
-    struct AVBitStreamFilter *next;
-} AVBitStreamFilter;
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-                               AVCodecContext *avctx, const char *args,
-                               uint8_t **poutbuf, int *poutbuf_size,
-                               const uint8_t *buf, int buf_size, int keyframe);
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-
-
-/* memory */
-
-/**
- * Reallocates the given block if it is not large enough, otherwise it
- * does nothing.
- *
- * @see av_realloc
- */
-void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
-
-/* for static data only */
-
-/**
- * Frees all static arrays and resets their pointers to 0.
- * Call this function to release all statically allocated tables.
- *
- * @deprecated. Code which uses av_free_static is broken/misdesigned
- * and should correctly use static arrays
- *
- */
-attribute_deprecated void av_free_static(void);
-
-/**
- * Allocation of static arrays.
- *
- * @warning Do not use for normal allocation.
- *
- * @param[in] size The amount of memory you need in bytes.
- * @return block of memory of the requested size
- * @deprecated. Code which uses av_mallocz_static is broken/misdesigned
- * and should correctly use static arrays
- */
-attribute_deprecated void *av_mallocz_static(unsigned int size);
-
-/**
- * Copy image 'src' to 'dst'.
- */
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
-              int pix_fmt, int width, int height);
-
-/**
- * Crop image top and left side.
- */
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
-             int pix_fmt, int top_band, int left_band);
-
-/**
- * Pad image.
- */
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
-            int padtop, int padbottom, int padleft, int padright, int *color);
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated void img_copy(AVPicture *dst, const AVPicture *src,
-              int pix_fmt, int width, int height);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated int img_crop(AVPicture *dst, const AVPicture *src,
-             int pix_fmt, int top_band, int left_band);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
-            int padtop, int padbottom, int padleft, int padright, int *color);
-#endif
-
-extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-/**
- * Parses \p str and put in \p width_ptr and \p height_ptr the detected values.
- *
- * @return 0 in case of a successful parsing, a negative value otherwise
- * @param[in] str the string to parse: it has to be a string in the format
- * <width>x<height> or a valid video frame size abbreviation.
- * @param[in,out] width_ptr pointer to the variable which will contain the detected
- * frame width value
- * @param[in,out] height_ptr pointer to the variable which will contain the detected
- * frame height value
- */
-int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
-
-/**
- * Parses \p str and put in \p frame_rate the detected values.
- *
- * @return 0 in case of a successful parsing, a negative value otherwise
- * @param[in] str the string to parse: it has to be a string in the format
- * <frame_rate_nom>/<frame_rate_den>, a float number or a valid video rate abbreviation
- * @param[in,out] frame_rate pointer to the AVRational which will contain the detected
- * frame rate
- */
-int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
-
-/* error handling */
-#if EINVAL > 0
-#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
-#define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
-#else
-/* Some platforms have E* and errno already negated. */
-#define AVERROR(e) (e)
-#define AVUNERROR(e) (e)
-#endif
-#define AVERROR_UNKNOWN     AVERROR(EINVAL)  /**< unknown error */
-#define AVERROR_IO          AVERROR(EIO)     /**< I/O error */
-#define AVERROR_NUMEXPECTED AVERROR(EDOM)    /**< Number syntax expected in filename. */
-#define AVERROR_INVALIDDATA AVERROR(EINVAL)  /**< invalid data found */
-#define AVERROR_NOMEM       AVERROR(ENOMEM)  /**< not enough memory */
-#define AVERROR_NOFMT       AVERROR(EILSEQ)  /**< unknown format */
-#define AVERROR_NOTSUPP     AVERROR(ENOSYS)  /**< Operation not supported. */
-#define AVERROR_NOENT       AVERROR(ENOENT)  /**< No such file or directory. */
-#define AVERROR_PATCHWELCOME    -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
-
-#endif /* AVCODEC_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/avformat.h b/ffmpeg 0.5/include/ffmpeg/avformat.h
deleted file mode 100644 (file)
index 69197c3..0000000
+++ /dev/null
@@ -1,934 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_H
-#define AVFORMAT_H
-
-#define LIBAVFORMAT_VERSION_INT ((51<<16)+(14<<8)+0)
-#define LIBAVFORMAT_VERSION     51.14.0
-#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
-
-#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
-
-#include <time.h>
-#include <stdio.h>  /* FILE */
-#include "avcodec.h"
-
-#include "avio.h"
-
-/* packet functions */
-
-typedef struct AVPacket {
-    int64_t pts;                            ///< presentation time stamp in time_base units
-    int64_t dts;                            ///< decompression time stamp in time_base units
-    uint8_t *data;
-    int   size;
-    int   stream_index;
-    int   flags;
-    int   duration;                         ///< presentation duration in time_base units (0 if not available)
-    void  (*destruct)(struct AVPacket *);
-    void  *priv;
-    int64_t pos;                            ///< byte position in stream, -1 if unknown
-} AVPacket;
-#define PKT_FLAG_KEY   0x0001
-
-void av_destruct_packet_nofree(AVPacket *pkt);
-
-/**
- * Default packet destructor.
- */
-void av_destruct_packet(AVPacket *pkt);
-
-/**
- * Initialize optional fields of a packet to default values.
- *
- * @param pkt packet
- */
-void av_init_packet(AVPacket *pkt);
-
-/**
- * Allocate the payload of a packet and initialize its fields to default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return 0 if OK. AVERROR_xxx otherwise.
- */
-int av_new_packet(AVPacket *pkt, int size);
-
-/**
- * Allocate and read the payload of a packet and initialize its fields to default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return >0 (read size) if OK. AVERROR_xxx otherwise.
- */
-int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
-
-/**
- * @warning This is a hack - the packet memory allocation stuff is broken. The
- * packet is allocated if it was not really allocated
- */
-int av_dup_packet(AVPacket *pkt);
-
-/**
- * Free a packet
- *
- * @param pkt packet to free
- */
-static inline void av_free_packet(AVPacket *pkt)
-{
-    if (pkt && pkt->destruct) {
-        pkt->destruct(pkt);
-    }
-}
-
-/*************************************************/
-/* fractional numbers for exact pts handling */
-
-/**
- * the exact value of the fractional number is: 'val + num / den'.
- * num is assumed to be such as 0 <= num < den
- * @deprecated Use AVRational instead
-*/
-typedef struct AVFrac {
-    int64_t val, num, den;
-} AVFrac attribute_deprecated;
-
-/*************************************************/
-/* input/output formats */
-
-struct AVCodecTag;
-
-struct AVFormatContext;
-
-/** this structure contains the data a format has to probe a file */
-typedef struct AVProbeData {
-    const char *filename;
-    unsigned char *buf;
-    int buf_size;
-} AVProbeData;
-
-#define AVPROBE_SCORE_MAX 100               ///< max score, half of that is used for file extension based detection
-#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
-
-typedef struct AVFormatParameters {
-    AVRational time_base;
-    int sample_rate;
-    int channels;
-    int width;
-    int height;
-    enum PixelFormat pix_fmt;
-    int channel; /**< used to select dv channel */
-#if LIBAVFORMAT_VERSION_INT < (52<<16)
-    const char *device; /**< video, audio or DV device */
-#endif
-    const char *standard; /**< tv standard, NTSC, PAL, SECAM */
-    int mpeg2ts_raw:1;  /**< force raw MPEG2 transport stream output, if possible */
-    int mpeg2ts_compute_pcr:1; /**< compute exact PCR for each transport
-                                  stream packet (only meaningful if
-                                  mpeg2ts_raw is TRUE) */
-    int initial_pause:1;       /**< do not begin to play the stream
-                                  immediately (RTSP only) */
-    int prealloced_context:1;
-    enum CodecID video_codec_id;
-    enum CodecID audio_codec_id;
-} AVFormatParameters;
-
-//! demuxer will use url_fopen, no opened file should be provided by the caller
-#define AVFMT_NOFILE        0x0001
-#define AVFMT_NEEDNUMBER    0x0002 /**< needs '%d' in filename */
-#define AVFMT_SHOW_IDS      0x0008 /**< show format stream IDs numbers */
-#define AVFMT_RAWPICTURE    0x0020 /**< format wants AVPicture structure for
-                                      raw picture data */
-#define AVFMT_GLOBALHEADER  0x0040 /**< format wants global header */
-#define AVFMT_NOTIMESTAMPS  0x0080 /**< format does not need / have any timestamps */
-#define AVFMT_GENERIC_INDEX 0x0100 /**< use generic index building code */
-
-typedef struct AVOutputFormat {
-    const char *name;
-    const char *long_name;
-    const char *mime_type;
-    const char *extensions; /**< comma separated filename extensions */
-    /** size of private data so that it can be allocated in the wrapper */
-    int priv_data_size;
-    /* output support */
-    enum CodecID audio_codec; /**< default audio codec */
-    enum CodecID video_codec; /**< default video codec */
-    int (*write_header)(struct AVFormatContext *);
-    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
-    int (*write_trailer)(struct AVFormatContext *);
-    /** can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER */
-    int flags;
-    /** currently only used to set pixel format if not YUV420P */
-    int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *);
-    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, AVPacket *in, int flush);
-
-    /**
-     * list of supported codec_id-codec_tag pairs, ordered by "better choice first"
-     * the arrays are all CODEC_ID_NONE terminated
-     */
-    const struct AVCodecTag **codec_tag;
-
-    enum CodecID subtitle_codec; /**< default subtitle codec */
-
-    /* private fields */
-    struct AVOutputFormat *next;
-} AVOutputFormat;
-
-typedef struct AVInputFormat {
-    const char *name;
-    const char *long_name;
-    /** size of private data so that it can be allocated in the wrapper */
-    int priv_data_size;
-    /**
-     * tell if a given file has a chance of being parsed by this format.
-     * The buffer provided is guranteed to be AVPROBE_PADDING_SIZE bytes big
-     * so you dont have to check for that unless you need more.
-     */
-    int (*read_probe)(AVProbeData *);
-    /** read the format header and initialize the AVFormatContext
-       structure. Return 0 if OK. 'ap' if non NULL contains
-       additional paramters. Only used in raw format right
-       now. 'av_new_stream' should be called to create new streams.  */
-    int (*read_header)(struct AVFormatContext *,
-                       AVFormatParameters *ap);
-    /** read one packet and put it in 'pkt'. pts and flags are also
-       set. 'av_new_stream' can be called only if the flag
-       AVFMTCTX_NOHEADER is used. */
-    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
-    /** close the stream. The AVFormatContext and AVStreams are not
-       freed by this function */
-    int (*read_close)(struct AVFormatContext *);
-    /**
-     * seek to a given timestamp relative to the frames in
-     * stream component stream_index
-     * @param stream_index must not be -1
-     * @param flags selects which direction should be preferred if no exact
-     *              match is available
-     * @return >= 0 on success (but not necessarily the new offset)
-     */
-    int (*read_seek)(struct AVFormatContext *,
-                     int stream_index, int64_t timestamp, int flags);
-    /**
-     * gets the next timestamp in AV_TIME_BASE units.
-     */
-    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
-                              int64_t *pos, int64_t pos_limit);
-    /** can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER */
-    int flags;
-    /** if extensions are defined, then no probe is done. You should
-       usually not use extension format guessing because it is not
-       reliable enough */
-    const char *extensions;
-    /** general purpose read only value that the format can use */
-    int value;
-
-    /** start/resume playing - only meaningful if using a network based format
-       (RTSP) */
-    int (*read_play)(struct AVFormatContext *);
-
-    /** pause playing - only meaningful if using a network based format
-       (RTSP) */
-    int (*read_pause)(struct AVFormatContext *);
-
-    const struct AVCodecTag **codec_tag;
-
-    /* private fields */
-    struct AVInputFormat *next;
-} AVInputFormat;
-
-enum AVStreamParseType {
-    AVSTREAM_PARSE_NONE,
-    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
-    AVSTREAM_PARSE_HEADERS,    /**< only parse headers, don't repack */
-    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on packet boundary */
-};
-
-typedef struct AVIndexEntry {
-    int64_t pos;
-    int64_t timestamp;
-#define AVINDEX_KEYFRAME 0x0001
-    int flags:2;
-    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs 32 byte due to possible 8byte align).
-    int min_distance;         /**< min distance between this and the previous keyframe, used to avoid unneeded searching */
-} AVIndexEntry;
-
-typedef struct AVStream {
-    int index;    /**< stream index in AVFormatContext */
-    int id;       /**< format specific stream id */
-    AVCodecContext *codec; /**< codec context */
-    /**
-     * real base frame rate of the stream.
-     * this is the lowest framerate with which all timestamps can be
-     * represented accurately (it is the least common multiple of all
-     * framerates in the stream), Note, this value is just a guess!
-     * for example if the timebase is 1/90000 and all frames have either
-     * approximately 3600 or 1800 timer ticks then r_frame_rate will be 50/1
-     */
-    AVRational r_frame_rate;
-    void *priv_data;
-
-    /* internal data used in av_find_stream_info() */
-    int64_t first_dts;
-#if LIBAVFORMAT_VERSION_INT < (52<<16)
-    int codec_info_nb_frames;
-#endif
-    /** encoding: PTS generation when outputing stream */
-    struct AVFrac pts;
-
-    /**
-     * this is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. for fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identically 1.
-     */
-    AVRational time_base;
-    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-    /* ffmpeg.c private use */
-    int stream_copy; /**< if set, just copy stream */
-    enum AVDiscard discard; ///< selects which packets can be discarded at will and do not need to be demuxed
-    //FIXME move stuff to a flags field?
-    /** quality, as it has been removed from AVCodecContext and put in AVVideoFrame
-     * MN: dunno if that is the right place for it */
-    float quality;
-    /**
-     * decoding: pts of the first frame of the stream, in stream time base.
-     * only set this if you are absolutely 100% sure that the value you set
-     * it to really is the pts of the first frame
-     * This may be undefined (AV_NOPTS_VALUE).
-     * @note the ASF header does NOT contain a correct start_time the ASF
-     * demuxer must NOT set this
-     */
-    int64_t start_time;
-    /**
-     * decoding: duration of the stream, in stream time base.
-     * If a source file does not specify a duration, but does specify
-     * a bitrate, this value will be estimates from bit rate and file size.
-     */
-    int64_t duration;
-
-    char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
-
-    /* av_read_frame() support */
-    enum AVStreamParseType need_parsing;
-    struct AVCodecParserContext *parser;
-
-    int64_t cur_dts;
-    int last_IP_duration;
-    int64_t last_IP_pts;
-    /* av_seek_frame() support */
-    AVIndexEntry *index_entries; /**< only used if the format does not
-                                    support seeking natively */
-    int nb_index_entries;
-    unsigned int index_entries_allocated_size;
-
-    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
-
-#define MAX_REORDER_DELAY 4
-    int64_t pts_buffer[MAX_REORDER_DELAY+1];
-} AVStream;
-
-#define AV_PROGRAM_RUNNING 1
-
-typedef struct AVProgram {
-    int            id;
-    char           *provider_name; ///< Network name for DVB streams
-    char           *name;          ///< Service name for DVB streams
-    int            flags;
-    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
-} AVProgram;
-
-#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
-                                         (streams are added dynamically) */
-
-#define MAX_STREAMS 20
-
-/* format I/O context */
-typedef struct AVFormatContext {
-    const AVClass *av_class; /**< set by av_alloc_format_context */
-    /* can only be iformat or oformat, not both at the same time */
-    struct AVInputFormat *iformat;
-    struct AVOutputFormat *oformat;
-    void *priv_data;
-    ByteIOContext pb;
-    unsigned int nb_streams;
-    AVStream *streams[MAX_STREAMS];
-    char filename[1024]; /**< input or output filename */
-    /* stream info */
-    int64_t timestamp;
-    char title[512];
-    char author[512];
-    char copyright[512];
-    char comment[512];
-    char album[512];
-    int year;  /**< ID3 year, 0 if none */
-    int track; /**< track number, 0 if none */
-    char genre[32]; /**< ID3 genre */
-
-    int ctx_flags; /**< format specific flags, see AVFMTCTX_xx */
-    /* private data for pts handling (do not modify directly) */
-    /** This buffer is only needed when packets were already buffered but
-       not decoded, for example to get the codec parameters in mpeg
-       streams */
-    struct AVPacketList *packet_buffer;
-
-    /** decoding: position of the first frame of the component, in
-       AV_TIME_BASE fractional seconds. NEVER set this value directly:
-       it is deduced from the AVStream values.  */
-    int64_t start_time;
-    /** decoding: duration of the stream, in AV_TIME_BASE fractional
-       seconds. NEVER set this value directly: it is deduced from the
-       AVStream values.  */
-    int64_t duration;
-    /** decoding: total file size. 0 if unknown */
-    int64_t file_size;
-    /** decoding: total stream bitrate in bit/s, 0 if not
-       available. Never set it directly if the file_size and the
-       duration are known as ffmpeg can compute it automatically. */
-    int bit_rate;
-
-    /* av_read_frame() support */
-    AVStream *cur_st;
-    const uint8_t *cur_ptr;
-    int cur_len;
-    AVPacket cur_pkt;
-
-    /* av_seek_frame() support */
-    int64_t data_offset; /** offset of the first packet */
-    int index_built;
-
-    int mux_rate;
-    int packet_size;
-    int preload;
-    int max_delay;
-
-#define AVFMT_NOOUTPUTLOOP -1
-#define AVFMT_INFINITEOUTPUTLOOP 0
-    /** number of times to loop output in formats that support it */
-    int loop_output;
-
-    int flags;
-#define AVFMT_FLAG_GENPTS       0x0001 ///< generate pts if missing even if it requires parsing future frames
-#define AVFMT_FLAG_IGNIDX       0x0002 ///< ignore index
-#define AVFMT_FLAG_NONBLOCK     0x0004 ///< do not block when reading packets from input
-
-    int loop_input;
-    /** decoding: size of data to probe; encoding unused */
-    unsigned int probesize;
-
-    /**
-     * maximum duration in AV_TIME_BASE units over which the input should be analyzed in av_find_stream_info()
-     */
-    int max_analyze_duration;
-
-    const uint8_t *key;
-    int keylen;
-
-    unsigned int nb_programs;
-    AVProgram **programs;
-} AVFormatContext;
-
-typedef struct AVPacketList {
-    AVPacket pkt;
-    struct AVPacketList *next;
-} AVPacketList;
-
-extern AVInputFormat *first_iformat;
-extern AVOutputFormat *first_oformat;
-
-enum CodecID av_guess_image2_codec(const char *filename);
-
-/* XXX: use automatic init with either ELF sections or C file parser */
-/* modules */
-
-#include "rtp.h"
-
-#include "rtsp.h"
-
-/* utils.c */
-void av_register_input_format(AVInputFormat *format);
-void av_register_output_format(AVOutputFormat *format);
-AVOutputFormat *guess_stream_format(const char *short_name,
-                                    const char *filename, const char *mime_type);
-AVOutputFormat *guess_format(const char *short_name,
-                             const char *filename, const char *mime_type);
-
-/**
- * Guesses the codec id based upon muxer and filename.
- */
-enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
-                            const char *filename, const char *mime_type, enum CodecType type);
-
-/**
- * Send a nice hexadecimal dump of a buffer to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log
- */
-void av_hex_dump(FILE *f, uint8_t *buf, int size);
-
-/**
- * Send a nice hexadecimal dump of a buffer to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log
- */
-void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
-
-/**
- * Send a nice dump of a packet to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param pkt packet to dump
- * @param dump_payload true if the payload must be displayed too
- */
-void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
-
-/**
- * Send a nice dump of a packet to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param pkt packet to dump
- * @param dump_payload true if the payload must be displayed too
- */
-void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
-
-void av_register_all(void);
-
-/** codec tag <-> codec id */
-enum CodecID av_codec_get_id(const struct AVCodecTag **tags, unsigned int tag);
-unsigned int av_codec_get_tag(const struct AVCodecTag **tags, enum CodecID id);
-
-/* media file input */
-
-/**
- * finds AVInputFormat based on input format's short name.
- */
-AVInputFormat *av_find_input_format(const char *short_name);
-
-/**
- * Guess file format.
- *
- * @param is_opened whether the file is already opened, determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed
- */
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
-
-/**
- * Allocates all the structures needed to read an input stream.
- *        This does not open the needed codecs for decoding the stream[s].
- */
-int av_open_input_stream(AVFormatContext **ic_ptr,
-                         ByteIOContext *pb, const char *filename,
-                         AVInputFormat *fmt, AVFormatParameters *ap);
-
-/**
- * Open a media file as input. The codecs are not opened. Only the file
- * header (if present) is read.
- *
- * @param ic_ptr the opened media file handle is put here
- * @param filename filename to open.
- * @param fmt if non NULL, force the file format to use
- * @param buf_size optional buffer size (zero if default is OK)
- * @param ap additional parameters needed when opening the file (NULL if default)
- * @return 0 if OK. AVERROR_xxx otherwise.
- */
-int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
-                       AVInputFormat *fmt,
-                       int buf_size,
-                       AVFormatParameters *ap);
-/** no av_open for output, so applications will need this: */
-AVFormatContext *av_alloc_format_context(void);
-
-/**
- * Read packets of a media file to get stream information. This
- * is useful for file formats with no headers such as MPEG. This
- * function also computes the real frame rate in case of mpeg2 repeat
- * frame mode.
- * The logical file position is not changed by this function;
- * examined packets may be buffered for later processing.
- *
- * @param ic media file handle
- * @return >=0 if OK. AVERROR_xxx if error.
- * @todo Let user decide somehow what information is needed so we do not waste time geting stuff the user does not need.
- */
-int av_find_stream_info(AVFormatContext *ic);
-
-/**
- * Read a transport packet from a media file.
- *
- * This function is obsolete and should never be used.
- * Use av_read_frame() instead.
- *
- * @param s media file handle
- * @param pkt is filled
- * @return 0 if OK. AVERROR_xxx if error.
- */
-int av_read_packet(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Return the next frame of a stream.
- *
- * The returned packet is valid
- * until the next av_read_frame() or until av_close_input_file() and
- * must be freed with av_free_packet. For video, the packet contains
- * exactly one frame. For audio, it contains an integer number of
- * frames if each frame has a known fixed size (e.g. PCM or ADPCM
- * data). If the audio frames have a variable size (e.g. MPEG audio),
- * then it contains one frame.
- *
- * pkt->pts, pkt->dts and pkt->duration are always set to correct
- * values in AVStream.timebase units (and guessed if the format cannot
- * provided them). pkt->pts can be AV_NOPTS_VALUE if the video format
- * has B frames, so it is better to rely on pkt->dts if you do not
- * decompress the payload.
- *
- * @return 0 if OK, < 0 if error or end of file.
- */
-int av_read_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Seek to the key frame at timestamp.
- * 'timestamp' in 'stream_index'.
- * @param stream_index If stream_index is (-1), a default
- * stream is selected, and timestamp is automatically converted
- * from AV_TIME_BASE units to the stream specific time_base.
- * @param timestamp timestamp in AVStream.time_base units
- *        or if there is no stream specified then in AV_TIME_BASE units
- * @param flags flags which select direction and seeking mode
- * @return >= 0 on success
- */
-int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags);
-
-/**
- * start playing a network based stream (e.g. RTSP stream) at the
- * current position
- */
-int av_read_play(AVFormatContext *s);
-
-/**
- * Pause a network based stream (e.g. RTSP stream).
- *
- * Use av_read_play() to resume it.
- */
-int av_read_pause(AVFormatContext *s);
-
-/**
- * Close a media file (but not its codecs).
- *
- * @param s media file handle
- */
-void av_close_input_file(AVFormatContext *s);
-
-/**
- * Add a new stream to a media file.
- *
- * Can only be called in the read_header() function. If the flag
- * AVFMTCTX_NOHEADER is in the format context, then new streams
- * can be added in read_packet too.
- *
- * @param s media file handle
- * @param id file format dependent stream id
- */
-AVStream *av_new_stream(AVFormatContext *s, int id);
-AVProgram *av_new_program(AVFormatContext *s, int id);
-
-/**
- * Set the pts for a given stream.
- *
- * @param s stream
- * @param pts_wrap_bits number of bits effectively used by the pts
- *        (used for wrap control, 33 is the value for MPEG)
- * @param pts_num numerator to convert to seconds (MPEG: 1)
- * @param pts_den denominator to convert to seconds (MPEG: 90000)
- */
-void av_set_pts_info(AVStream *s, int pts_wrap_bits,
-                     int pts_num, int pts_den);
-
-#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
-#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
-#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non keyframes
-
-int av_find_default_stream_index(AVFormatContext *s);
-
-/**
- * Gets the index for a specific timestamp.
- * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to
- *                 the timestamp which is <= the requested one, if backward is 0
- *                 then it will be >=
- *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
- * @return < 0 if no such timestamp could be found
- */
-int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
-
-/**
- * Add a index entry into a sorted list updateing if it is already there.
- *
- * @param timestamp timestamp in the timebase of the given stream
- */
-int av_add_index_entry(AVStream *st,
-                       int64_t pos, int64_t timestamp, int size, int distance, int flags);
-
-/**
- * Does a binary search using av_index_search_timestamp() and AVCodec.read_timestamp().
- * This is not supposed to be called directly by a user application, but by demuxers.
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags);
-
-/**
- * Updates cur_dts of all streams based on given timestamp and AVStream.
- *
- * Stream ref_st unchanged, others set cur_dts in their native timebase
- * only needed for timestamp wrapping or if (dts not set and pts!=dts).
- * @param timestamp new dts expressed in time_base of param ref_st
- * @param ref_st reference stream giving time_base of param timestamp
- */
-void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
-
-/**
- * Does a binary search using read_timestamp().
- * This is not supposed to be called directly by a user application, but by demuxers.
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int64_t av_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, int64_t pos_min, int64_t pos_max, int64_t pos_limit, int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret, int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
-
-/** media file output */
-int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
-
-/**
- * Allocate the stream private data and write the stream header to an
- * output media file.
- *
- * @param s media file handle
- * @return 0 if OK. AVERROR_xxx if error.
- */
-int av_write_header(AVFormatContext *s);
-
-/**
- * Write a packet to an output media file.
- *
- * The packet shall contain one audio or video frame.
- * The packet must be correctly interleaved according to the container specification,
- * if not then av_interleaved_write_frame must be used
- *
- * @param s media file handle
- * @param pkt the packet, which contains the stream_index, buf/buf_size, dts/pts, ...
- * @return < 0 if error, = 0 if OK, 1 if end of stream wanted.
- */
-int av_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Writes a packet to an output media file ensuring correct interleaving.
- *
- * The packet must contain one audio or video frame.
- * If the packets are already correctly interleaved the application should
- * call av_write_frame() instead as it is slightly faster. It is also important
- * to keep in mind that completely non-interleaved input will need huge amounts
- * of memory to interleave with this, so it is preferable to interleave at the
- * demuxer level.
- *
- * @param s media file handle
- * @param pkt the packet, which contains the stream_index, buf/buf_size, dts/pts, ...
- * @return < 0 if error, = 0 if OK, 1 if end of stream wanted.
- */
-int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Interleave a packet per DTS in an output media file.
- *
- * Packets with pkt->destruct == av_destruct_packet will be freed inside this function,
- * so they cannot be used after it, note calling av_free_packet() on them is still safe.
- *
- * @param s media file handle
- * @param out the interleaved packet will be output here
- * @param in the input packet
- * @param flush 1 if no further packets are available as input and all
- *              remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
- *         < 0 if an error occured
- */
-int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush);
-
-/**
- * @brief Write the stream trailer to an output media file and
- *        free the file private data.
- *
- * @param s media file handle
- * @return 0 if OK. AVERROR_xxx if error.
- */
-int av_write_trailer(AVFormatContext *s);
-
-void dump_format(AVFormatContext *ic,
-                 int index,
-                 const char *url,
-                 int is_output);
-
-/**
- * parses width and height out of string str.
- * @deprecated Use av_parse_video_frame_size instead.
- */
-attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
-
-/**
- * Converts frame rate from string to a fraction.
- * @deprecated Use av_parse_video_frame_rate instead.
- */
-attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg);
-
-/**
- * Parses \p datestr and returns a corresponding number of microseconds.
- * @param datestr String representing a date or a duration.
- * - If a date the syntax is:
- * @code
- *  [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]}
- * @endcode
- * Time is localtime unless Z is appended, in which case it is
- * interpreted as UTC.
- * If the year-month-day part isn't specified it takes the current
- * year-month-day.
- * Returns the number of microseconds since 1st of January, 1970 up to
- * the time of the parsed date or INT64_MIN if \p datestr cannot be
- * successfully parsed.
- * - If a duration the syntax is:
- * @code
- *  [-]HH[:MM[:SS[.m...]]]
- *  [-]S+[.m...]
- * @endcode
- * Returns the number of microseconds contained in a time interval
- * with the specified duration or INT64_MIN if \p datestr cannot be
- * succesfully parsed.
- * @param duration Flag which tells how to interpret \p datestr, if
- * not zero \p datestr is interpreted as a duration, otherwise as a
- * date.
- */
-int64_t parse_date(const char *datestr, int duration);
-
-int64_t av_gettime(void);
-
-/* ffm specific for ffserver */
-#define FFM_PACKET_SIZE 4096
-offset_t ffm_read_write_index(int fd);
-void ffm_write_write_index(int fd, offset_t pos);
-void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size);
-
-/**
- * Attempts to find a specific tag in a URL.
- *
- * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
- * Return 1 if found.
- */
-int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
-
-/**
- * Returns in 'buf' the path with '%d' replaced by number.
-
- * Also handles the '%0nd' format where 'n' is the total number
- * of digits and '%%'.
- *
- * @param buf destination buffer
- * @param buf_size destination buffer size
- * @param path numbered sequence string
- * @number frame number
- * @return 0 if OK, -1 if format error.
- */
-int av_get_frame_filename(char *buf, int buf_size,
-                          const char *path, int number);
-
-/**
- * Check whether filename actually is a numbered sequence generator.
- *
- * @param filename possible numbered sequence string
- * @return 1 if a valid numbered sequence string, 0 otherwise.
- */
-int av_filename_number_test(const char *filename);
-
-/**
- * Generate an SDP for an RTP session.
- *
- * @param ac array of AVFormatContexts describing the RTP streams. If the
- *           array is composed by only one context, such context can contain
- *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
- *           all the contexts in the array (an AVCodecContext per RTP stream)
- *           must contain only one AVStream
- * @param n_files number of AVCodecContexts contained in ac
- * @param buff buffer where the SDP will be stored (must be allocated by
- *             the caller
- * @param size the size of the buffer
- * @return 0 if OK. AVERROR_xxx if error.
- */
-int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
-
-#ifdef HAVE_AV_CONFIG_H
-
-#include "os_support.h"
-
-void __dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
-
-#ifdef __GNUC__
-#define dynarray_add(tab, nb_ptr, elem)\
-do {\
-    typeof(tab) _tab = (tab);\
-    typeof(elem) _elem = (elem);\
-    (void)sizeof(**_tab == _elem); /* check that types are compatible */\
-    __dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\
-} while(0)
-#else
-#define dynarray_add(tab, nb_ptr, elem)\
-do {\
-    __dynarray_add((unsigned long **)(tab), nb_ptr, (unsigned long)(elem));\
-} while(0)
-#endif
-
-time_t mktimegm(struct tm *tm);
-struct tm *brktimegm(time_t secs, struct tm *tm);
-const char *small_strptime(const char *p, const char *fmt,
-                           struct tm *dt);
-
-struct in_addr;
-int resolve_host(struct in_addr *sin_addr, const char *hostname);
-
-void url_split(char *proto, int proto_size,
-               char *authorization, int authorization_size,
-               char *hostname, int hostname_size,
-               int *port_ptr,
-               char *path, int path_size,
-               const char *url);
-
-int match_ext(const char *filename, const char *extensions);
-
-#endif /* HAVE_AV_CONFIG_H */
-
-#endif /* AVFORMAT_H */
-
diff --git a/ffmpeg 0.5/include/ffmpeg/avio.h b/ffmpeg 0.5/include/ffmpeg/avio.h
deleted file mode 100644 (file)
index c8c9a04..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * unbuffered io for ffmpeg system
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVIO_H
-#define AVIO_H
-
-#include <stdint.h>
-
-/* output byte stream handling */
-
-typedef int64_t offset_t;
-
-/* unbuffered I/O */
-
-struct URLContext {
-    struct URLProtocol *prot;
-    int flags;
-    int is_streamed;  /**< true if streamed (no seek possible), default = false */
-    int max_packet_size;  /**< if non zero, the stream is packetized with this max packet size */
-    void *priv_data;
-#if LIBAVFORMAT_VERSION_INT >= (52<<16)
-    char *filename; /**< specified filename */
-#else
-    char filename[1]; /**< specified filename */
-#endif
-};
-
-typedef struct URLContext URLContext;
-
-typedef struct URLPollEntry {
-    URLContext *handle;
-    int events;
-    int revents;
-} URLPollEntry;
-
-#define URL_RDONLY 0
-#define URL_WRONLY 1
-#define URL_RDWR   2
-
-typedef int URLInterruptCB(void);
-
-int url_open(URLContext **h, const char *filename, int flags);
-int url_read(URLContext *h, unsigned char *buf, int size);
-int url_write(URLContext *h, unsigned char *buf, int size);
-offset_t url_seek(URLContext *h, offset_t pos, int whence);
-int url_close(URLContext *h);
-int url_exist(const char *filename);
-offset_t url_filesize(URLContext *h);
-
-/**
- * Return the maximum packet size associated to packetized file
- * handle. If the file is not packetized (stream like http or file on
- * disk), then 0 is returned.
- *
- * @param h file handle
- * @return maximum packet size in bytes
- */
-int url_get_max_packet_size(URLContext *h);
-void url_get_filename(URLContext *h, char *buf, int buf_size);
-
-/**
- * the callback is called in blocking functions to test regulary if
- * asynchronous interruption is needed. AVERROR(EINTR) is returned
- * in this case by the interrupted function. 'NULL' means no interrupt
- * callback is given. i
- */
-void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
-
-/* not implemented */
-int url_poll(URLPollEntry *poll_table, int n, int timeout);
-
-/**
- * Passing this as the "whence" parameter to a seek function causes it to
- * return the filesize without seeking anywhere. Supporting this is optional.
- * If it is not supported then the seek function will return <0.
- */
-#define AVSEEK_SIZE 0x10000
-
-typedef struct URLProtocol {
-    const char *name;
-    int (*url_open)(URLContext *h, const char *filename, int flags);
-    int (*url_read)(URLContext *h, unsigned char *buf, int size);
-    int (*url_write)(URLContext *h, unsigned char *buf, int size);
-    offset_t (*url_seek)(URLContext *h, offset_t pos, int whence);
-    int (*url_close)(URLContext *h);
-    struct URLProtocol *next;
-} URLProtocol;
-
-extern URLProtocol *first_protocol;
-extern URLInterruptCB *url_interrupt_cb;
-
-int register_protocol(URLProtocol *protocol);
-
-typedef struct {
-    unsigned char *buffer;
-    int buffer_size;
-    unsigned char *buf_ptr, *buf_end;
-    void *opaque;
-    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
-    offset_t (*seek)(void *opaque, offset_t offset, int whence);
-    offset_t pos; /**< position in the file of the current buffer */
-    int must_flush; /**< true if the next seek should flush */
-    int eof_reached; /**< true if eof reached */
-    int write_flag;  /**< true if open for writing */
-    int is_streamed;
-    int max_packet_size;
-    unsigned long checksum;
-    unsigned char *checksum_ptr;
-    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
-    int error;         ///< contains the error code or 0 if no error happened
-} ByteIOContext;
-
-int init_put_byte(ByteIOContext *s,
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  offset_t (*seek)(void *opaque, offset_t offset, int whence));
-
-void put_byte(ByteIOContext *s, int b);
-void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
-void put_le64(ByteIOContext *s, uint64_t val);
-void put_be64(ByteIOContext *s, uint64_t val);
-void put_le32(ByteIOContext *s, unsigned int val);
-void put_be32(ByteIOContext *s, unsigned int val);
-void put_le24(ByteIOContext *s, unsigned int val);
-void put_be24(ByteIOContext *s, unsigned int val);
-void put_le16(ByteIOContext *s, unsigned int val);
-void put_be16(ByteIOContext *s, unsigned int val);
-void put_tag(ByteIOContext *s, const char *tag);
-
-void put_strz(ByteIOContext *s, const char *buf);
-
-offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence);
-void url_fskip(ByteIOContext *s, offset_t offset);
-offset_t url_ftell(ByteIOContext *s);
-offset_t url_fsize(ByteIOContext *s);
-int url_feof(ByteIOContext *s);
-int url_ferror(ByteIOContext *s);
-
-#define URL_EOF (-1)
-/** @note return URL_EOF (-1) if EOF */
-int url_fgetc(ByteIOContext *s);
-
-/** @warning currently size is limited */
-#ifdef __GNUC__
-int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
-#else
-int url_fprintf(ByteIOContext *s, const char *fmt, ...);
-#endif
-
-/** @note unlike fgets, the EOL character is not returned and a whole
-   line is parsed. return NULL if first char read was EOF */
-char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
-
-void put_flush_packet(ByteIOContext *s);
-
-int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
-int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
-
-/** @note return 0 if EOF, so you cannot use it if EOF handling is
-   necessary */
-int get_byte(ByteIOContext *s);
-unsigned int get_le24(ByteIOContext *s);
-unsigned int get_le32(ByteIOContext *s);
-uint64_t get_le64(ByteIOContext *s);
-unsigned int get_le16(ByteIOContext *s);
-
-char *get_strz(ByteIOContext *s, char *buf, int maxlen);
-unsigned int get_be16(ByteIOContext *s);
-unsigned int get_be24(ByteIOContext *s);
-unsigned int get_be32(ByteIOContext *s);
-uint64_t get_be64(ByteIOContext *s);
-
-static inline int url_is_streamed(ByteIOContext *s)
-{
-    return s->is_streamed;
-}
-
-/** @note when opened as read/write, the buffers are only used for
-   writing */
-int url_fdopen(ByteIOContext *s, URLContext *h);
-
-/** @warning must be called before any I/O */
-int url_setbufsize(ByteIOContext *s, int buf_size);
-
-/** @note when opened as read/write, the buffers are only used for
-   writing */
-int url_fopen(ByteIOContext *s, const char *filename, int flags);
-int url_fclose(ByteIOContext *s);
-URLContext *url_fileno(ByteIOContext *s);
-
-/**
- * Return the maximum packet size associated to packetized buffered file
- * handle. If the file is not packetized (stream like http or file on
- * disk), then 0 is returned.
- *
- * @param h buffered file handle
- * @return maximum packet size in bytes
- */
-int url_fget_max_packet_size(ByteIOContext *s);
-
-int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags);
-
-/** return the written or read size */
-int url_close_buf(ByteIOContext *s);
-
-/**
- * Open a write only memory stream.
- *
- * @param s new IO context
- * @return zero if no error.
- */
-int url_open_dyn_buf(ByteIOContext *s);
-
-/**
- * Open a write only packetized memory stream with a maximum packet
- * size of 'max_packet_size'.  The stream is stored in a memory buffer
- * with a big endian 4 byte header giving the packet size in bytes.
- *
- * @param s new IO context
- * @param max_packet_size maximum packet size (must be > 0)
- * @return zero if no error.
- */
-int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size);
-
-/**
- * Return the written size and a pointer to the buffer. The buffer
- *  must be freed with av_free().
- * @param s IO context
- * @param pointer to a byte buffer
- * @return the length of the byte buffer
- */
-int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
-
-unsigned long get_checksum(ByteIOContext *s);
-void init_checksum(ByteIOContext *s, unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum);
-
-/* udp.c */
-int udp_set_remote_url(URLContext *h, const char *uri);
-int udp_get_local_port(URLContext *h);
-int udp_get_file_handle(URLContext *h);
-
-#endif
-
diff --git a/ffmpeg 0.5/include/ffmpeg/avstring.h b/ffmpeg 0.5/include/ffmpeg/avstring.h
deleted file mode 100644 (file)
index f25dd31..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2007 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_STRING_H
-#define AVUTIL_STRING_H
-
-#include <stddef.h>
-
-/**
- * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
- * the address of the first character in str after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated after the prefix in str in there is a match
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_strstart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Return non-zero if pfx is a prefix of str independent of case. If
- * it is, *ptr is set to the address of the first character in str
- * after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated after the prefix in str in there is a match
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_stristart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Copy the string src to dst, but no more than size - 1 bytes, and
- * null terminate dst.
- *
- * This function is the same as BSD strlcpy().
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the length of src
- */
-size_t av_strlcpy(char *dst, const char *src, size_t size);
-
-/**
- * Append the string src to the string dst, but to a total length of
- * no more than size - 1 bytes, and null terminate dst.
- *
- * This function is similar to BSD strlcat(), but differs when
- * size <= strlen(dst).
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the total length of src and dst
- */
-size_t av_strlcat(char *dst, const char *src, size_t size);
-
-/**
- * Append output to a string, according to a format. Never write out of
- * the destination buffer, and and always put a terminating 0 within
- * the buffer.
- * @param dst destination buffer (string to which the output is
- *  appended)
- * @param size total size of the destination buffer
- * @param fmt printf-compatible format string, specifying how the
- *  following parameters are used
- * @return the length of the string that would have been generated
- *  if enough space had been available
- */
-size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
-
-#endif /* AVUTIL_STRING_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/avutil.h b/ffmpeg 0.5/include/ffmpeg/avutil.h
deleted file mode 100644 (file)
index 7025286..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_H
-#define AVUTIL_H
-
-/**
- * @file avutil.h
- * external api header.
- */
-
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define LIBAVUTIL_VERSION_INT   ((49<<16)+(5<<8)+0)
-#define LIBAVUTIL_VERSION       49.5.0
-#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-
-#include "common.h"
-#include "mathematics.h"
-#include "rational.h"
-#include "integer.h"
-#include "intfloat_readwrite.h"
-#include "log.h"
-
-/**
- * Pixel format. Notes:
- *
- * PIX_FMT_RGB32 is handled in an endian-specific manner. A RGBA
- * color is put together as:
- *  (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little endian CPU architectures and ARGB on
- * big endian CPUs.
- *
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1] and, is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- */
-enum PixelFormat {
-    PIX_FMT_NONE= -1,
-    PIX_FMT_YUV420P,   ///< Planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    PIX_FMT_YUYV422,   ///< Packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    PIX_FMT_RGB24,     ///< Packed RGB 8:8:8, 24bpp, RGBRGB...
-    PIX_FMT_BGR24,     ///< Packed RGB 8:8:8, 24bpp, BGRBGR...
-    PIX_FMT_YUV422P,   ///< Planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    PIX_FMT_YUV444P,   ///< Planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    PIX_FMT_RGB32,     ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in cpu endianness
-    PIX_FMT_YUV410P,   ///< Planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    PIX_FMT_YUV411P,   ///< Planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    PIX_FMT_RGB565,    ///< Packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), in cpu endianness
-    PIX_FMT_RGB555,    ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 0
-    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black
-    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white
-    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    PIX_FMT_YUVJ420P,  ///< Planar YUV 4:2:0, 12bpp, full scale (jpeg)
-    PIX_FMT_YUVJ422P,  ///< Planar YUV 4:2:2, 16bpp, full scale (jpeg)
-    PIX_FMT_YUVJ444P,  ///< Planar YUV 4:4:4, 24bpp, full scale (jpeg)
-    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
-    PIX_FMT_XVMC_MPEG2_IDCT,
-    PIX_FMT_UYVY422,   ///< Packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    PIX_FMT_UYYVYY411, ///< Packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    PIX_FMT_BGR32,     ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness
-    PIX_FMT_BGR565,    ///< Packed RGB 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), in cpu endianness
-    PIX_FMT_BGR555,    ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1
-    PIX_FMT_BGR8,      ///< Packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    PIX_FMT_BGR4,      ///< Packed RGB 1:2:1,  4bpp, (msb)1B 2G 1R(lsb)
-    PIX_FMT_BGR4_BYTE, ///< Packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    PIX_FMT_RGB8,      ///< Packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_RGB4,      ///< Packed RGB 1:2:1,  4bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_RGB4_BYTE, ///< Packed RGB 1:2:1,  8bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_NV12,      ///< Planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
-    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    PIX_FMT_RGB32_1,   ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness
-    PIX_FMT_BGR32_1,   ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness
-
-    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    PIX_FMT_YUV440P,   ///< Planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    PIX_FMT_YUVJ440P,  ///< Planar YUV 4:4:0 full scale (jpeg)
-    PIX_FMT_YUVA420P,  ///< Planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-};
-
-#ifdef WORDS_BIGENDIAN
-#define PIX_FMT_RGBA PIX_FMT_RGB32_1
-#define PIX_FMT_BGRA PIX_FMT_BGR32_1
-#define PIX_FMT_ARGB PIX_FMT_RGB32
-#define PIX_FMT_ABGR PIX_FMT_BGR32
-#define PIX_FMT_GRAY16 PIX_FMT_GRAY16BE
-#else
-#define PIX_FMT_RGBA PIX_FMT_BGR32
-#define PIX_FMT_BGRA PIX_FMT_RGB32
-#define PIX_FMT_ARGB PIX_FMT_BGR32_1
-#define PIX_FMT_ABGR PIX_FMT_RGB32_1
-#define PIX_FMT_GRAY16 PIX_FMT_GRAY16LE
-#endif
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define PIX_FMT_UYVY411 PIX_FMT_UYYVYY411
-#define PIX_FMT_RGBA32  PIX_FMT_RGB32
-#define PIX_FMT_YUV422  PIX_FMT_YUYV422
-#endif
-
-#endif /* AVUTIL_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/base64.h b/ffmpeg 0.5/include/ffmpeg/base64.h
deleted file mode 100644 (file)
index 1ee7014..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Base64.c
- * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BASE64_H
-#define AVUTIL_BASE64_H
-
-#include <stdint.h>
-
-/**
- * decodes base64
- * param order as strncpy()
- */
-int av_base64_decode(uint8_t * out, const char *in, int out_length);
-
-/**
- * encodes base64
- * @param src data, not a string
- * @param buf output string
- */
-char *av_base64_encode(char * buf, int buf_len, uint8_t * src, int len);
-
-#endif // AVUTIL_BASE64_H
diff --git a/ffmpeg 0.5/include/ffmpeg/common.h b/ffmpeg 0.5/include/ffmpeg/common.h
deleted file mode 100644 (file)
index 9550403..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file common.h
- * common internal and external api header.
- */
-
-#ifndef COMMON_H
-#define COMMON_H
-
-#include <inttypes.h>
-
-#ifdef HAVE_AV_CONFIG_H
-/* only include the following when compiling package */
-#    include "config.h"
-
-#    include <stdlib.h>
-#    include <stdio.h>
-#    include <string.h>
-#    include <ctype.h>
-#    include <limits.h>
-#    include <errno.h>
-#    include <math.h>
-#endif /* HAVE_AV_CONFIG_H */
-
-#ifndef av_always_inline
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#    define av_always_inline __attribute__((always_inline)) inline
-#else
-#    define av_always_inline inline
-#endif
-#endif
-
-#ifndef av_noinline
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#    define av_noinline __attribute__((noinline))
-#else
-#    define av_noinline
-#endif
-#endif
-
-#ifdef HAVE_AV_CONFIG_H
-#    include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
-
-#ifndef attribute_deprecated
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#    define attribute_deprecated __attribute__((deprecated))
-#else
-#    define attribute_deprecated
-#endif
-#endif
-
-#ifndef av_unused
-#if defined(__GNUC__)
-#    define av_unused __attribute__((unused))
-#else
-#    define av_unused
-#endif
-#endif
-
-#include "mem.h"
-
-//rounded divison & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
-/* assume b>0 */
-#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
-#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
-
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-
-#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
-
-/* misc math functions */
-extern const uint8_t ff_log2_tab[256];
-
-static inline int av_log2(unsigned int v)
-{
-    int n;
-
-    n = 0;
-    if (v & 0xffff0000) {
-        v >>= 16;
-        n += 16;
-    }
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-
-static inline int av_log2_16bit(unsigned int v)
-{
-    int n;
-
-    n = 0;
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-
-/* median of 3 */
-static inline int mid_pred(int a, int b, int c)
-{
-#ifdef HAVE_CMOV
-    int i=b;
-    asm volatile(
-        "cmp    %2, %1 \n\t"
-        "cmovg  %1, %0 \n\t"
-        "cmovg  %2, %1 \n\t"
-        "cmp    %3, %1 \n\t"
-        "cmovl  %3, %1 \n\t"
-        "cmp    %1, %0 \n\t"
-        "cmovg  %1, %0 \n\t"
-        :"+&r"(i), "+&r"(a)
-        :"r"(b), "r"(c)
-    );
-    return i;
-#elif 0
-    int t= (a-b)&((a-b)>>31);
-    a-=t;
-    b+=t;
-    b-= (b-c)&((b-c)>>31);
-    b+= (a-b)&((a-b)>>31);
-
-    return b;
-#else
-    if(a>b){
-        if(c>b){
-            if(c>a) b=a;
-            else    b=c;
-        }
-    }else{
-        if(b>c){
-            if(c>a) b=c;
-            else    b=a;
-        }
-    }
-    return b;
-#endif
-}
-
-/**
- * clip a signed integer value into the amin-amax range
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static inline int av_clip(int a, int amin, int amax)
-{
-    if (a < amin)      return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/**
- * clip a signed integer value into the 0-255 range
- * @param a value to clip
- * @return clipped value
- */
-static inline uint8_t av_clip_uint8(int a)
-{
-    if (a&(~255)) return (-a)>>31;
-    else          return a;
-}
-
-/**
- * clip a signed integer value into the -32768,32767 range
- * @param a value to clip
- * @return clipped value
- */
-static inline int16_t av_clip_int16(int a)
-{
-    if ((a+32768) & ~65535) return (a>>31) ^ 32767;
-    else                    return a;
-}
-
-/* math */
-int64_t ff_gcd(int64_t a, int64_t b);
-
-/**
- * converts fourcc string to int
- */
-static inline int ff_get_fourcc(const char *s){
-#ifdef HAVE_AV_CONFIG_H
-    assert( strlen(s)==4 );
-#endif
-
-    return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24);
-}
-
-#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
-#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
-
-/*!
- * \def GET_UTF8(val, GET_BYTE, ERROR)
- * converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
- * \param val is the output and should be of type uint32_t. It holds the converted
- * UCS-4 character and should be a left value.
- * \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
- * a function or a statement whose return value or evaluated value is of type
- * uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range,
- * and up to 7 times in the general case.
- * \param ERROR action that should be taken when an invalid UTF-8 byte is returned
- * from GET_BYTE. It should be a statement that jumps out of the macro,
- * like exit(), goto, return, break, or continue.
- */
-#define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= GET_BYTE;\
-    {\
-        int ones= 7 - av_log2(val ^ 255);\
-        if(ones==1)\
-            ERROR\
-        val&= 127>>ones;\
-        while(--ones > 0){\
-            int tmp= GET_BYTE - 128;\
-            if(tmp>>6)\
-                ERROR\
-            val= (val<<6) + tmp;\
-        }\
-    }
-
-/*!
- * \def PUT_UTF8(val, tmp, PUT_BYTE)
- * converts a 32-bit unicode character to its UTF-8 encoded form (up to 4 bytes long).
- * \param val is an input only argument and should be of type uint32_t. It holds
- * a ucs4 encoded unicode character that is to be converted to UTF-8. If
- * val is given as a function it's executed only once.
- * \param tmp is a temporary variable and should be of type uint8_t. It
- * represents an intermediate value during conversion that is to be
- * outputted by PUT_BYTE.
- * \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
- * It could be a function or a statement, and uses tmp as the input byte.
- * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
- * executed up to 4 times for values in the valid UTF-8 range and up to
- * 7 times in the general case, depending on the length of the converted
- * unicode character.
- */
-#define PUT_UTF8(val, tmp, PUT_BYTE)\
-    {\
-        int bytes, shift;\
-        uint32_t in = val;\
-        if (in < 0x80) {\
-            tmp = in;\
-            PUT_BYTE\
-        } else {\
-            bytes = (av_log2(in) + 4) / 5;\
-            shift = (bytes - 1) * 6;\
-            tmp = (256 - (256 >> bytes)) | (in >> shift);\
-            PUT_BYTE\
-            while (shift >= 6) {\
-                shift -= 6;\
-                tmp = 0x80 | ((in >> shift) & 0x3f);\
-                PUT_BYTE\
-            }\
-        }\
-    }
-
-#if defined(ARCH_X86) || defined(ARCH_POWERPC) || defined(ARCH_BFIN)
-#define AV_READ_TIME read_time
-#if defined(ARCH_X86_64)
-static inline uint64_t read_time(void)
-{
-        uint64_t a, d;
-        asm volatile(   "rdtsc\n\t"
-                : "=a" (a), "=d" (d)
-        );
-        return (d << 32) | (a & 0xffffffff);
-}
-#elif defined(ARCH_X86_32)
-static inline long long read_time(void)
-{
-        long long l;
-        asm volatile(   "rdtsc\n\t"
-                : "=A" (l)
-        );
-        return l;
-}
-#elif ARCH_BFIN
-static inline uint64_t read_time(void)
-{
-    union {
-        struct {
-            unsigned lo;
-            unsigned hi;
-        } p;
-        unsigned long long c;
-    } t;
-    asm volatile ("%0=cycles; %1=cycles2;" : "=d" (t.p.lo), "=d" (t.p.hi));
-    return t.c;
-}
-#else //FIXME check ppc64
-static inline uint64_t read_time(void)
-{
-    uint32_t tbu, tbl, temp;
-
-     /* from section 2.2.1 of the 32-bit PowerPC PEM */
-     __asm__ __volatile__(
-         "1:\n"
-         "mftbu  %2\n"
-         "mftb   %0\n"
-         "mftbu  %1\n"
-         "cmpw   %2,%1\n"
-         "bne    1b\n"
-     : "=r"(tbl), "=r"(tbu), "=r"(temp)
-     :
-     : "cc");
-
-     return (((uint64_t)tbu)<<32) | (uint64_t)tbl;
-}
-#endif
-#elif defined(HAVE_GETHRTIME)
-#define AV_READ_TIME gethrtime
-#endif
-
-#ifdef AV_READ_TIME
-#define START_TIMER \
-uint64_t tend;\
-uint64_t tstart= AV_READ_TIME();\
-
-#define STOP_TIMER(id) \
-tend= AV_READ_TIME();\
-{\
-  static uint64_t tsum=0;\
-  static int tcount=0;\
-  static int tskip_count=0;\
-  if(tcount<2 || tend - tstart < FFMAX(8*tsum/tcount, 2000)){\
-      tsum+= tend - tstart;\
-      tcount++;\
-  }else\
-      tskip_count++;\
-  if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\
-      av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" dezicycles in %s, %d runs, %d skips\n", tsum*10/tcount, id, tcount, tskip_count);\
-  }\
-}
-#else
-#define START_TIMER
-#define STOP_TIMER(id) {}
-#endif
-
-#endif /* COMMON_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/fifo.h b/ffmpeg 0.5/include/ffmpeg/fifo.h
deleted file mode 100644 (file)
index 278a8c8..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file fifo.h
- * A very simple circular buffer FIFO implementation.
- */
-
-#ifndef FIFO_H
-#define FIFO_H
-
-#include <stdint.h>
-
-typedef struct AVFifoBuffer {
-    uint8_t *buffer;
-    uint8_t *rptr, *wptr, *end;
-} AVFifoBuffer;
-
-/**
- * Initializes an AVFifoBuffer.
- * @param *f AVFifoBuffer to initialize
- * @param size of FIFO
- * @return <0 for failure >=0 otherwise
- */
-int av_fifo_init(AVFifoBuffer *f, int size);
-
-/**
- * Frees an AVFifoBuffer.
- * @param *f AVFifoBuffer to free
- */
-void av_fifo_free(AVFifoBuffer *f);
-
-/**
- * Returns the amount of data in bytes in the AVFifoBuffer, that is the
- * amount of data you can read from it.
- * @param *f AVFifoBuffer to read from
- * @return size
- */
-int av_fifo_size(AVFifoBuffer *f);
-
-/**
- * Reads data from an AVFifoBuffer.
- * @param *f AVFifoBuffer to read from
- * @param *buf data destination
- * @param buf_size number of bytes to read
- */
-int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
-
-/**
- * Feeds data from an AVFifoBuffer to a user supplied callback.
- * @param *f AVFifoBuffer to read from
- * @param buf_size number of bytes to read
- * @param *func generic read function
- * @param *dest data destination
- */
-int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
-
-/**
- * Writes data into an AVFifoBuffer.
- * @param *f AVFifoBuffer to write to
- * @param *buf data source
- * @param size data size
- */
-void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
-
-/**
- * Resizes an AVFifoBuffer.
- * @param *f AVFifoBuffer to resize
- * @param size new AVFifoBuffer size in bytes
- */
-void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
-
-/**
- * Reads and discards the specified amount of data from an AVFifoBuffer.
- * @param *f AVFifoBuffer to read from
- * @param size amount of data to read in bytes
- */
-void av_fifo_drain(AVFifoBuffer *f, int size);
-
-static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
-{
-    uint8_t *ptr = f->rptr + offs;
-    if (ptr >= f->end)
-        ptr -= f->end - f->buffer;
-    return *ptr;
-}
-#endif /* FIFO_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/integer.h b/ffmpeg 0.5/include/ffmpeg/integer.h
deleted file mode 100644 (file)
index 2a1df34..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * arbitrary precision integers
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file integer.h
- * arbitrary precision integers
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef INTEGER_H
-#define INTEGER_H
-
-#include <stdint.h>
-
-#define AV_INTEGER_SIZE 8
-
-typedef struct AVInteger{
-    uint16_t v[AV_INTEGER_SIZE];
-} AVInteger;
-
-AVInteger av_add_i(AVInteger a, AVInteger b);
-AVInteger av_sub_i(AVInteger a, AVInteger b);
-
-/**
- * returns the rounded down value of the logarithm of base 2 of the given AVInteger.
- * this is simply the index of the most significant bit which is 1. Or 0 of all bits are 0
- */
-int av_log2_i(AVInteger a);
-AVInteger av_mul_i(AVInteger a, AVInteger b);
-
-/**
- * returns 0 if a==b, 1 if a>b and -1 if a<b.
- */
-int av_cmp_i(AVInteger a, AVInteger b);
-
-/**
- * bitwise shift.
- * @param s the number of bits by which the value should be shifted right, may be negative for shifting left
- */
-AVInteger av_shr_i(AVInteger a, int s);
-
-/**
- * returns a % b.
- * @param quot a/b will be stored here
- */
-AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b);
-
-/**
- * returns a/b.
- */
-AVInteger av_div_i(AVInteger a, AVInteger b);
-
-/**
- * converts the given int64_t to an AVInteger.
- */
-AVInteger av_int2i(int64_t a);
-
-/**
- * converts the given AVInteger to an int64_t.
- * if the AVInteger is too large to fit into an int64_t,
- * then only the least significant 64bit will be used
- */
-int64_t av_i2int(AVInteger a);
-
-#endif // INTEGER_H
diff --git a/ffmpeg 0.5/include/ffmpeg/intfloat_readwrite.h b/ffmpeg 0.5/include/ffmpeg/intfloat_readwrite.h
deleted file mode 100644 (file)
index c535b64..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INTFLOAT_READWRITE_H
-#define INTFLOAT_READWRITE_H
-
-#include "common.h"
-
-/* IEEE 80 bits extended float */
-typedef struct AVExtFloat  {
-    uint8_t exponent[2];
-    uint8_t mantissa[8];
-} AVExtFloat;
-
-double av_int2dbl(int64_t v);
-float av_int2flt(int32_t v);
-double av_ext2dbl(const AVExtFloat ext);
-int64_t av_dbl2int(double d);
-int32_t av_flt2int(float d);
-AVExtFloat av_dbl2ext(double d);
-
-#endif /* INTFLOAT_READWRITE_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/log.h b/ffmpeg 0.5/include/ffmpeg/log.h
deleted file mode 100644 (file)
index fa88f5f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LOG_H
-#define LOG_H
-
-#include <stdarg.h>
-
-/**
- * Used by av_log
- */
-typedef struct AVCLASS AVClass;
-struct AVCLASS {
-    const char* class_name;
-    const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext
-                                        or AVFormatContext, which begin with an AVClass.
-                                        Needed because av_log is in libavcodec and has no visibility
-                                        of AVIn/OutputFormat */
-    const struct AVOption *option;
-};
-
-/* av_log API */
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define AV_LOG_QUIET -1
-#define AV_LOG_FATAL 0
-#define AV_LOG_ERROR 0
-#define AV_LOG_WARNING 1
-#define AV_LOG_INFO 1
-#define AV_LOG_VERBOSE 1
-#define AV_LOG_DEBUG 2
-#else
-#define AV_LOG_QUIET    -8
-
-/**
- * something went really wrong and we will crash now
- */
-#define AV_LOG_PANIC     0
-
-/**
- * something went wrong and recovery is not possible
- * like no header in a format which depends on it or a combination
- * of parameters which are not allowed
- */
-#define AV_LOG_FATAL     8
-
-/**
- * something went wrong and cannot losslessly be recovered
- * but not all future data is affected
- */
-#define AV_LOG_ERROR    16
-
-/**
- * something somehow does not look correct / something which may or may not
- * lead to some problems like use of -vstrict -2
- */
-#define AV_LOG_WARNING  24
-
-#define AV_LOG_INFO     32
-#define AV_LOG_VERBOSE  40
-
-/**
- * stuff which is only useful for libav* developers
- */
-#define AV_LOG_DEBUG    48
-#endif
-extern int av_log_level;
-
-/**
- * Send the specified message to the log if the level is less than or equal to
- * the current av_log_level. By default, all logging messages are sent to
- * stderr. This behavior can be altered by setting a different av_vlog callback
- * function.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param fmt The format string (printf-compatible) that specifies how
- * subsequent arguments are converted to output.
- * @see av_vlog
- */
-#ifdef __GNUC__
-extern void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-#else
-extern void av_log(void*, int level, const char *fmt, ...);
-#endif
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-extern void av_vlog(void*, int level, const char *fmt, va_list);
-extern int av_log_get_level(void);
-extern void av_log_set_level(int);
-extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
-extern void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
-#else
-extern void (*av_vlog)(void*, int, const char*, va_list);
-#endif
-
-#endif /* LOG_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/lzo.h b/ffmpeg 0.5/include/ffmpeg/lzo.h
deleted file mode 100644 (file)
index 5b3d98f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * LZO 1x decompression
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LZO_H
-#define LZO_H
-
-#define LZO_INPUT_DEPLETED 1
-#define LZO_OUTPUT_FULL 2
-#define LZO_INVALID_BACKPTR 4
-#define LZO_ERROR 8
-
-#define LZO_INPUT_PADDING 8
-#define LZO_OUTPUT_PADDING 12
-
-int lzo1x_decode(void *out, int *outlen, void *in, int *inlen);
-
-#endif
diff --git a/ffmpeg 0.5/include/ffmpeg/mathematics.h b/ffmpeg 0.5/include/ffmpeg/mathematics.h
deleted file mode 100644 (file)
index 0b74b25..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef MATHEMATICS_H
-#define MATHEMATICS_H
-
-#include "rational.h"
-
-enum AVRounding {
-    AV_ROUND_ZERO     = 0, ///< round toward zero
-    AV_ROUND_INF      = 1, ///< round away from zero
-    AV_ROUND_DOWN     = 2, ///< round toward -infinity
-    AV_ROUND_UP       = 3, ///< round toward +infinity
-    AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
-};
-
-/**
- * rescale a 64bit integer with rounding to nearest.
- * a simple a*b/c isn't possible as it can overflow
- */
-int64_t av_rescale(int64_t a, int64_t b, int64_t c);
-
-/**
- * rescale a 64bit integer with specified rounding.
- * a simple a*b/c isn't possible as it can overflow
- */
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
-
-/**
- * rescale a 64bit integer by 2 rational numbers.
- */
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq);
-
-#endif /* MATHEMATICS_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/md5.h b/ffmpeg 0.5/include/ffmpeg/md5.h
deleted file mode 100644 (file)
index fa83b1c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef MD5_H
-#define MD5_H
-
-#include <stdint.h>
-
-extern const int av_md5_size;
-
-struct AVMD5;
-
-void av_md5_init(struct AVMD5 *ctx);
-void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
-void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
-
-#endif /* MD5_H */
-
diff --git a/ffmpeg 0.5/include/ffmpeg/mem.h b/ffmpeg 0.5/include/ffmpeg/mem.h
deleted file mode 100644 (file)
index 81b8724..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mem.h
- * Memory handling functions.
- */
-
-#ifndef AV_MEM_H
-#define AV_MEM_H
-
-#ifdef __GNUC__
-  #define DECLARE_ALIGNED(n,t,v)       t v __attribute__ ((aligned (n)))
-#else
-  #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
-#endif
-
-/**
- * Memory allocation of size byte with alignment suitable for all
- * memory accesses (including vectors if available on the
- * CPU). av_malloc(0) must return a non NULL pointer.
- */
-void *av_malloc(unsigned int size);
-
-/**
- * av_realloc semantics (same as glibc): if ptr is NULL and size > 0,
- * identical to malloc(size). If size is zero, it is identical to
- * free(ptr) and NULL is returned.
- */
-void *av_realloc(void *ptr, unsigned int size);
-
-/**
- * Free memory which has been allocated with av_malloc(z)() or av_realloc().
- * NOTE: ptr = NULL is explicetly allowed
- * Note2: it is recommended that you use av_freep() instead
- */
-void av_free(void *ptr);
-
-void *av_mallocz(unsigned int size);
-
-/**
- * Duplicates the string \p s.
- * @param s String to be duplicated.
- * @return Pointer to a newly allocated string containing a
- * copy of \p s or NULL if it cannot allocate it.
- */
-char *av_strdup(const char *s);
-
-/**
- * Frees memory and sets the pointer to NULL.
- * @param ptr pointer to the pointer which should be freed
- */
-void av_freep(void *ptr);
-
-#endif /* AV_MEM_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/opt.h b/ffmpeg 0.5/include/ffmpeg/opt.h
deleted file mode 100644 (file)
index b79f462..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * AVOptions
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVOPT_H
-#define AVOPT_H
-
-/**
- * @file opt.h
- * AVOptions
- */
-
-#include "rational.h"
-
-enum AVOptionType{
-    FF_OPT_TYPE_FLAGS,
-    FF_OPT_TYPE_INT,
-    FF_OPT_TYPE_INT64,
-    FF_OPT_TYPE_DOUBLE,
-    FF_OPT_TYPE_FLOAT,
-    FF_OPT_TYPE_STRING,
-    FF_OPT_TYPE_RATIONAL,
-    FF_OPT_TYPE_CONST=128,
-};
-
-/**
- * AVOption.
- */
-typedef struct AVOption {
-    const char *name;
-
-    /**
-     * short English text help.
-     * @todo what about other languages
-     */
-    const char *help;
-    int offset;             ///< offset to context structure where the parsed value should be stored
-    enum AVOptionType type;
-
-    double default_val;
-    double min;
-    double max;
-
-    int flags;
-#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM     8
-#define AV_OPT_FLAG_VIDEO_PARAM     16
-#define AV_OPT_FLAG_SUBTITLE_PARAM  32
-//FIXME think about enc-audio, ... style flags
-    const char *unit;
-} AVOption;
-
-
-const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
-const AVOption *av_set_string(void *obj, const char *name, const char *val);
-const AVOption *av_set_double(void *obj, const char *name, double n);
-const AVOption *av_set_q(void *obj, const char *name, AVRational n);
-const AVOption *av_set_int(void *obj, const char *name, int64_t n);
-double av_get_double(void *obj, const char *name, const AVOption **o_out);
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
-const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
-const AVOption *av_next_option(void *obj, const AVOption *last);
-int av_opt_show(void *obj, void *av_log_obj);
-void av_opt_set_defaults(void *s);
-void av_opt_set_defaults2(void *s, int mask, int flags);
-
-#endif
diff --git a/ffmpeg 0.5/include/ffmpeg/random.h b/ffmpeg 0.5/include/ffmpeg/random.h
deleted file mode 100644 (file)
index d9d08a5..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Mersenne Twister Random Algorithm
- * Copyright (c) 2006 Ryan Martell.
- * Based on A C-program for MT19937, with initialization improved 2002/1/26. Coded by
- * Takuji Nishimura and Makoto Matsumoto.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AV_RANDOM_H
-#define AV_RANDOM_H
-
-#define AV_RANDOM_N 624
-
-typedef struct {
-    unsigned int mt[AV_RANDOM_N]; ///< the array for the state vector
-    int index; ///< current untempered value we use as the base.
-} AVRandomState;
-
-
-void av_init_random(unsigned int seed, AVRandomState *state); ///< to be inlined, the struct must be visible, so it doesn't make sense to try and keep it opaque with malloc/free like calls
-void av_random_generate_untempered_numbers(AVRandomState *state); ///< Regenerate the untempered numbers (must be done every 624 iterations, or it will loop)
-
-/** generates a random number on [0,0xffffffff]-interval */
-static inline unsigned int av_random(AVRandomState *state)
-{
-    unsigned int y;
-
-    // regenerate the untempered numbers if we should...
-    if (state->index >= AV_RANDOM_N)
-        av_random_generate_untempered_numbers(state);
-
-    // grab one...
-    y = state->mt[state->index++];
-
-    /* Now temper (Mersenne Twister coefficients) The coefficients for MT19937 are.. */
-    y ^= (y >> 11);
-    y ^= (y << 7) & 0x9d2c5680;
-    y ^= (y << 15) & 0xefc60000;
-    y ^= (y >> 18);
-
-    return y;
-}
-
-/** return random in range [0-1] as double */
-static inline double av_random_real1(AVRandomState *state)
-{
-    /* divided by 2^32-1 */
-    return av_random(state) * (1.0 / 4294967296.0);
-}
-
-// only available if DEBUG is defined in the .c file
-void av_benchmark_random(void);
-#endif // AV_RANDOM_H
-
diff --git a/ffmpeg 0.5/include/ffmpeg/rational.h b/ffmpeg 0.5/include/ffmpeg/rational.h
deleted file mode 100644 (file)
index 8826772..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file rational.h
- * Rational numbers.
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef RATIONAL_H
-#define RATIONAL_H
-
-#include <stdint.h>
-
-/**
- * Rational number num/den.
- */
-typedef struct AVRational{
-    int num; ///< numerator
-    int den; ///< denominator
-} AVRational;
-
-/**
- * Compare two rationals.
- * @param a first rational
- * @param b second rational
- * @return 0 if a==b, 1 if a>b and -1 if a<b.
- */
-static inline int av_cmp_q(AVRational a, AVRational b){
-    const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
-
-    if(tmp) return (tmp>>63)|1;
-    else    return 0;
-}
-
-/**
- * Rational to double conversion.
- * @param a rational to convert
- * @return (double) a
- */
-static inline double av_q2d(AVRational a){
-    return a.num / (double) a.den;
-}
-
-/**
- * Reduce a fraction.
- * This is useful for framerate calculations.
- * @param dst_nom destination numerator
- * @param dst_den destination denominator
- * @param nom source numerator
- * @param den source denominator
- * @param max the maximum allowed for dst_nom & dst_den
- * @return 1 if exact, 0 otherwise
- */
-int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
-
-/**
- * Multiplies two rationals.
- * @param b first rational.
- * @param c second rational.
- * @return b*c.
- */
-AVRational av_mul_q(AVRational b, AVRational c);
-
-/**
- * Divides one rational by another.
- * @param b first rational.
- * @param c second rational.
- * @return b/c.
- */
-AVRational av_div_q(AVRational b, AVRational c);
-
-/**
- * Adds two rationals.
- * @param b first rational.
- * @param c second rational.
- * @return b+c.
- */
-AVRational av_add_q(AVRational b, AVRational c);
-
-/**
- * Subtracts one rational from another.
- * @param b first rational.
- * @param c second rational.
- * @return b-c.
- */
-AVRational av_sub_q(AVRational b, AVRational c);
-
-/**
- * Converts a double precision floating point number to a rational.
- * @param d double to convert
- * @param max the maximum allowed numerator and denominator
- * @return (AVRational) d.
- */
-AVRational av_d2q(double d, int max);
-
-#endif // RATIONAL_H
diff --git a/ffmpeg 0.5/include/ffmpeg/rgb2rgb.h b/ffmpeg 0.5/include/ffmpeg/rgb2rgb.h
deleted file mode 100644 (file)
index c6fab2d..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *  rgb2rgb.h, Software RGB to RGB convertor
- *  pluralize by Software PAL8 to RGB convertor
- *               Software YUV to YUV convertor
- *               Software YUV to RGB convertor
- *  Written by Nick Kurshev.
- *  palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef RGB2RGB_INCLUDED
-#define RGB2RGB_INCLUDED
-
-#include <inttypes.h>
-
-/* A full collection of rgb to rgb(bgr) convertors */
-extern void (*rgb24to32)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb24to16)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb24to15)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb32to24)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb32to16)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb32to15)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb15to16)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb15to24)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb15to32)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb16to15)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb16to24)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb16to32)   (const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
-extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
-
-extern void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
-extern void rgb8tobgr8  (const uint8_t *src, uint8_t *dst, long src_size);
-
-
-extern void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-extern void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-
-/**
- *
- * height should be a multiple of 2 and width should be a multiple of 16 (if this is a
- * problem for anyone then tell me, and ill fix it)
- * chrominance data is only taken from every secound line others are ignored FIXME write HQ version
- */
-//void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-
-/**
- *
- * height should be a multiple of 2 and width should be a multiple of 16 (if this is a
- * problem for anyone then tell me, and ill fix it)
- */
-extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                          long width, long height,
-                          long lumStride, long chromStride, long dstStride);
-
-/**
- *
- * width should be a multiple of 16
- */
-extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                             long width, long height,
-                             long lumStride, long chromStride, long dstStride);
-
-/**
- *
- * height should be a multiple of 2 and width should be a multiple of 16 (if this is a
- * problem for anyone then tell me, and ill fix it)
- */
-extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                          long width, long height,
-                          long lumStride, long chromStride, long srcStride);
-
-/**
- *
- * height should be a multiple of 2 and width should be a multiple of 16 (if this is a
- * problem for anyone then tell me, and ill fix it)
- */
-extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                          long width, long height,
-                          long lumStride, long chromStride, long dstStride);
-
-/**
- *
- * height should be a multiple of 2 and width should be a multiple of 2 (if this is a
- * problem for anyone then tell me, and ill fix it)
- * chrominance data is only taken from every secound line others are ignored FIXME write HQ version
- */
-extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                           long width, long height,
-                           long lumStride, long chromStride, long srcStride);
-extern void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
-                        long srcStride, long dstStride);
-
-extern void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst,
-                               long width, long height, long src1Stride,
-                               long src2Stride, long dstStride);
-
-extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
-                           uint8_t *dst1, uint8_t *dst2,
-                           long width, long height,
-                           long srcStride1, long srcStride2,
-                           long dstStride1, long dstStride2);
-
-extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
-                            uint8_t *dst,
-                            long width, long height,
-                            long srcStride1, long srcStride2,
-                            long srcStride3, long dstStride);
-
-void sws_rgb2rgb_init(int flags);
-
-#endif
diff --git a/ffmpeg 0.5/include/ffmpeg/rtp.h b/ffmpeg 0.5/include/ffmpeg/rtp.h
deleted file mode 100644 (file)
index bcdb769..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * RTP definitions
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef RTP_H
-#define RTP_H
-
-#include "avcodec.h"
-#include "avformat.h"
-
-#define RTP_MIN_PACKET_LENGTH 12
-#define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */
-
-int rtp_init(void);
-int rtp_get_codec_info(AVCodecContext *codec, int payload_type);
-
-/** return < 0 if unknown payload type */
-int rtp_get_payload_type(AVCodecContext *codec);
-
-typedef struct RTPDemuxContext RTPDemuxContext;
-typedef struct rtp_payload_data_s rtp_payload_data_s;
-RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_s *rtp_payload_data);
-int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
-                     const uint8_t *buf, int len);
-void rtp_parse_close(RTPDemuxContext *s);
-
-int rtp_get_local_port(URLContext *h);
-int rtp_set_remote_url(URLContext *h, const char *uri);
-void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd);
-
-/**
- * some rtp servers assume client is dead if they don't hear from them...
- * so we send a Receiver Report to the provided ByteIO context
- * (we don't have access to the rtcp handle from here)
- */
-int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count);
-
-#define RTP_PT_PRIVATE 96
-#define RTP_VERSION 2
-#define RTP_MAX_SDES 256   /**< maximum text length for SDES */
-
-/* RTCP paquets use 0.5 % of the bandwidth */
-#define RTCP_TX_RATIO_NUM 5
-#define RTCP_TX_RATIO_DEN 1000
-
-/** Structure listing useful vars to parse RTP packet payload*/
-typedef struct rtp_payload_data_s
-{
-    int sizelength;
-    int indexlength;
-    int indexdeltalength;
-    int profile_level_id;
-    int streamtype;
-    int objecttype;
-    char *mode;
-
-    /** mpeg 4 AU headers */
-    struct AUHeaders {
-        int size;
-        int index;
-        int cts_flag;
-        int cts;
-        int dts_flag;
-        int dts;
-        int rap_flag;
-        int streamstate;
-    } *au_headers;
-    int nb_au_headers;
-    int au_headers_length_bytes;
-    int cur_au_index;
-} rtp_payload_data_t;
-
-typedef struct AVRtpPayloadType_s
-{
-    int pt;
-    const char enc_name[50]; /* XXX: why 50 ? */
-    enum CodecType codec_type;
-    enum CodecID codec_id;
-    int clock_rate;
-    int audio_channels;
-} AVRtpPayloadType_t;
-
-#if 0
-typedef enum {
-  RTCP_SR   = 200,
-  RTCP_RR   = 201,
-  RTCP_SDES = 202,
-  RTCP_BYE  = 203,
-  RTCP_APP  = 204
-} rtcp_type_t;
-
-typedef enum {
-  RTCP_SDES_END    =  0,
-  RTCP_SDES_CNAME  =  1,
-  RTCP_SDES_NAME   =  2,
-  RTCP_SDES_EMAIL  =  3,
-  RTCP_SDES_PHONE  =  4,
-  RTCP_SDES_LOC    =  5,
-  RTCP_SDES_TOOL   =  6,
-  RTCP_SDES_NOTE   =  7,
-  RTCP_SDES_PRIV   =  8,
-  RTCP_SDES_IMG    =  9,
-  RTCP_SDES_DOOR   = 10,
-  RTCP_SDES_SOURCE = 11
-} rtcp_sdes_type_t;
-#endif
-
-extern AVRtpPayloadType_t AVRtpPayloadTypes[];
-#endif /* RTP_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/rtsp.h b/ffmpeg 0.5/include/ffmpeg/rtsp.h
deleted file mode 100644 (file)
index a41032d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * RTSP definitions
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef RTSP_H
-#define RTSP_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "rtspcodes.h"
-
-enum RTSPProtocol {
-    RTSP_PROTOCOL_RTP_UDP = 0,
-    RTSP_PROTOCOL_RTP_TCP = 1,
-    RTSP_PROTOCOL_RTP_UDP_MULTICAST = 2,
-};
-
-#define RTSP_DEFAULT_PORT   554
-#define RTSP_MAX_TRANSPORTS 8
-#define RTSP_TCP_MAX_PACKET_SIZE 1472
-#define RTSP_DEFAULT_NB_AUDIO_CHANNELS 2
-#define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
-#define RTSP_RTP_PORT_MIN 5000
-#define RTSP_RTP_PORT_MAX 10000
-
-typedef struct RTSPTransportField {
-    int interleaved_min, interleaved_max;  /**< interleave ids, if TCP transport */
-    int port_min, port_max; /**< RTP ports */
-    int client_port_min, client_port_max; /**< RTP ports */
-    int server_port_min, server_port_max; /**< RTP ports */
-    int ttl; /**< ttl value */
-    uint32_t destination; /**< destination IP address */
-    enum RTSPProtocol protocol;
-} RTSPTransportField;
-
-typedef struct RTSPHeader {
-    int content_length;
-    enum RTSPStatusCode status_code; /**< response code from server */
-    int nb_transports;
-    /** in AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
-    int64_t range_start, range_end;
-    RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
-    int seq; /**< sequence number */
-    char session_id[512];
-} RTSPHeader;
-
-/** the callback can be used to extend the connection setup/teardown step */
-enum RTSPCallbackAction {
-    RTSP_ACTION_SERVER_SETUP,
-    RTSP_ACTION_SERVER_TEARDOWN,
-    RTSP_ACTION_CLIENT_SETUP,
-    RTSP_ACTION_CLIENT_TEARDOWN,
-};
-
-typedef struct RTSPActionServerSetup {
-    uint32_t ipaddr;
-    char transport_option[512];
-} RTSPActionServerSetup;
-
-typedef int FFRTSPCallback(enum RTSPCallbackAction action,
-                           const char *session_id,
-                           char *buf, int buf_size,
-                           void *arg);
-
-int rtsp_init(void);
-void rtsp_parse_line(RTSPHeader *reply, const char *buf);
-
-extern int rtsp_default_protocols;
-extern int rtsp_rtp_port_min;
-extern int rtsp_rtp_port_max;
-
-int rtsp_pause(AVFormatContext *s);
-int rtsp_resume(AVFormatContext *s);
-
-#endif /* RTSP_H */
diff --git a/ffmpeg 0.5/include/ffmpeg/rtspcodes.h b/ffmpeg 0.5/include/ffmpeg/rtspcodes.h
deleted file mode 100644 (file)
index 9e4d87b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * RTSP definitions
- * copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTSPCODES_H
-#define AVFORMAT_RTSPCODES_H
-
-/** RTSP handling */
-enum RTSPStatusCode {
-RTSP_STATUS_OK              =200, /**< OK */
-RTSP_STATUS_METHOD          =405, /**< Method Not Allowed */
-RTSP_STATUS_BANDWIDTH       =453, /**< Not Enough Bandwidth */
-RTSP_STATUS_SESSION         =454, /**< Session Not Found */
-RTSP_STATUS_STATE           =455, /**< Method Not Valid in This State */
-RTSP_STATUS_AGGREGATE       =459, /**< Aggregate operation not allowed */
-RTSP_STATUS_ONLY_AGGREGATE  =460, /**< Only aggregate operation allowed */
-RTSP_STATUS_TRANSPORT       =461, /**< Unsupported transport */
-RTSP_STATUS_INTERNAL        =500, /**< Internal Server Error */
-RTSP_STATUS_SERVICE         =503, /**< Service Unavailable */
-RTSP_STATUS_VERSION         =505, /**< RTSP Version not supported */
-};
-
-#endif // AVFORMAT_RTSPCODES_H
diff --git a/ffmpeg 0.5/include/ffmpeg/swscale.h b/ffmpeg 0.5/include/ffmpeg/swscale.h
deleted file mode 100644 (file)
index 75e66ed..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_H
-#define SWSCALE_H
-
-/**
- * @file swscale.h
- * @brief
- *     external api for the swscale stuff
- */
-
-#include "avutil.h"
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define LIBSWSCALE_VERSION_INT  ((0<<16)+(5<<8)+0)
-#define LIBSWSCALE_VERSION      0.5.0
-#define LIBSWSCALE_BUILD        LIBSWSCALE_VERSION_INT
-
-#define LIBSWSCALE_IDENT        "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
-
-/* values for the flags, the stuff on the command line is different */
-#define SWS_FAST_BILINEAR     1
-#define SWS_BILINEAR          2
-#define SWS_BICUBIC           4
-#define SWS_X                 8
-#define SWS_POINT          0x10
-#define SWS_AREA           0x20
-#define SWS_BICUBLIN       0x40
-#define SWS_GAUSS          0x80
-#define SWS_SINC          0x100
-#define SWS_LANCZOS       0x200
-#define SWS_SPLINE        0x400
-
-#define SWS_SRC_V_CHR_DROP_MASK     0x30000
-#define SWS_SRC_V_CHR_DROP_SHIFT    16
-
-#define SWS_PARAM_DEFAULT           123456
-
-#define SWS_PRINT_INFO              0x1000
-
-//the following 3 flags are not completely implemented
-//internal chrominace subsampling info
-#define SWS_FULL_CHR_H_INT    0x2000
-//input subsampling info
-#define SWS_FULL_CHR_H_INP    0x4000
-#define SWS_DIRECT_BGR        0x8000
-#define SWS_ACCURATE_RND      0x40000
-
-#define SWS_CPU_CAPS_MMX      0x80000000
-#define SWS_CPU_CAPS_MMX2     0x20000000
-#define SWS_CPU_CAPS_3DNOW    0x40000000
-#define SWS_CPU_CAPS_ALTIVEC  0x10000000
-#define SWS_CPU_CAPS_BFIN     0x01000000
-
-#define SWS_MAX_REDUCE_CUTOFF 0.002
-
-#define SWS_CS_ITU709         1
-#define SWS_CS_FCC            4
-#define SWS_CS_ITU601         5
-#define SWS_CS_ITU624         5
-#define SWS_CS_SMPTE170M      5
-#define SWS_CS_SMPTE240M      7
-#define SWS_CS_DEFAULT        5
-
-
-
-// when used for filters they must have an odd number of elements
-// coeffs cannot be shared between vectors
-typedef struct {
-    double *coeff;
-    int length;
-} SwsVector;
-
-// vectors can be shared
-typedef struct {
-    SwsVector *lumH;
-    SwsVector *lumV;
-    SwsVector *chrH;
-    SwsVector *chrV;
-} SwsFilter;
-
-struct SwsContext;
-
-void sws_freeContext(struct SwsContext *swsContext);
-
-struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
-                                  SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
-int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
-              int srcSliceH, uint8_t* dst[], int dstStride[]);
-int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
-                      int srcSliceH, uint8_t* dst[], int dstStride[]) attribute_deprecated;
-
-
-int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
-int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
-SwsVector *sws_getGaussianVec(double variance, double quality);
-SwsVector *sws_getConstVec(double c, int length);
-SwsVector *sws_getIdentityVec(void);
-void sws_scaleVec(SwsVector *a, double scalar);
-void sws_normalizeVec(SwsVector *a, double height);
-void sws_convVec(SwsVector *a, SwsVector *b);
-void sws_addVec(SwsVector *a, SwsVector *b);
-void sws_subVec(SwsVector *a, SwsVector *b);
-void sws_shiftVec(SwsVector *a, int shift);
-SwsVector *sws_cloneVec(SwsVector *a);
-
-void sws_printVec(SwsVector *a);
-void sws_freeVec(SwsVector *a);
-
-SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
-                                float lumaSarpen, float chromaSharpen,
-                                float chromaHShift, float chromaVShift,
-                                int verbose);
-void sws_freeFilter(SwsFilter *filter);
-
-struct SwsContext *sws_getCachedContext(struct SwsContext *context,
-                                        int srcW, int srcH, int srcFormat,
-                                        int dstW, int dstH, int dstFormat, int flags,
-                                        SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
-
-#endif
diff --git a/ffmpeg 0.5/include/inttypes.h b/ffmpeg 0.5/include/inttypes.h
deleted file mode 100644 (file)
index 41c3347..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-// ISO C9x  compliant inttypes.h for Microsoft Visual Studio\r
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \r
-// \r
-//  Copyright (c) 2006 Alexander Chemeris\r
-// \r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are met:\r
-// \r
-//   1. Redistributions of source code must retain the above copyright notice,\r
-//      this list of conditions and the following disclaimer.\r
-// \r
-//   2. Redistributions in binary form must reproduce the above copyright\r
-//      notice, this list of conditions and the following disclaimer in the\r
-//      documentation and/or other materials provided with the distribution.\r
-// \r
-//   3. The name of the author may be used to endorse or promote products\r
-//      derived from this software without specific prior written permission.\r
-// \r
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-// \r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifndef _MSC_VER // [\r
-#error "Use this header only with Microsoft Visual C++ compilers!"\r
-#endif // _MSC_VER ]\r
-\r
-#ifndef _MSC_INTTYPES_H_ // [\r
-#define _MSC_INTTYPES_H_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif\r
-\r
-#include <stdint.h>\r
-\r
-// 7.8 Format conversion of integer types\r
-\r
-typedef struct {\r
-   intmax_t quot;\r
-   intmax_t rem;\r
-} imaxdiv_t;\r
-\r
-// 7.8.1 Macros for format specifiers\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [   See footnote 185 at page 198\r
-\r
-// The fprintf macros for signed integers are:\r
-#define PRId8       "d"\r
-#define PRIi8       "i"\r
-#define PRIdLEAST8  "d"\r
-#define PRIiLEAST8  "i"\r
-#define PRIdFAST8   "d"\r
-#define PRIiFAST8   "i"\r
-\r
-#define PRId16       "hd"\r
-#define PRIi16       "hi"\r
-#define PRIdLEAST16  "hd"\r
-#define PRIiLEAST16  "hi"\r
-#define PRIdFAST16   "hd"\r
-#define PRIiFAST16   "hi"\r
-\r
-#define PRId32       "I32d"\r
-#define PRIi32       "I32i"\r
-#define PRIdLEAST32  "I32d"\r
-#define PRIiLEAST32  "I32i"\r
-#define PRIdFAST32   "I32d"\r
-#define PRIiFAST32   "I32i"\r
-\r
-#define PRId64       "I64d"\r
-#define PRIi64       "I64i"\r
-#define PRIdLEAST64  "I64d"\r
-#define PRIiLEAST64  "I64i"\r
-#define PRIdFAST64   "I64d"\r
-#define PRIiFAST64   "I64i"\r
-\r
-#define PRIdMAX     "I64d"\r
-#define PRIiMAX     "I64i"\r
-\r
-#define PRIdPTR     "Id"\r
-#define PRIiPTR     "Ii"\r
-\r
-// The fprintf macros for unsigned integers are:\r
-#define PRIo8       "o"\r
-#define PRIu8       "u"\r
-#define PRIx8       "x"\r
-#define PRIX8       "X"\r
-#define PRIoLEAST8  "o"\r
-#define PRIuLEAST8  "u"\r
-#define PRIxLEAST8  "x"\r
-#define PRIXLEAST8  "X"\r
-#define PRIoFAST8   "o"\r
-#define PRIuFAST8   "u"\r
-#define PRIxFAST8   "x"\r
-#define PRIXFAST8   "X"\r
-\r
-#define PRIo16       "ho"\r
-#define PRIu16       "hu"\r
-#define PRIx16       "hx"\r
-#define PRIX16       "hX"\r
-#define PRIoLEAST16  "ho"\r
-#define PRIuLEAST16  "hu"\r
-#define PRIxLEAST16  "hx"\r
-#define PRIXLEAST16  "hX"\r
-#define PRIoFAST16   "ho"\r
-#define PRIuFAST16   "hu"\r
-#define PRIxFAST16   "hx"\r
-#define PRIXFAST16   "hX"\r
-\r
-#define PRIo32       "I32o"\r
-#define PRIu32       "I32u"\r
-#define PRIx32       "I32x"\r
-#define PRIX32       "I32X"\r
-#define PRIoLEAST32  "I32o"\r
-#define PRIuLEAST32  "I32u"\r
-#define PRIxLEAST32  "I32x"\r
-#define PRIXLEAST32  "I32X"\r
-#define PRIoFAST32   "I32o"\r
-#define PRIuFAST32   "I32u"\r
-#define PRIxFAST32   "I32x"\r
-#define PRIXFAST32   "I32X"\r
-\r
-#define PRIo64       "I64o"\r
-#define PRIu64       "I64u"\r
-#define PRIx64       "I64x"\r
-#define PRIX64       "I64X"\r
-#define PRIoLEAST64  "I64o"\r
-#define PRIuLEAST64  "I64u"\r
-#define PRIxLEAST64  "I64x"\r
-#define PRIXLEAST64  "I64X"\r
-#define PRIoFAST64   "I64o"\r
-#define PRIuFAST64   "I64u"\r
-#define PRIxFAST64   "I64x"\r
-#define PRIXFAST64   "I64X"\r
-\r
-#define PRIoMAX     "I64o"\r
-#define PRIuMAX     "I64u"\r
-#define PRIxMAX     "I64x"\r
-#define PRIXMAX     "I64X"\r
-\r
-#define PRIoPTR     "Io"\r
-#define PRIuPTR     "Iu"\r
-#define PRIxPTR     "Ix"\r
-#define PRIXPTR     "IX"\r
-\r
-// The fscanf macros for signed integers are:\r
-#define SCNd8       "d"\r
-#define SCNi8       "i"\r
-#define SCNdLEAST8  "d"\r
-#define SCNiLEAST8  "i"\r
-#define SCNdFAST8   "d"\r
-#define SCNiFAST8   "i"\r
-\r
-#define SCNd16       "hd"\r
-#define SCNi16       "hi"\r
-#define SCNdLEAST16  "hd"\r
-#define SCNiLEAST16  "hi"\r
-#define SCNdFAST16   "hd"\r
-#define SCNiFAST16   "hi"\r
-\r
-#define SCNd32       "ld"\r
-#define SCNi32       "li"\r
-#define SCNdLEAST32  "ld"\r
-#define SCNiLEAST32  "li"\r
-#define SCNdFAST32   "ld"\r
-#define SCNiFAST32   "li"\r
-\r
-#define SCNd64       "I64d"\r
-#define SCNi64       "I64i"\r
-#define SCNdLEAST64  "I64d"\r
-#define SCNiLEAST64  "I64i"\r
-#define SCNdFAST64   "I64d"\r
-#define SCNiFAST64   "I64i"\r
-\r
-#define SCNdMAX     "I64d"\r
-#define SCNiMAX     "I64i"\r
-\r
-#ifdef _WIN64 // [\r
-#  define SCNdPTR     "I64d"\r
-#  define SCNiPTR     "I64i"\r
-#else  // _WIN64 ][\r
-#  define SCNdPTR     "ld"\r
-#  define SCNiPTR     "li"\r
-#endif  // _WIN64 ]\r
-\r
-// The fscanf macros for unsigned integers are:\r
-#define SCNo8       "o"\r
-#define SCNu8       "u"\r
-#define SCNx8       "x"\r
-#define SCNX8       "X"\r
-#define SCNoLEAST8  "o"\r
-#define SCNuLEAST8  "u"\r
-#define SCNxLEAST8  "x"\r
-#define SCNXLEAST8  "X"\r
-#define SCNoFAST8   "o"\r
-#define SCNuFAST8   "u"\r
-#define SCNxFAST8   "x"\r
-#define SCNXFAST8   "X"\r
-\r
-#define SCNo16       "ho"\r
-#define SCNu16       "hu"\r
-#define SCNx16       "hx"\r
-#define SCNX16       "hX"\r
-#define SCNoLEAST16  "ho"\r
-#define SCNuLEAST16  "hu"\r
-#define SCNxLEAST16  "hx"\r
-#define SCNXLEAST16  "hX"\r
-#define SCNoFAST16   "ho"\r
-#define SCNuFAST16   "hu"\r
-#define SCNxFAST16   "hx"\r
-#define SCNXFAST16   "hX"\r
-\r
-#define SCNo32       "lo"\r
-#define SCNu32       "lu"\r
-#define SCNx32       "lx"\r
-#define SCNX32       "lX"\r
-#define SCNoLEAST32  "lo"\r
-#define SCNuLEAST32  "lu"\r
-#define SCNxLEAST32  "lx"\r
-#define SCNXLEAST32  "lX"\r
-#define SCNoFAST32   "lo"\r
-#define SCNuFAST32   "lu"\r
-#define SCNxFAST32   "lx"\r
-#define SCNXFAST32   "lX"\r
-\r
-#define SCNo64       "I64o"\r
-#define SCNu64       "I64u"\r
-#define SCNx64       "I64x"\r
-#define SCNX64       "I64X"\r
-#define SCNoLEAST64  "I64o"\r
-#define SCNuLEAST64  "I64u"\r
-#define SCNxLEAST64  "I64x"\r
-#define SCNXLEAST64  "I64X"\r
-#define SCNoFAST64   "I64o"\r
-#define SCNuFAST64   "I64u"\r
-#define SCNxFAST64   "I64x"\r
-#define SCNXFAST64   "I64X"\r
-\r
-#define SCNoMAX     "I64o"\r
-#define SCNuMAX     "I64u"\r
-#define SCNxMAX     "I64x"\r
-#define SCNXMAX     "I64X"\r
-\r
-#ifdef _WIN64 // [\r
-#  define SCNoPTR     "I64o"\r
-#  define SCNuPTR     "I64u"\r
-#  define SCNxPTR     "I64x"\r
-#  define SCNXPTR     "I64X"\r
-#else  // _WIN64 ][\r
-#  define SCNoPTR     "lo"\r
-#  define SCNuPTR     "lu"\r
-#  define SCNxPTR     "lx"\r
-#  define SCNXPTR     "lX"\r
-#endif  // _WIN64 ]\r
-\r
-#endif // __STDC_FORMAT_MACROS ]\r
-\r
-// 7.8.2 Functions for greatest-width integer types\r
-\r
-// 7.8.2.1 The imaxabs function\r
-#define imaxabs _abs64\r
-\r
-// 7.8.2.2 The imaxdiv function\r
-\r
-// This is modified version of div() function from Microsoft's div.c found\r
-// in %MSVC.NET%\crt\src\div.c\r
-#ifdef STATIC_IMAXDIV // [\r
-static\r
-#else // STATIC_IMAXDIV ][\r
-_inline\r
-#endif // STATIC_IMAXDIV ]\r
-imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)\r
-{\r
-   imaxdiv_t result;\r
-\r
-   result.quot = numer / denom;\r
-   result.rem = numer % denom;\r
-\r
-   if (numer < 0 && result.rem > 0) {\r
-      // did division wrong; must fix up\r
-      ++result.quot;\r
-      result.rem -= denom;\r
-   }\r
-\r
-   return result;\r
-}\r
-\r
-// 7.8.2.3 The strtoimax and strtoumax functions\r
-#define strtoimax _strtoi64\r
-#define strtoumax _strtoui64\r
-\r
-// 7.8.2.4 The wcstoimax and wcstoumax functions\r
-#define wcstoimax _wcstoi64\r
-#define wcstoumax _wcstoui64\r
-\r
-\r
-#endif // _MSC_INTTYPES_H_ ]\r
diff --git a/ffmpeg 0.5/include/stdint.h b/ffmpeg 0.5/include/stdint.h
deleted file mode 100644 (file)
index 25a5839..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-// ISO C9x  compliant stdint.h for Microsoft Visual Studio\r
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \r
-// \r
-//  Copyright (c) 2006-2008 Alexander Chemeris\r
-// \r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are met:\r
-// \r
-//   1. Redistributions of source code must retain the above copyright notice,\r
-//      this list of conditions and the following disclaimer.\r
-// \r
-//   2. Redistributions in binary form must reproduce the above copyright\r
-//      notice, this list of conditions and the following disclaimer in the\r
-//      documentation and/or other materials provided with the distribution.\r
-// \r
-//   3. The name of the author may be used to endorse or promote products\r
-//      derived from this software without specific prior written permission.\r
-// \r
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-// \r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifndef _MSC_VER // [\r
-#error "Use this header only with Microsoft Visual C++ compilers!"\r
-#endif // _MSC_VER ]\r
-\r
-#ifndef _MSC_STDINT_H_ // [\r
-#define _MSC_STDINT_H_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif\r
-\r
-#include <limits.h>\r
-\r
-// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'\r
-// or compiler give many errors like this:\r
-//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed\r
-#if (_MSC_VER < 1300) && defined(__cplusplus)\r
-   extern "C++" {\r
-#endif \r
-#     include <wchar.h>\r
-#if (_MSC_VER < 1300) && defined(__cplusplus)\r
-   }\r
-#endif\r
-\r
-// Define _W64 macros to mark types changing their size, like intptr_t.\r
-#ifndef _W64\r
-#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300\r
-#     define _W64 __w64\r
-#  else\r
-#     define _W64\r
-#  endif\r
-#endif\r
-\r
-\r
-// 7.18.1 Integer types\r
-\r
-// 7.18.1.1 Exact-width integer types\r
-typedef __int8            int8_t;\r
-typedef __int16           int16_t;\r
-typedef __int32           int32_t;\r
-typedef __int64           int64_t;\r
-typedef unsigned __int8   uint8_t;\r
-typedef unsigned __int16  uint16_t;\r
-typedef unsigned __int32  uint32_t;\r
-typedef unsigned __int64  uint64_t;\r
-\r
-// 7.18.1.2 Minimum-width integer types\r
-typedef int8_t    int_least8_t;\r
-typedef int16_t   int_least16_t;\r
-typedef int32_t   int_least32_t;\r
-typedef int64_t   int_least64_t;\r
-typedef uint8_t   uint_least8_t;\r
-typedef uint16_t  uint_least16_t;\r
-typedef uint32_t  uint_least32_t;\r
-typedef uint64_t  uint_least64_t;\r
-\r
-// 7.18.1.3 Fastest minimum-width integer types\r
-typedef int8_t    int_fast8_t;\r
-typedef int16_t   int_fast16_t;\r
-typedef int32_t   int_fast32_t;\r
-typedef int64_t   int_fast64_t;\r
-typedef uint8_t   uint_fast8_t;\r
-typedef uint16_t  uint_fast16_t;\r
-typedef uint32_t  uint_fast32_t;\r
-typedef uint64_t  uint_fast64_t;\r
-\r
-// 7.18.1.4 Integer types capable of holding object pointers\r
-#ifdef _WIN64 // [\r
-   typedef __int64           intptr_t;\r
-   typedef unsigned __int64  uintptr_t;\r
-#else // _WIN64 ][\r
-   typedef _W64 int               intptr_t;\r
-   typedef _W64 unsigned int      uintptr_t;\r
-#endif // _WIN64 ]\r
-\r
-// 7.18.1.5 Greatest-width integer types\r
-typedef int64_t   intmax_t;\r
-typedef uint64_t  uintmax_t;\r
-\r
-\r
-// 7.18.2 Limits of specified-width integer types\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259\r
-\r
-// 7.18.2.1 Limits of exact-width integer types\r
-#define INT8_MIN     ((int8_t)_I8_MIN)\r
-#define INT8_MAX     _I8_MAX\r
-#define INT16_MIN    ((int16_t)_I16_MIN)\r
-#define INT16_MAX    _I16_MAX\r
-#define INT32_MIN    ((int32_t)_I32_MIN)\r
-#define INT32_MAX    _I32_MAX\r
-#define INT64_MIN    ((int64_t)_I64_MIN)\r
-#define INT64_MAX    _I64_MAX\r
-#define UINT8_MAX    _UI8_MAX\r
-#define UINT16_MAX   _UI16_MAX\r
-#define UINT32_MAX   _UI32_MAX\r
-#define UINT64_MAX   _UI64_MAX\r
-\r
-// 7.18.2.2 Limits of minimum-width integer types\r
-#define INT_LEAST8_MIN    INT8_MIN\r
-#define INT_LEAST8_MAX    INT8_MAX\r
-#define INT_LEAST16_MIN   INT16_MIN\r
-#define INT_LEAST16_MAX   INT16_MAX\r
-#define INT_LEAST32_MIN   INT32_MIN\r
-#define INT_LEAST32_MAX   INT32_MAX\r
-#define INT_LEAST64_MIN   INT64_MIN\r
-#define INT_LEAST64_MAX   INT64_MAX\r
-#define UINT_LEAST8_MAX   UINT8_MAX\r
-#define UINT_LEAST16_MAX  UINT16_MAX\r
-#define UINT_LEAST32_MAX  UINT32_MAX\r
-#define UINT_LEAST64_MAX  UINT64_MAX\r
-\r
-// 7.18.2.3 Limits of fastest minimum-width integer types\r
-#define INT_FAST8_MIN    INT8_MIN\r
-#define INT_FAST8_MAX    INT8_MAX\r
-#define INT_FAST16_MIN   INT16_MIN\r
-#define INT_FAST16_MAX   INT16_MAX\r
-#define INT_FAST32_MIN   INT32_MIN\r
-#define INT_FAST32_MAX   INT32_MAX\r
-#define INT_FAST64_MIN   INT64_MIN\r
-#define INT_FAST64_MAX   INT64_MAX\r
-#define UINT_FAST8_MAX   UINT8_MAX\r
-#define UINT_FAST16_MAX  UINT16_MAX\r
-#define UINT_FAST32_MAX  UINT32_MAX\r
-#define UINT_FAST64_MAX  UINT64_MAX\r
-\r
-// 7.18.2.4 Limits of integer types capable of holding object pointers\r
-#ifdef _WIN64 // [\r
-#  define INTPTR_MIN   INT64_MIN\r
-#  define INTPTR_MAX   INT64_MAX\r
-#  define UINTPTR_MAX  UINT64_MAX\r
-#else // _WIN64 ][\r
-#  define INTPTR_MIN   INT32_MIN\r
-#  define INTPTR_MAX   INT32_MAX\r
-#  define UINTPTR_MAX  UINT32_MAX\r
-#endif // _WIN64 ]\r
-\r
-// 7.18.2.5 Limits of greatest-width integer types\r
-#define INTMAX_MIN   INT64_MIN\r
-#define INTMAX_MAX   INT64_MAX\r
-#define UINTMAX_MAX  UINT64_MAX\r
-\r
-// 7.18.3 Limits of other integer types\r
-\r
-#ifdef _WIN64 // [\r
-#  define PTRDIFF_MIN  _I64_MIN\r
-#  define PTRDIFF_MAX  _I64_MAX\r
-#else  // _WIN64 ][\r
-#  define PTRDIFF_MIN  _I32_MIN\r
-#  define PTRDIFF_MAX  _I32_MAX\r
-#endif  // _WIN64 ]\r
-\r
-#define SIG_ATOMIC_MIN  INT_MIN\r
-#define SIG_ATOMIC_MAX  INT_MAX\r
-\r
-#ifndef SIZE_MAX // [\r
-#  ifdef _WIN64 // [\r
-#     define SIZE_MAX  _UI64_MAX\r
-#  else // _WIN64 ][\r
-#     define SIZE_MAX  _UI32_MAX\r
-#  endif // _WIN64 ]\r
-#endif // SIZE_MAX ]\r
-\r
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>\r
-#ifndef WCHAR_MIN // [\r
-#  define WCHAR_MIN  0\r
-#endif  // WCHAR_MIN ]\r
-#ifndef WCHAR_MAX // [\r
-#  define WCHAR_MAX  _UI16_MAX\r
-#endif  // WCHAR_MAX ]\r
-\r
-#define WINT_MIN  0\r
-#define WINT_MAX  _UI16_MAX\r
-\r
-#endif // __STDC_LIMIT_MACROS ]\r
-\r
-\r
-// 7.18.4 Limits of other integer types\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260\r
-\r
-// 7.18.4.1 Macros for minimum-width integer constants\r
-\r
-#define INT8_C(val)  val##i8\r
-#define INT16_C(val) val##i16\r
-#define INT32_C(val) val##i32\r
-#define INT64_C(val) val##i64\r
-\r
-#define UINT8_C(val)  val##ui8\r
-#define UINT16_C(val) val##ui16\r
-#define UINT32_C(val) val##ui32\r
-#define UINT64_C(val) val##ui64\r
-\r
-// 7.18.4.2 Macros for greatest-width integer constants\r
-#define INTMAX_C   INT64_C\r
-#define UINTMAX_C  UINT64_C\r
-\r
-#endif // __STDC_CONSTANT_MACROS ]\r
-\r
-\r
-#endif // _MSC_STDINT_H_ ]\r
diff --git a/ffmpeg 0.5/lib/avcodec-51.dll b/ffmpeg 0.5/lib/avcodec-51.dll
deleted file mode 100644 (file)
index 198be27..0000000
Binary files a/ffmpeg 0.5/lib/avcodec-51.dll and /dev/null differ
diff --git a/ffmpeg 0.5/lib/avcodec-51.lib b/ffmpeg 0.5/lib/avcodec-51.lib
deleted file mode 100644 (file)
index 95bc6c5..0000000
Binary files a/ffmpeg 0.5/lib/avcodec-51.lib and /dev/null differ
diff --git a/ffmpeg 0.5/lib/avformat-51.dll b/ffmpeg 0.5/lib/avformat-51.dll
deleted file mode 100644 (file)
index 7144479..0000000
Binary files a/ffmpeg 0.5/lib/avformat-51.dll and /dev/null differ
diff --git a/ffmpeg 0.5/lib/avformat-51.lib b/ffmpeg 0.5/lib/avformat-51.lib
deleted file mode 100644 (file)
index 8033684..0000000
Binary files a/ffmpeg 0.5/lib/avformat-51.lib and /dev/null differ
diff --git a/ffmpeg 0.5/lib/avutil-49.dll b/ffmpeg 0.5/lib/avutil-49.dll
deleted file mode 100644 (file)
index 18a8512..0000000
Binary files a/ffmpeg 0.5/lib/avutil-49.dll and /dev/null differ
diff --git a/ffmpeg 0.5/lib/avutil-49.lib b/ffmpeg 0.5/lib/avutil-49.lib
deleted file mode 100644 (file)
index 128acfc..0000000
Binary files a/ffmpeg 0.5/lib/avutil-49.lib and /dev/null differ
diff --git a/ffmpeg 0.6/complete_config b/ffmpeg 0.6/complete_config
deleted file mode 100644 (file)
index 8a3a2b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-./configure --disable-static --enable-shared --enable-gpl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-postproc --enable-runtime-cpudetect --enable-hardcoded-tables --enable-memalign-hack --cross-prefix=i686-mingw32- --enable-cross-compile --target-os=mingw32 --cpu=686 --arch=x86
diff --git a/ffmpeg 0.6/include/changelog.txt b/ffmpeg 0.6/include/changelog.txt
deleted file mode 100644 (file)
index cf0539c..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-------------------------------------------------------------------------\r
-r26 | 2009-10-02 13:36:47 +0400 | 2 lines\r
-\r
-[Issue 5] Change <stdint.h> to "stdint.h" to let compiler search for it in local directory.\r
-\r
-------------------------------------------------------------------------\r
-r25 | 2009-09-17 23:46:49 +0400 | 2 lines\r
-\r
-[Issue 4] Fix incorrect int8_t behaviour if compiled with /J flag.\r
-\r
-------------------------------------------------------------------------\r
-r24 | 2009-05-13 14:53:48 +0400 | 2 lines\r
-\r
-Forgot about #ifdef __cplusplus guard around 'extern "C"', so inclusion to C files has been broken.\r
-\r
-------------------------------------------------------------------------\r
-r23 | 2009-05-12 01:27:45 +0400 | 3 lines\r
-\r
-[Issue 2] Always wrap <wcharîà\9e with external "C" {}.\r
-It turns out that not only Visual Studio 6 requires this, but also newer versions when compiling for ARM.\r
-\r
-------------------------------------------------------------------------\r
-r22 | 2009-05-11 22:22:15 +0400 | 3 lines\r
-\r
-[Issue 3] Visual Studio 6 and Embedded Visual C++ 4 doesn't realize that, e.g. char has the same size as __int8 so we give up on __intX for them.\r
-his should close Issue 3 in issue tracker.\r
-\r
-------------------------------------------------------------------------\r
-r21 | 2008-07-17 09:47:22 +0400 | 4 lines\r
-\r
-Get rid of these compiler warnings when compiling for 32-bit:\r
-  warning C4311: 'type cast' : pointer truncation from 'void *' to 'uintptr_t'\r
-  warning C4312: 'type cast' : conversion from 'uintptr_t' to 'const void *' of greater size\r
-\r
-------------------------------------------------------------------------\r
-r20 | 2007-10-09 16:54:27 +0400 | 2 lines\r
-\r
-Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.\r
-\r
-------------------------------------------------------------------------\r
-r19 | 2007-07-04 02:14:40 +0400 | 3 lines\r
-\r
-Explicitly cast to appropriate type INT8_MIN, INT16_MIN, INT32_MIN and INT64_MIN constants.\r
-Due to their unusual definition in Visual Studio headers (-_Ix_MAX-1) they are propagated to int and thus do not have expected type, causing VS6 strict compiler to claim about type inconsistency.\r
-\r
-------------------------------------------------------------------------\r
-r18 | 2007-06-26 16:53:23 +0400 | 2 lines\r
-\r
-Better handling of (U)INTx_C macros - now they generate constants of exact width.\r
-\r
-------------------------------------------------------------------------\r
-r17 | 2007-03-29 20:16:14 +0400 | 2 lines\r
-\r
-Fix typo: Miscrosoft -> Microsoft.\r
-\r
-------------------------------------------------------------------------\r
-r16 | 2007-02-24 17:32:58 +0300 | 4 lines\r
-\r
-Remove <BaseTsd.h> include, as it is not present in Visual Studio 2005 Epxress Edition and required only for INT_PTR and UINT_PTR types.\r
-\r
-'intptr_t' and 'uintptr_t' types now defined explicitly with #ifdef _WIN64.\r
-\r
-------------------------------------------------------------------------\r
-r15 | 2007-02-11 20:53:05 +0300 | 2 lines\r
-\r
-More correct fix for compilation under VS6.\r
-\r
-------------------------------------------------------------------------\r
-r14 | 2007-02-11 20:04:32 +0300 | 2 lines\r
-\r
-Bugfix: fix compiling under VS6, when stdint.h enclosed in 'extern "C" {}'.\r
-\r
-------------------------------------------------------------------------\r
-r13 | 2006-12-13 16:53:11 +0300 | 2 lines\r
-\r
-Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static.\r
-\r
-------------------------------------------------------------------------\r
-r12 | 2006-12-13 16:42:24 +0300 | 2 lines\r
-\r
-Error message changed: VC6 supported from now.\r
-\r
-------------------------------------------------------------------------\r
-r11 | 2006-12-13 16:39:33 +0300 | 2 lines\r
-\r
-All (U)INT* types changed to (unsigned) __int*. This should make stdint.h compatible with VC6.\r
-\r
-------------------------------------------------------------------------\r
-r10 | 2006-12-13 16:20:57 +0300 | 3 lines\r
-\r
-Added INLINE_IMAXDIV define switch. \r
-If INLINE_IMAXDIV is defined imaxdiv() have static modifier. If not - it is _inline.\r
-\r
-------------------------------------------------------------------------\r
-r9 | 2006-12-13 15:53:52 +0300 | 2 lines\r
-\r
-Error message for non-MSC compiler changed.\r
-\r
-------------------------------------------------------------------------\r
-r8 | 2006-12-13 12:47:48 +0300 | 2 lines\r
-\r
-Added #ifndef for SIZE_MAX (it is defined in limits.h on MSVSC 8).\r
-\r
-------------------------------------------------------------------------\r
-r7 | 2006-12-13 01:08:02 +0300 | 2 lines\r
-\r
-License chaged to BSD-derivative.\r
-\r
-------------------------------------------------------------------------\r
-r6 | 2006-12-13 00:53:20 +0300 | 2 lines\r
-\r
-Added <wchar.h> include to avoid warnings when it is included after stdint.h.\r
-\r
-------------------------------------------------------------------------\r
-r5 | 2006-12-12 00:58:05 +0300 | 2 lines\r
-\r
-BUGFIX: Definitions of INTPTR_MIN, INTPTR_MAX and UINTPTR_MAX for WIN32 and WIN64 was mixed up.\r
-\r
-------------------------------------------------------------------------\r
-r4 | 2006-12-12 00:51:55 +0300 | 2 lines\r
-\r
-Rise #error if _MSC_VER is not defined. I.e. compiler other then Microsoft Visual C++ is used.\r
-\r
-------------------------------------------------------------------------\r
-r3 | 2006-12-11 22:54:14 +0300 | 2 lines\r
-\r
-Added <limits.h> include to stdint.h.\r
-\r
-------------------------------------------------------------------------\r
-r2 | 2006-12-11 21:39:27 +0300 | 2 lines\r
-\r
-Initial check in.\r
-\r
-------------------------------------------------------------------------\r
-r1 | 2006-12-11 21:30:23 +0300 | 1 line\r
-\r
-Initial directory structure.\r
-------------------------------------------------------------------------\r
diff --git a/ffmpeg 0.6/include/inttypes.h b/ffmpeg 0.6/include/inttypes.h
deleted file mode 100644 (file)
index 2554277..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-// ISO C9x  compliant inttypes.h for Microsoft Visual Studio\r
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \r
-// \r
-//  Copyright (c) 2006 Alexander Chemeris\r
-// \r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are met:\r
-// \r
-//   1. Redistributions of source code must retain the above copyright notice,\r
-//      this list of conditions and the following disclaimer.\r
-// \r
-//   2. Redistributions in binary form must reproduce the above copyright\r
-//      notice, this list of conditions and the following disclaimer in the\r
-//      documentation and/or other materials provided with the distribution.\r
-// \r
-//   3. The name of the author may be used to endorse or promote products\r
-//      derived from this software without specific prior written permission.\r
-// \r
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-// \r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifndef _MSC_VER // [\r
-#error "Use this header only with Microsoft Visual C++ compilers!"\r
-#endif // _MSC_VER ]\r
-\r
-#ifndef _MSC_INTTYPES_H_ // [\r
-#define _MSC_INTTYPES_H_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif\r
-\r
-#include "stdint.h"\r
-\r
-// 7.8 Format conversion of integer types\r
-\r
-typedef struct {\r
-   intmax_t quot;\r
-   intmax_t rem;\r
-} imaxdiv_t;\r
-\r
-// 7.8.1 Macros for format specifiers\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [   See footnote 185 at page 198\r
-\r
-// The fprintf macros for signed integers are:\r
-#define PRId8       "d"\r
-#define PRIi8       "i"\r
-#define PRIdLEAST8  "d"\r
-#define PRIiLEAST8  "i"\r
-#define PRIdFAST8   "d"\r
-#define PRIiFAST8   "i"\r
-\r
-#define PRId16       "hd"\r
-#define PRIi16       "hi"\r
-#define PRIdLEAST16  "hd"\r
-#define PRIiLEAST16  "hi"\r
-#define PRIdFAST16   "hd"\r
-#define PRIiFAST16   "hi"\r
-\r
-#define PRId32       "I32d"\r
-#define PRIi32       "I32i"\r
-#define PRIdLEAST32  "I32d"\r
-#define PRIiLEAST32  "I32i"\r
-#define PRIdFAST32   "I32d"\r
-#define PRIiFAST32   "I32i"\r
-\r
-#define PRId64       "I64d"\r
-#define PRIi64       "I64i"\r
-#define PRIdLEAST64  "I64d"\r
-#define PRIiLEAST64  "I64i"\r
-#define PRIdFAST64   "I64d"\r
-#define PRIiFAST64   "I64i"\r
-\r
-#define PRIdMAX     "I64d"\r
-#define PRIiMAX     "I64i"\r
-\r
-#define PRIdPTR     "Id"\r
-#define PRIiPTR     "Ii"\r
-\r
-// The fprintf macros for unsigned integers are:\r
-#define PRIo8       "o"\r
-#define PRIu8       "u"\r
-#define PRIx8       "x"\r
-#define PRIX8       "X"\r
-#define PRIoLEAST8  "o"\r
-#define PRIuLEAST8  "u"\r
-#define PRIxLEAST8  "x"\r
-#define PRIXLEAST8  "X"\r
-#define PRIoFAST8   "o"\r
-#define PRIuFAST8   "u"\r
-#define PRIxFAST8   "x"\r
-#define PRIXFAST8   "X"\r
-\r
-#define PRIo16       "ho"\r
-#define PRIu16       "hu"\r
-#define PRIx16       "hx"\r
-#define PRIX16       "hX"\r
-#define PRIoLEAST16  "ho"\r
-#define PRIuLEAST16  "hu"\r
-#define PRIxLEAST16  "hx"\r
-#define PRIXLEAST16  "hX"\r
-#define PRIoFAST16   "ho"\r
-#define PRIuFAST16   "hu"\r
-#define PRIxFAST16   "hx"\r
-#define PRIXFAST16   "hX"\r
-\r
-#define PRIo32       "I32o"\r
-#define PRIu32       "I32u"\r
-#define PRIx32       "I32x"\r
-#define PRIX32       "I32X"\r
-#define PRIoLEAST32  "I32o"\r
-#define PRIuLEAST32  "I32u"\r
-#define PRIxLEAST32  "I32x"\r
-#define PRIXLEAST32  "I32X"\r
-#define PRIoFAST32   "I32o"\r
-#define PRIuFAST32   "I32u"\r
-#define PRIxFAST32   "I32x"\r
-#define PRIXFAST32   "I32X"\r
-\r
-#define PRIo64       "I64o"\r
-#define PRIu64       "I64u"\r
-#define PRIx64       "I64x"\r
-#define PRIX64       "I64X"\r
-#define PRIoLEAST64  "I64o"\r
-#define PRIuLEAST64  "I64u"\r
-#define PRIxLEAST64  "I64x"\r
-#define PRIXLEAST64  "I64X"\r
-#define PRIoFAST64   "I64o"\r
-#define PRIuFAST64   "I64u"\r
-#define PRIxFAST64   "I64x"\r
-#define PRIXFAST64   "I64X"\r
-\r
-#define PRIoMAX     "I64o"\r
-#define PRIuMAX     "I64u"\r
-#define PRIxMAX     "I64x"\r
-#define PRIXMAX     "I64X"\r
-\r
-#define PRIoPTR     "Io"\r
-#define PRIuPTR     "Iu"\r
-#define PRIxPTR     "Ix"\r
-#define PRIXPTR     "IX"\r
-\r
-// The fscanf macros for signed integers are:\r
-#define SCNd8       "d"\r
-#define SCNi8       "i"\r
-#define SCNdLEAST8  "d"\r
-#define SCNiLEAST8  "i"\r
-#define SCNdFAST8   "d"\r
-#define SCNiFAST8   "i"\r
-\r
-#define SCNd16       "hd"\r
-#define SCNi16       "hi"\r
-#define SCNdLEAST16  "hd"\r
-#define SCNiLEAST16  "hi"\r
-#define SCNdFAST16   "hd"\r
-#define SCNiFAST16   "hi"\r
-\r
-#define SCNd32       "ld"\r
-#define SCNi32       "li"\r
-#define SCNdLEAST32  "ld"\r
-#define SCNiLEAST32  "li"\r
-#define SCNdFAST32   "ld"\r
-#define SCNiFAST32   "li"\r
-\r
-#define SCNd64       "I64d"\r
-#define SCNi64       "I64i"\r
-#define SCNdLEAST64  "I64d"\r
-#define SCNiLEAST64  "I64i"\r
-#define SCNdFAST64   "I64d"\r
-#define SCNiFAST64   "I64i"\r
-\r
-#define SCNdMAX     "I64d"\r
-#define SCNiMAX     "I64i"\r
-\r
-#ifdef _WIN64 // [\r
-#  define SCNdPTR     "I64d"\r
-#  define SCNiPTR     "I64i"\r
-#else  // _WIN64 ][\r
-#  define SCNdPTR     "ld"\r
-#  define SCNiPTR     "li"\r
-#endif  // _WIN64 ]\r
-\r
-// The fscanf macros for unsigned integers are:\r
-#define SCNo8       "o"\r
-#define SCNu8       "u"\r
-#define SCNx8       "x"\r
-#define SCNX8       "X"\r
-#define SCNoLEAST8  "o"\r
-#define SCNuLEAST8  "u"\r
-#define SCNxLEAST8  "x"\r
-#define SCNXLEAST8  "X"\r
-#define SCNoFAST8   "o"\r
-#define SCNuFAST8   "u"\r
-#define SCNxFAST8   "x"\r
-#define SCNXFAST8   "X"\r
-\r
-#define SCNo16       "ho"\r
-#define SCNu16       "hu"\r
-#define SCNx16       "hx"\r
-#define SCNX16       "hX"\r
-#define SCNoLEAST16  "ho"\r
-#define SCNuLEAST16  "hu"\r
-#define SCNxLEAST16  "hx"\r
-#define SCNXLEAST16  "hX"\r
-#define SCNoFAST16   "ho"\r
-#define SCNuFAST16   "hu"\r
-#define SCNxFAST16   "hx"\r
-#define SCNXFAST16   "hX"\r
-\r
-#define SCNo32       "lo"\r
-#define SCNu32       "lu"\r
-#define SCNx32       "lx"\r
-#define SCNX32       "lX"\r
-#define SCNoLEAST32  "lo"\r
-#define SCNuLEAST32  "lu"\r
-#define SCNxLEAST32  "lx"\r
-#define SCNXLEAST32  "lX"\r
-#define SCNoFAST32   "lo"\r
-#define SCNuFAST32   "lu"\r
-#define SCNxFAST32   "lx"\r
-#define SCNXFAST32   "lX"\r
-\r
-#define SCNo64       "I64o"\r
-#define SCNu64       "I64u"\r
-#define SCNx64       "I64x"\r
-#define SCNX64       "I64X"\r
-#define SCNoLEAST64  "I64o"\r
-#define SCNuLEAST64  "I64u"\r
-#define SCNxLEAST64  "I64x"\r
-#define SCNXLEAST64  "I64X"\r
-#define SCNoFAST64   "I64o"\r
-#define SCNuFAST64   "I64u"\r
-#define SCNxFAST64   "I64x"\r
-#define SCNXFAST64   "I64X"\r
-\r
-#define SCNoMAX     "I64o"\r
-#define SCNuMAX     "I64u"\r
-#define SCNxMAX     "I64x"\r
-#define SCNXMAX     "I64X"\r
-\r
-#ifdef _WIN64 // [\r
-#  define SCNoPTR     "I64o"\r
-#  define SCNuPTR     "I64u"\r
-#  define SCNxPTR     "I64x"\r
-#  define SCNXPTR     "I64X"\r
-#else  // _WIN64 ][\r
-#  define SCNoPTR     "lo"\r
-#  define SCNuPTR     "lu"\r
-#  define SCNxPTR     "lx"\r
-#  define SCNXPTR     "lX"\r
-#endif  // _WIN64 ]\r
-\r
-#endif // __STDC_FORMAT_MACROS ]\r
-\r
-// 7.8.2 Functions for greatest-width integer types\r
-\r
-// 7.8.2.1 The imaxabs function\r
-#define imaxabs _abs64\r
-\r
-// 7.8.2.2 The imaxdiv function\r
-\r
-// This is modified version of div() function from Microsoft's div.c found\r
-// in %MSVC.NET%\crt\src\div.c\r
-#ifdef STATIC_IMAXDIV // [\r
-static\r
-#else // STATIC_IMAXDIV ][\r
-_inline\r
-#endif // STATIC_IMAXDIV ]\r
-imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)\r
-{\r
-   imaxdiv_t result;\r
-\r
-   result.quot = numer / denom;\r
-   result.rem = numer % denom;\r
-\r
-   if (numer < 0 && result.rem > 0) {\r
-      // did division wrong; must fix up\r
-      ++result.quot;\r
-      result.rem -= denom;\r
-   }\r
-\r
-   return result;\r
-}\r
-\r
-// 7.8.2.3 The strtoimax and strtoumax functions\r
-#define strtoimax _strtoi64\r
-#define strtoumax _strtoui64\r
-\r
-// 7.8.2.4 The wcstoimax and wcstoumax functions\r
-#define wcstoimax _wcstoi64\r
-#define wcstoumax _wcstoui64\r
-\r
-\r
-#endif // _MSC_INTTYPES_H_ ]\r
diff --git a/ffmpeg 0.6/include/libavcodec/avcodec.h b/ffmpeg 0.6/include/libavcodec/avcodec.h
deleted file mode 100644 (file)
index 974e87c..0000000
+++ /dev/null
@@ -1,3968 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVCODEC_H
-#define AVCODEC_AVCODEC_H
-
-/**
- * @file
- * external API header
- */
-
-#include <errno.h>
-#include "libavutil/avutil.h"
-
-#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 72
-#define LIBAVCODEC_VERSION_MICRO  2
-
-#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-                                               LIBAVCODEC_VERSION_MINOR, \
-                                               LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
-                                           LIBAVCODEC_VERSION_MINOR,    \
-                                           LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
-
-#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
-
-#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
-#define AV_TIME_BASE            1000000
-#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
-
-/**
- * Identifies the syntax and semantics of the bitstream.
- * The principle is roughly:
- * Two decoders with the same ID can decode the same streams.
- * Two encoders with the same ID can encode compatible streams.
- * There may be slight deviations from the principle due to implementation
- * details.
- *
- * If you add a codec ID to this list, add it so that
- * 1. no value of a existing codec ID changes (that would break ABI),
- * 2. it is as close as possible to similar codecs.
- */
-enum CodecID {
-    CODEC_ID_NONE,
-
-    /* video codecs */
-    CODEC_ID_MPEG1VIDEO,
-    CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
-    CODEC_ID_MPEG2VIDEO_XVMC,
-    CODEC_ID_H261,
-    CODEC_ID_H263,
-    CODEC_ID_RV10,
-    CODEC_ID_RV20,
-    CODEC_ID_MJPEG,
-    CODEC_ID_MJPEGB,
-    CODEC_ID_LJPEG,
-    CODEC_ID_SP5X,
-    CODEC_ID_JPEGLS,
-    CODEC_ID_MPEG4,
-    CODEC_ID_RAWVIDEO,
-    CODEC_ID_MSMPEG4V1,
-    CODEC_ID_MSMPEG4V2,
-    CODEC_ID_MSMPEG4V3,
-    CODEC_ID_WMV1,
-    CODEC_ID_WMV2,
-    CODEC_ID_H263P,
-    CODEC_ID_H263I,
-    CODEC_ID_FLV1,
-    CODEC_ID_SVQ1,
-    CODEC_ID_SVQ3,
-    CODEC_ID_DVVIDEO,
-    CODEC_ID_HUFFYUV,
-    CODEC_ID_CYUV,
-    CODEC_ID_H264,
-    CODEC_ID_INDEO3,
-    CODEC_ID_VP3,
-    CODEC_ID_THEORA,
-    CODEC_ID_ASV1,
-    CODEC_ID_ASV2,
-    CODEC_ID_FFV1,
-    CODEC_ID_4XM,
-    CODEC_ID_VCR1,
-    CODEC_ID_CLJR,
-    CODEC_ID_MDEC,
-    CODEC_ID_ROQ,
-    CODEC_ID_INTERPLAY_VIDEO,
-    CODEC_ID_XAN_WC3,
-    CODEC_ID_XAN_WC4,
-    CODEC_ID_RPZA,
-    CODEC_ID_CINEPAK,
-    CODEC_ID_WS_VQA,
-    CODEC_ID_MSRLE,
-    CODEC_ID_MSVIDEO1,
-    CODEC_ID_IDCIN,
-    CODEC_ID_8BPS,
-    CODEC_ID_SMC,
-    CODEC_ID_FLIC,
-    CODEC_ID_TRUEMOTION1,
-    CODEC_ID_VMDVIDEO,
-    CODEC_ID_MSZH,
-    CODEC_ID_ZLIB,
-    CODEC_ID_QTRLE,
-    CODEC_ID_SNOW,
-    CODEC_ID_TSCC,
-    CODEC_ID_ULTI,
-    CODEC_ID_QDRAW,
-    CODEC_ID_VIXL,
-    CODEC_ID_QPEG,
-#if LIBAVCODEC_VERSION_MAJOR < 53
-    CODEC_ID_XVID,
-#endif
-    CODEC_ID_PNG,
-    CODEC_ID_PPM,
-    CODEC_ID_PBM,
-    CODEC_ID_PGM,
-    CODEC_ID_PGMYUV,
-    CODEC_ID_PAM,
-    CODEC_ID_FFVHUFF,
-    CODEC_ID_RV30,
-    CODEC_ID_RV40,
-    CODEC_ID_VC1,
-    CODEC_ID_WMV3,
-    CODEC_ID_LOCO,
-    CODEC_ID_WNV1,
-    CODEC_ID_AASC,
-    CODEC_ID_INDEO2,
-    CODEC_ID_FRAPS,
-    CODEC_ID_TRUEMOTION2,
-    CODEC_ID_BMP,
-    CODEC_ID_CSCD,
-    CODEC_ID_MMVIDEO,
-    CODEC_ID_ZMBV,
-    CODEC_ID_AVS,
-    CODEC_ID_SMACKVIDEO,
-    CODEC_ID_NUV,
-    CODEC_ID_KMVC,
-    CODEC_ID_FLASHSV,
-    CODEC_ID_CAVS,
-    CODEC_ID_JPEG2000,
-    CODEC_ID_VMNC,
-    CODEC_ID_VP5,
-    CODEC_ID_VP6,
-    CODEC_ID_VP6F,
-    CODEC_ID_TARGA,
-    CODEC_ID_DSICINVIDEO,
-    CODEC_ID_TIERTEXSEQVIDEO,
-    CODEC_ID_TIFF,
-    CODEC_ID_GIF,
-    CODEC_ID_FFH264,
-    CODEC_ID_DXA,
-    CODEC_ID_DNXHD,
-    CODEC_ID_THP,
-    CODEC_ID_SGI,
-    CODEC_ID_C93,
-    CODEC_ID_BETHSOFTVID,
-    CODEC_ID_PTX,
-    CODEC_ID_TXD,
-    CODEC_ID_VP6A,
-    CODEC_ID_AMV,
-    CODEC_ID_VB,
-    CODEC_ID_PCX,
-    CODEC_ID_SUNRAST,
-    CODEC_ID_INDEO4,
-    CODEC_ID_INDEO5,
-    CODEC_ID_MIMIC,
-    CODEC_ID_RL2,
-    CODEC_ID_8SVX_EXP,
-    CODEC_ID_8SVX_FIB,
-    CODEC_ID_ESCAPE124,
-    CODEC_ID_DIRAC,
-    CODEC_ID_BFI,
-    CODEC_ID_CMV,
-    CODEC_ID_MOTIONPIXELS,
-    CODEC_ID_TGV,
-    CODEC_ID_TGQ,
-    CODEC_ID_TQI,
-    CODEC_ID_AURA,
-    CODEC_ID_AURA2,
-    CODEC_ID_V210X,
-    CODEC_ID_TMV,
-    CODEC_ID_V210,
-    CODEC_ID_DPX,
-    CODEC_ID_MAD,
-    CODEC_ID_FRWU,
-    CODEC_ID_FLASHSV2,
-    CODEC_ID_CDGRAPHICS,
-    CODEC_ID_R210,
-    CODEC_ID_ANM,
-    CODEC_ID_BINKVIDEO,
-    CODEC_ID_IFF_ILBM,
-    CODEC_ID_IFF_BYTERUN1,
-    CODEC_ID_KGV1,
-    CODEC_ID_YOP,
-    CODEC_ID_VP8,
-
-    /* various PCM "codecs" */
-    CODEC_ID_PCM_S16LE= 0x10000,
-    CODEC_ID_PCM_S16BE,
-    CODEC_ID_PCM_U16LE,
-    CODEC_ID_PCM_U16BE,
-    CODEC_ID_PCM_S8,
-    CODEC_ID_PCM_U8,
-    CODEC_ID_PCM_MULAW,
-    CODEC_ID_PCM_ALAW,
-    CODEC_ID_PCM_S32LE,
-    CODEC_ID_PCM_S32BE,
-    CODEC_ID_PCM_U32LE,
-    CODEC_ID_PCM_U32BE,
-    CODEC_ID_PCM_S24LE,
-    CODEC_ID_PCM_S24BE,
-    CODEC_ID_PCM_U24LE,
-    CODEC_ID_PCM_U24BE,
-    CODEC_ID_PCM_S24DAUD,
-    CODEC_ID_PCM_ZORK,
-    CODEC_ID_PCM_S16LE_PLANAR,
-    CODEC_ID_PCM_DVD,
-    CODEC_ID_PCM_F32BE,
-    CODEC_ID_PCM_F32LE,
-    CODEC_ID_PCM_F64BE,
-    CODEC_ID_PCM_F64LE,
-    CODEC_ID_PCM_BLURAY,
-
-    /* various ADPCM codecs */
-    CODEC_ID_ADPCM_IMA_QT= 0x11000,
-    CODEC_ID_ADPCM_IMA_WAV,
-    CODEC_ID_ADPCM_IMA_DK3,
-    CODEC_ID_ADPCM_IMA_DK4,
-    CODEC_ID_ADPCM_IMA_WS,
-    CODEC_ID_ADPCM_IMA_SMJPEG,
-    CODEC_ID_ADPCM_MS,
-    CODEC_ID_ADPCM_4XM,
-    CODEC_ID_ADPCM_XA,
-    CODEC_ID_ADPCM_ADX,
-    CODEC_ID_ADPCM_EA,
-    CODEC_ID_ADPCM_G726,
-    CODEC_ID_ADPCM_CT,
-    CODEC_ID_ADPCM_SWF,
-    CODEC_ID_ADPCM_YAMAHA,
-    CODEC_ID_ADPCM_SBPRO_4,
-    CODEC_ID_ADPCM_SBPRO_3,
-    CODEC_ID_ADPCM_SBPRO_2,
-    CODEC_ID_ADPCM_THP,
-    CODEC_ID_ADPCM_IMA_AMV,
-    CODEC_ID_ADPCM_EA_R1,
-    CODEC_ID_ADPCM_EA_R3,
-    CODEC_ID_ADPCM_EA_R2,
-    CODEC_ID_ADPCM_IMA_EA_SEAD,
-    CODEC_ID_ADPCM_IMA_EA_EACS,
-    CODEC_ID_ADPCM_EA_XAS,
-    CODEC_ID_ADPCM_EA_MAXIS_XA,
-    CODEC_ID_ADPCM_IMA_ISS,
-
-    /* AMR */
-    CODEC_ID_AMR_NB= 0x12000,
-    CODEC_ID_AMR_WB,
-
-    /* RealAudio codecs*/
-    CODEC_ID_RA_144= 0x13000,
-    CODEC_ID_RA_288,
-
-    /* various DPCM codecs */
-    CODEC_ID_ROQ_DPCM= 0x14000,
-    CODEC_ID_INTERPLAY_DPCM,
-    CODEC_ID_XAN_DPCM,
-    CODEC_ID_SOL_DPCM,
-
-    /* audio codecs */
-    CODEC_ID_MP2= 0x15000,
-    CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
-    CODEC_ID_AAC,
-    CODEC_ID_AC3,
-    CODEC_ID_DTS,
-    CODEC_ID_VORBIS,
-    CODEC_ID_DVAUDIO,
-    CODEC_ID_WMAV1,
-    CODEC_ID_WMAV2,
-    CODEC_ID_MACE3,
-    CODEC_ID_MACE6,
-    CODEC_ID_VMDAUDIO,
-    CODEC_ID_SONIC,
-    CODEC_ID_SONIC_LS,
-    CODEC_ID_FLAC,
-    CODEC_ID_MP3ADU,
-    CODEC_ID_MP3ON4,
-    CODEC_ID_SHORTEN,
-    CODEC_ID_ALAC,
-    CODEC_ID_WESTWOOD_SND1,
-    CODEC_ID_GSM, ///< as in Berlin toast format
-    CODEC_ID_QDM2,
-    CODEC_ID_COOK,
-    CODEC_ID_TRUESPEECH,
-    CODEC_ID_TTA,
-    CODEC_ID_SMACKAUDIO,
-    CODEC_ID_QCELP,
-    CODEC_ID_WAVPACK,
-    CODEC_ID_DSICINAUDIO,
-    CODEC_ID_IMC,
-    CODEC_ID_MUSEPACK7,
-    CODEC_ID_MLP,
-    CODEC_ID_GSM_MS, /* as found in WAV */
-    CODEC_ID_ATRAC3,
-    CODEC_ID_VOXWARE,
-    CODEC_ID_APE,
-    CODEC_ID_NELLYMOSER,
-    CODEC_ID_MUSEPACK8,
-    CODEC_ID_SPEEX,
-    CODEC_ID_WMAVOICE,
-    CODEC_ID_WMAPRO,
-    CODEC_ID_WMALOSSLESS,
-    CODEC_ID_ATRAC3P,
-    CODEC_ID_EAC3,
-    CODEC_ID_SIPR,
-    CODEC_ID_MP1,
-    CODEC_ID_TWINVQ,
-    CODEC_ID_TRUEHD,
-    CODEC_ID_MP4ALS,
-    CODEC_ID_ATRAC1,
-    CODEC_ID_BINKAUDIO_RDFT,
-    CODEC_ID_BINKAUDIO_DCT,
-
-    /* subtitle codecs */
-    CODEC_ID_DVD_SUBTITLE= 0x17000,
-    CODEC_ID_DVB_SUBTITLE,
-    CODEC_ID_TEXT,  ///< raw UTF-8 text
-    CODEC_ID_XSUB,
-    CODEC_ID_SSA,
-    CODEC_ID_MOV_TEXT,
-    CODEC_ID_HDMV_PGS_SUBTITLE,
-    CODEC_ID_DVB_TELETEXT,
-
-    /* other specific kind of codecs (generally used for attachments) */
-    CODEC_ID_TTF= 0x18000,
-
-    CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
-
-    CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
-                                * stream (only used by libavformat) */
-};
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-#define CodecType AVMediaType
-
-#define CODEC_TYPE_UNKNOWN    AVMEDIA_TYPE_UNKNOWN
-#define CODEC_TYPE_VIDEO      AVMEDIA_TYPE_VIDEO
-#define CODEC_TYPE_AUDIO      AVMEDIA_TYPE_AUDIO
-#define CODEC_TYPE_DATA       AVMEDIA_TYPE_DATA
-#define CODEC_TYPE_SUBTITLE   AVMEDIA_TYPE_SUBTITLE
-#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
-#define CODEC_TYPE_NB         AVMEDIA_TYPE_NB
-#endif
-
-/**
- * all in native-endian format
- */
-enum SampleFormat {
-    SAMPLE_FMT_NONE = -1,
-    SAMPLE_FMT_U8,              ///< unsigned 8 bits
-    SAMPLE_FMT_S16,             ///< signed 16 bits
-    SAMPLE_FMT_S32,             ///< signed 32 bits
-    SAMPLE_FMT_FLT,             ///< float
-    SAMPLE_FMT_DBL,             ///< double
-    SAMPLE_FMT_NB               ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec
-};
-
-/* Audio channel masks */
-#define CH_FRONT_LEFT             0x00000001
-#define CH_FRONT_RIGHT            0x00000002
-#define CH_FRONT_CENTER           0x00000004
-#define CH_LOW_FREQUENCY          0x00000008
-#define CH_BACK_LEFT              0x00000010
-#define CH_BACK_RIGHT             0x00000020
-#define CH_FRONT_LEFT_OF_CENTER   0x00000040
-#define CH_FRONT_RIGHT_OF_CENTER  0x00000080
-#define CH_BACK_CENTER            0x00000100
-#define CH_SIDE_LEFT              0x00000200
-#define CH_SIDE_RIGHT             0x00000400
-#define CH_TOP_CENTER             0x00000800
-#define CH_TOP_FRONT_LEFT         0x00001000
-#define CH_TOP_FRONT_CENTER       0x00002000
-#define CH_TOP_FRONT_RIGHT        0x00004000
-#define CH_TOP_BACK_LEFT          0x00008000
-#define CH_TOP_BACK_CENTER        0x00010000
-#define CH_TOP_BACK_RIGHT         0x00020000
-#define CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
-#define CH_STEREO_RIGHT           0x40000000  ///< See CH_STEREO_LEFT.
-
-/** Channel mask value used for AVCodecContext.request_channel_layout
-    to indicate that the user requests the channel order of the decoder output
-    to be the native codec channel order. */
-#define CH_LAYOUT_NATIVE          0x8000000000000000LL
-
-/* Audio channel convenience macros */
-#define CH_LAYOUT_MONO              (CH_FRONT_CENTER)
-#define CH_LAYOUT_STEREO            (CH_FRONT_LEFT|CH_FRONT_RIGHT)
-#define CH_LAYOUT_2_1               (CH_LAYOUT_STEREO|CH_BACK_CENTER)
-#define CH_LAYOUT_SURROUND          (CH_LAYOUT_STEREO|CH_FRONT_CENTER)
-#define CH_LAYOUT_4POINT0           (CH_LAYOUT_SURROUND|CH_BACK_CENTER)
-#define CH_LAYOUT_2_2               (CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT)
-#define CH_LAYOUT_QUAD              (CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT)
-#define CH_LAYOUT_5POINT0           (CH_LAYOUT_SURROUND|CH_SIDE_LEFT|CH_SIDE_RIGHT)
-#define CH_LAYOUT_5POINT1           (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
-#define CH_LAYOUT_5POINT0_BACK      (CH_LAYOUT_SURROUND|CH_BACK_LEFT|CH_BACK_RIGHT)
-#define CH_LAYOUT_5POINT1_BACK      (CH_LAYOUT_5POINT0_BACK|CH_LOW_FREQUENCY)
-#define CH_LAYOUT_7POINT0           (CH_LAYOUT_5POINT0|CH_BACK_LEFT|CH_BACK_RIGHT)
-#define CH_LAYOUT_7POINT1           (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
-#define CH_LAYOUT_7POINT1_WIDE      (CH_LAYOUT_5POINT1_BACK|\
-                                          CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
-#define CH_LAYOUT_STEREO_DOWNMIX    (CH_STEREO_LEFT|CH_STEREO_RIGHT)
-
-/* in bytes */
-#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-
-/**
- * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * This is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end.<br>
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged
- * MPEG bitstreams could cause overread and segfault.
- */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-
-/**
- * minimum encoding buffer size
- * Used to avoid some checks during header writing.
- */
-#define FF_MIN_BUFFER_SIZE 16384
-
-
-/**
- * motion estimation type.
- */
-enum Motion_Est_ID {
-    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
-    ME_FULL,
-    ME_LOG,
-    ME_PHODS,
-    ME_EPZS,        ///< enhanced predictive zonal search
-    ME_X1,          ///< reserved for experiments
-    ME_HEX,         ///< hexagon based search
-    ME_UMH,         ///< uneven multi-hexagon search
-    ME_ITER,        ///< iterative search
-    ME_TESA,        ///< transformed exhaustive search algorithm
-};
-
-enum AVDiscard{
-    /* We leave some space between them for extensions (drop some
-     * keyframes for intra-only or drop just some bidir frames). */
-    AVDISCARD_NONE   =-16, ///< discard nothing
-    AVDISCARD_DEFAULT=  0, ///< discard useless packets like 0 size packets in avi
-    AVDISCARD_NONREF =  8, ///< discard all non reference
-    AVDISCARD_BIDIR  = 16, ///< discard all bidirectional frames
-    AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
-    AVDISCARD_ALL    = 48, ///< discard all
-};
-
-enum AVColorPrimaries{
-    AVCOL_PRI_BT709      =1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
-    AVCOL_PRI_UNSPECIFIED=2,
-    AVCOL_PRI_BT470M     =4,
-    AVCOL_PRI_BT470BG    =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_PRI_SMPTE170M  =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
-    AVCOL_PRI_SMPTE240M  =7, ///< functionally identical to above
-    AVCOL_PRI_FILM       =8,
-    AVCOL_PRI_NB           , ///< Not part of ABI
-};
-
-enum AVColorTransferCharacteristic{
-    AVCOL_TRC_BT709      =1, ///< also ITU-R BT1361
-    AVCOL_TRC_UNSPECIFIED=2,
-    AVCOL_TRC_GAMMA22    =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_TRC_GAMMA28    =5, ///< also ITU-R BT470BG
-    AVCOL_TRC_NB           , ///< Not part of ABI
-};
-
-enum AVColorSpace{
-    AVCOL_SPC_RGB        =0,
-    AVCOL_SPC_BT709      =1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
-    AVCOL_SPC_UNSPECIFIED=2,
-    AVCOL_SPC_FCC        =4,
-    AVCOL_SPC_BT470BG    =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
-    AVCOL_SPC_SMPTE170M  =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
-    AVCOL_SPC_SMPTE240M  =7,
-    AVCOL_SPC_NB           , ///< Not part of ABI
-};
-
-enum AVColorRange{
-    AVCOL_RANGE_UNSPECIFIED=0,
-    AVCOL_RANGE_MPEG       =1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
-    AVCOL_RANGE_JPEG       =2, ///< the normal     2^n-1   "JPEG" YUV ranges
-    AVCOL_RANGE_NB           , ///< Not part of ABI
-};
-
-/**
- *  X   X      3 4 X      X are luma samples,
- *             1 2        1-6 are possible chroma positions
- *  X   X      5 6 X      0 is undefined/unknown position
- */
-enum AVChromaLocation{
-    AVCHROMA_LOC_UNSPECIFIED=0,
-    AVCHROMA_LOC_LEFT       =1, ///< mpeg2/4, h264 default
-    AVCHROMA_LOC_CENTER     =2, ///< mpeg1, jpeg, h263
-    AVCHROMA_LOC_TOPLEFT    =3, ///< DV
-    AVCHROMA_LOC_TOP        =4,
-    AVCHROMA_LOC_BOTTOMLEFT =5,
-    AVCHROMA_LOC_BOTTOM     =6,
-    AVCHROMA_LOC_NB           , ///< Not part of ABI
-};
-
-typedef struct RcOverride{
-    int start_frame;
-    int end_frame;
-    int qscale; // If this is 0 then quality_factor will be used instead.
-    float quality_factor;
-} RcOverride;
-
-#define FF_MAX_B_FRAMES 16
-
-/* encoding support
-   These flags can be passed in AVCodecContext.flags before initialization.
-   Note: Not everything is supported yet.
-*/
-
-#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
-#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
-#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
-#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
-#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
-#define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
-/**
- * The parent program guarantees that the input for B-frames containing
- * streams is not written to for at least s->max_b_frames+1 frames, if
- * this is not set the input will be copied.
- */
-#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
-#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
-#define CODEC_FLAG_EXTERN_HUFF     0x1000   ///< Use external Huffman table (for MJPEG).
-#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
-#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
-#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
-#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
-                                                  location instead of only at frame boundaries. */
-#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
-#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
-#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
-#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
-#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
-#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
-#define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
-#define CODEC_FLAG_CBP_RD         0x04000000 ///< Use rate distortion optimization for cbp.
-#define CODEC_FLAG_QP_RD          0x08000000 ///< Use rate distortion optimization for qp selectioon.
-#define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
-#define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
-#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
-#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
-#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
-#define CODEC_FLAG_CLOSED_GOP     0x80000000
-#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
-#define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< Strictly enforce GOP size.
-#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
-#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
-#define CODEC_FLAG2_BPYRAMID      0x00000010 ///< H.264 allow B-frames to be used as references.
-#define CODEC_FLAG2_WPRED         0x00000020 ///< H.264 weighted biprediction for B-frames
-#define CODEC_FLAG2_MIXED_REFS    0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
-#define CODEC_FLAG2_8X8DCT        0x00000080 ///< H.264 high profile 8x8 transform
-#define CODEC_FLAG2_FASTPSKIP     0x00000100 ///< H.264 fast pskip
-#define CODEC_FLAG2_AUD           0x00000200 ///< H.264 access unit delimiters
-#define CODEC_FLAG2_BRDO          0x00000400 ///< B-frame rate-distortion optimization
-#define CODEC_FLAG2_INTRA_VLC     0x00000800 ///< Use MPEG-2 intra VLC table.
-#define CODEC_FLAG2_MEMC_ONLY     0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
-#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
-#define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
-#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
-#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
-#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
-#define CODEC_FLAG2_MBTREE        0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
-#define CODEC_FLAG2_PSY           0x00080000 ///< Use psycho visual optimizations.
-#define CODEC_FLAG2_SSIM          0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
-
-/* Unsupported options :
- *              Syntax Arithmetic coding (SAC)
- *              Reference Picture Selection
- *              Independent Segment Decoding */
-/* /Fx */
-/* codec capabilities */
-
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
-/**
- * Codec uses get_buffer() for allocating buffers and supports custom allocators.
- * If not set, it might not use get_buffer() at all or use operations that
- * assume the buffer was allocated by avcodec_default_get_buffer.
- */
-#define CODEC_CAP_DR1             0x0002
-/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
-#define CODEC_CAP_PARSE_ONLY      0x0004
-#define CODEC_CAP_TRUNCATED       0x0008
-/* Codec can export data for HW decoding (XvMC). */
-#define CODEC_CAP_HWACCEL         0x0010
-/**
- * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
- * If this is not set, the codec is guaranteed to never be fed with NULL data.
- */
-#define CODEC_CAP_DELAY           0x0020
-/**
- * Codec can be fed a final frame with a smaller size.
- * This can be used to prevent truncation of the last audio samples.
- */
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
-/**
- * Codec can export data for HW decoding (VDPAU).
- */
-#define CODEC_CAP_HWACCEL_VDPAU    0x0080
-/**
- * Codec can output multiple frames per AVPacket
- * Normally demuxers return one frame at a time, demuxers which do not do
- * are connected to a parser to split what they return into proper frames.
- * This flag is reserved to the very rare category of codecs which have a
- * bitstream that cannot be split into frames without timeconsuming
- * operations like full decoding. Demuxers carring such bitstreams thus
- * may return multiple frames in a packet. This has many disadvantages like
- * prohibiting stream copy in many cases thus it should only be considered
- * as a last resort.
- */
-#define CODEC_CAP_SUBFRAMES        0x0100
-/**
- * Codec is experimental and is thus avoided in favor of non experimental
- * encoders
- */
-#define CODEC_CAP_EXPERIMENTAL     0x0200
-
-//The following defines may change, don't expect compatibility if you use them.
-#define MB_TYPE_INTRA4x4   0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16      0x0008
-#define MB_TYPE_16x8       0x0010
-#define MB_TYPE_8x16       0x0020
-#define MB_TYPE_8x8        0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2    0x0100 //FIXME
-#define MB_TYPE_ACPRED     0x0200
-#define MB_TYPE_GMC        0x0400
-#define MB_TYPE_SKIP       0x0800
-#define MB_TYPE_P0L0       0x1000
-#define MB_TYPE_P1L0       0x2000
-#define MB_TYPE_P0L1       0x4000
-#define MB_TYPE_P1L1       0x8000
-#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
-#define MB_TYPE_QUANT      0x00010000
-#define MB_TYPE_CBP        0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
-
-/**
- * Pan Scan area.
- * This specifies the area which should be displayed.
- * Note there may be multiple such areas for one frame.
- */
-typedef struct AVPanScan{
-    /**
-     * id
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int id;
-
-    /**
-     * width and height in 1/16 pel
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int width;
-    int height;
-
-    /**
-     * position of the top left corner in 1/16 pel for up to 3 fields/frames
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int16_t position[3][2];
-}AVPanScan;
-
-#define FF_COMMON_FRAME \
-    /**\
-     * pointer to the picture planes.\
-     * This might be different from the first allocated byte\
-     * - encoding: \
-     * - decoding: \
-     */\
-    uint8_t *data[4];\
-    int linesize[4];\
-    /**\
-     * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
-     * This isn't used by libavcodec unless the default get/release_buffer() is used.\
-     * - encoding: \
-     * - decoding: \
-     */\
-    uint8_t *base[4];\
-    /**\
-     * 1 -> keyframe, 0-> not\
-     * - encoding: Set by libavcodec.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int key_frame;\
-\
-    /**\
-     * Picture type of the frame, see ?_TYPE below.\
-     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
-     * - decoding: Set by libavcodec.\
-     */\
-    int pict_type;\
-\
-    /**\
-     * presentation timestamp in time_base units (time when frame should be shown to user)\
-     * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
-     * - encoding: MUST be set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int64_t pts;\
-\
-    /**\
-     * picture number in bitstream order\
-     * - encoding: set by\
-     * - decoding: Set by libavcodec.\
-     */\
-    int coded_picture_number;\
-    /**\
-     * picture number in display order\
-     * - encoding: set by\
-     * - decoding: Set by libavcodec.\
-     */\
-    int display_picture_number;\
-\
-    /**\
-     * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
-     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
-     * - decoding: Set by libavcodec.\
-     */\
-    int quality; \
-\
-    /**\
-     * buffer age (1->was last buffer and dint change, 2->..., ...).\
-     * Set to INT_MAX if the buffer has not been used yet.\
-     * - encoding: unused\
-     * - decoding: MUST be set by get_buffer().\
-     */\
-    int age;\
-\
-    /**\
-     * is this picture used as reference\
-     * The values for this are the same as the MpegEncContext.picture_structure\
-     * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
-     * Set to 4 for delayed, non-reference frames.\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec. (before get_buffer() call)).\
-     */\
-    int reference;\
-\
-    /**\
-     * QP table\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int8_t *qscale_table;\
-    /**\
-     * QP store stride\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int qstride;\
-\
-    /**\
-     * mbskip_table[mb]>=1 if MB didn't change\
-     * stride= mb_width = (width+15)>>4\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint8_t *mbskip_table;\
-\
-    /**\
-     * motion vector table\
-     * @code\
-     * example:\
-     * int mv_sample_log2= 4 - motion_subsample_log2;\
-     * int mb_width= (width+15)>>4;\
-     * int mv_stride= (mb_width << mv_sample_log2) + 1;\
-     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
-     * @endcode\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int16_t (*motion_val[2])[2];\
-\
-    /**\
-     * macroblock type table\
-     * mb_type_base + mb_width + 2\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint32_t *mb_type;\
-\
-    /**\
-     * log2 of the size of the block which a single vector in motion_val represents: \
-     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint8_t motion_subsample_log2;\
-\
-    /**\
-     * for some private data of the user\
-     * - encoding: unused\
-     * - decoding: Set by user.\
-     */\
-    void *opaque;\
-\
-    /**\
-     * error\
-     * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\
-     * - decoding: unused\
-     */\
-    uint64_t error[4];\
-\
-    /**\
-     * type of the buffer (to keep track of who has to deallocate data[*])\
-     * - encoding: Set by the one who allocates it.\
-     * - decoding: Set by the one who allocates it.\
-     * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\
-     */\
-    int type;\
-    \
-    /**\
-     * When decoding, this signals how much the picture must be delayed.\
-     * extra_delay = repeat_pict / (2*fps)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int repeat_pict;\
-    \
-    /**\
-     * \
-     */\
-    int qscale_type;\
-    \
-    /**\
-     * The content of the picture is interlaced.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec. (default 0)\
-     */\
-    int interlaced_frame;\
-    \
-    /**\
-     * If the content is interlaced, is top field displayed first.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int top_field_first;\
-    \
-    /**\
-     * Pan scan.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    AVPanScan *pan_scan;\
-    \
-    /**\
-     * Tell user application that palette has changed from previous frame.\
-     * - encoding: ??? (no palette-enabled encoder yet)\
-     * - decoding: Set by libavcodec. (default 0).\
-     */\
-    int palette_has_changed;\
-    \
-    /**\
-     * codec suggestion on buffer type if != 0\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec. (before get_buffer() call)).\
-     */\
-    int buffer_hints;\
-\
-    /**\
-     * DCT coefficients\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    short *dct_coeff;\
-\
-    /**\
-     * motion reference frame index\
-     * the order in which these are stored can depend on the codec.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int8_t *ref_index[2];\
-\
-    /**\
-     * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque\
-     * output in AVFrame.reordered_opaque\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int64_t reordered_opaque;\
-\
-    /**\
-     * hardware accelerator private data (FFmpeg allocated)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec\
-     */\
-    void *hwaccel_picture_private;\
-
-
-#define FF_QSCALE_TYPE_MPEG1 0
-#define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264  2
-#define FF_QSCALE_TYPE_VP56  3
-
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
-#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
-
-
-#define FF_I_TYPE  1 ///< Intra
-#define FF_P_TYPE  2 ///< Predicted
-#define FF_B_TYPE  3 ///< Bi-dir predicted
-#define FF_S_TYPE  4 ///< S(GMC)-VOP MPEG4
-#define FF_SI_TYPE 5 ///< Switching Intra
-#define FF_SP_TYPE 6 ///< Switching Predicted
-#define FF_BI_TYPE 7
-
-#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
-
-typedef struct AVPacket {
-    /**
-     * Presentation timestamp in AVStream->time_base units; the time at which
-     * the decompressed packet will be presented to the user.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     * pts MUST be larger or equal to dts as presentation cannot happen before
-     * decompression, unless one wants to view hex dumps. Some formats misuse
-     * the terms dts and pts/cts to mean something different. Such timestamps
-     * must be converted to true pts/dts before they are stored in AVPacket.
-     */
-    int64_t pts;
-    /**
-     * Decompression timestamp in AVStream->time_base units; the time at which
-     * the packet is decompressed.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     */
-    int64_t dts;
-    uint8_t *data;
-    int   size;
-    int   stream_index;
-    int   flags;
-    /**
-     * Duration of this packet in AVStream->time_base units, 0 if unknown.
-     * Equals next_pts - this_pts in presentation order.
-     */
-    int   duration;
-    void  (*destruct)(struct AVPacket *);
-    void  *priv;
-    int64_t pos;                            ///< byte position in stream, -1 if unknown
-
-    /**
-     * Time difference in AVStream->time_base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current packet.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-} AVPacket;
-#define AV_PKT_FLAG_KEY   0x0001
-#if LIBAVCODEC_VERSION_MAJOR < 53
-#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
-#endif
-
-/**
- * Audio Video Frame.
- * New fields can be added to the end of FF_COMMON_FRAME with minor version
- * bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump. No fields should be added into AVFrame before or after
- * FF_COMMON_FRAME!
- * sizeof(AVFrame) must not be used outside libav*.
- */
-typedef struct AVFrame {
-    FF_COMMON_FRAME
-} AVFrame;
-
-/**
- * main external API structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVCodecContext) must not be used outside libav*.
- */
-typedef struct AVCodecContext {
-    /**
-     * information on struct for av_log
-     * - set by avcodec_alloc_context
-     */
-    const AVClass *av_class;
-    /**
-     * the average bitrate
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
-     */
-    int bit_rate;
-
-    /**
-     * number of bits the bitstream is allowed to diverge from the reference.
-     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: unused
-     */
-    int bit_rate_tolerance;
-
-    /**
-     * CODEC_FLAG_*.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags;
-
-    /**
-     * Some codecs need additional format info. It is stored here.
-     * If any muxer uses this then ALL demuxers/parsers AND encoders for the
-     * specific codec MUST set it correctly otherwise stream copy breaks.
-     * In general use of this field by muxers is not recommanded.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec. (FIXME: Is this OK?)
-     */
-    int sub_id;
-
-    /**
-     * Motion estimation algorithm used for video coding.
-     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
-     * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
-     * - encoding: MUST be set by user.
-     * - decoding: unused
-     */
-    int me_method;
-
-    /**
-     * some codecs need / can use extradata like Huffman tables.
-     * mjpeg: Huffman tables
-     * rv10: additional flags
-     * mpeg4: global headers (they can be in the bitstream or here)
-     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
-     * than extradata_size to avoid prolems if it is read with the bitstream reader.
-     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
-     * - encoding: Set/allocated/freed by libavcodec.
-     * - decoding: Set/allocated/freed by user.
-     */
-    uint8_t *extradata;
-    int extradata_size;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identically 1.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational time_base;
-
-    /* video only */
-    /**
-     * picture width / height.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     * Note: For compatibility it is possible to set this instead of
-     * coded_width/height before decoding.
-     */
-    int width, height;
-
-#define FF_ASPECT_EXTENDED 15
-
-    /**
-     * the number of pictures in a group of pictures, or 0 for intra_only
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int gop_size;
-
-    /**
-     * Pixel format, see PIX_FMT_xxx.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum PixelFormat pix_fmt;
-
-    /**
-     * Frame rate emulation. If not zero, the lower layer (i.e. format handler)
-     * has to read frames at native frame rate.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rate_emu;
-
-    /**
-     * If non NULL, 'draw_horiz_band' is called by the libavcodec
-     * decoder to draw a horizontal band. It improves cache usage. Not
-     * all codecs can do that. You must check the codec capabilities
-     * beforehand.
-     * The function is also used by hardware acceleration APIs.
-     * It is called at least once during frame decoding to pass
-     * the data needed for hardware render.
-     * In that mode instead of pixel data, AVFrame points to
-     * a structure specific to the acceleration API. The application
-     * reads the structure and can change some fields to indicate progress
-     * or mark state.
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @param height the height of the slice
-     * @param y the y position of the slice
-     * @param type 1->top field, 2->bottom field, 3->frame
-     * @param offset offset into the AVFrame.data from which the slice should be read
-     */
-    void (*draw_horiz_band)(struct AVCodecContext *s,
-                            const AVFrame *src, int offset[4],
-                            int y, int type, int height);
-
-    /* audio only */
-    int sample_rate; ///< samples per second
-    int channels;    ///< number of audio channels
-
-    /**
-     * audio sample format
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum SampleFormat sample_fmt;  ///< sample format
-
-    /* The following data should not be initialized. */
-    /**
-     * Samples per packet, initialized when calling 'init'.
-     */
-    int frame_size;
-    int frame_number;   ///< audio or video frame number
-#if LIBAVCODEC_VERSION_MAJOR < 53
-    int real_pict_num;  ///< Returns the real picture number of previous encoded frame.
-#endif
-
-    /**
-     * Number of frames the decoded output will be delayed relative to
-     * the encoded input.
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int delay;
-
-    /* - encoding parameters */
-    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
-    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
-
-    /**
-     * minimum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmin;
-
-    /**
-     * maximum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmax;
-
-    /**
-     * maximum quantizer difference between frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_qdiff;
-
-    /**
-     * maximum number of B-frames between non-B-frames
-     * Note: The output will be delayed by max_b_frames+1 relative to the input.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_b_frames;
-
-    /**
-     * qscale factor between IP and B-frames
-     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_factor;
-
-    /** obsolete FIXME remove */
-    int rc_strategy;
-#define FF_RC_STRATEGY_XVID 1
-
-    int b_frame_strategy;
-
-    /**
-     * hurry up amount
-     * - encoding: unused
-     * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
-     * @deprecated Deprecated in favor of skip_idct and skip_frame.
-     */
-    int hurry_up;
-
-    struct AVCodec *codec;
-
-    void *priv_data;
-
-    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
-                            /* do its best to deliver a chunk with size     */
-                            /* below rtp_payload_size, the chunk will start */
-                            /* with a start code on some codecs like H.263. */
-                            /* This doesn't take account of any particular  */
-                            /* headers inside the transmitted RTP payload.  */
-
-
-    /* The RTP callback: This function is called    */
-    /* every time the encoder has a packet to send. */
-    /* It depends on the encoder if the data starts */
-    /* with a Start Code (it should). H.263 does.   */
-    /* mb_nb contains the number of macroblocks     */
-    /* encoded in the RTP payload.                  */
-    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
-
-    /* statistics, used for 2-pass encoding */
-    int mv_bits;
-    int header_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int i_count;
-    int p_count;
-    int skip_count;
-    int misc_bits;
-
-    /**
-     * number of bits used for the previously encoded frame
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int frame_bits;
-
-    /**
-     * Private data of the user, can be used to carry app specific stuff.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    void *opaque;
-
-    char codec_name[32];
-    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
-    enum CodecID codec_id; /* see CODEC_ID_xxx */
-
-    /**
-     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * A demuxer should set this to what is stored in the field used to identify the codec.
-     * If there are multiple such fields in a container then the demuxer should choose the one
-     * which maximizes the information about the used codec.
-     * If the codec tag field in a container is larger then 32 bits then the demuxer should
-     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
-     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
-     * first.
-     * - encoding: Set by user, if not then the default based on codec_id will be used.
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int codec_tag;
-
-    /**
-     * Work around bugs in encoders which sometimes cannot be detected automatically.
-     * - encoding: Set by user
-     * - decoding: Set by user
-     */
-    int workaround_bugs;
-#define FF_BUG_AUTODETECT       1  ///< autodetection
-#define FF_BUG_OLD_MSMPEG4      2
-#define FF_BUG_XVID_ILACE       4
-#define FF_BUG_UMP4             8
-#define FF_BUG_NO_PADDING       16
-#define FF_BUG_AMV              32
-#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
-#define FF_BUG_QPEL_CHROMA      64
-#define FF_BUG_STD_QPEL         128
-#define FF_BUG_QPEL_CHROMA2     256
-#define FF_BUG_DIRECT_BLOCKSIZE 512
-#define FF_BUG_EDGE             1024
-#define FF_BUG_HPEL_CHROMA      2048
-#define FF_BUG_DC_CLIP          4096
-#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
-#define FF_BUG_TRUNCATED       16384
-//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
-
-    /**
-     * luma single coefficient elimination threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int luma_elim_threshold;
-
-    /**
-     * chroma single coeff elimination threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chroma_elim_threshold;
-
-    /**
-     * strictly follow the standard (MPEG4, ...).
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     * Setting this to STRICT or higher means the encoder and decoder will
-     * generally do stupid things. While setting it to inofficial or lower
-     * will mean the encoder might use things that are not supported by all
-     * spec compliant decoders. Decoders make no difference between normal,
-     * inofficial and experimental, that is they always try to decode things
-     * when they can unless they are explicitly asked to behave stupid
-     * (=strictly conform to the specs)
-     */
-    int strict_std_compliance;
-#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to a older more strict version of the spec or reference software.
-#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
-#define FF_COMPLIANCE_NORMAL        0
-#define FF_COMPLIANCE_INOFFICIAL   -1 ///< Allow inofficial extensions.
-#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
-
-    /**
-     * qscale offset between IP and B-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_offset;
-
-    /**
-     * Error recognization; higher values will detect more errors but may
-     * misdetect some more or less valid parts as errors.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_recognition;
-#define FF_ER_CAREFUL         1
-#define FF_ER_COMPLIANT       2
-#define FF_ER_AGGRESSIVE      3
-#define FF_ER_VERY_AGGRESSIVE 4
-
-    /**
-     * Called at the beginning of each frame to get a buffer for it.
-     * If pic.reference is set then the frame will be read later by libavcodec.
-     * avcodec_align_dimensions2() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     * if CODEC_CAP_DR1 is not set then get_buffer() must call
-     * avcodec_default_get_buffer() instead of providing buffers allocated by
-     * some other means.
-     * - encoding: unused
-     * - decoding: Set by libavcodec., user can override.
-     */
-    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called to release buffers which were allocated with get_buffer.
-     * A released buffer can be reused in get_buffer().
-     * pic.data[*] must be set to NULL.
-     * - encoding: unused
-     * - decoding: Set by libavcodec., user can override.
-     */
-    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Size of the frame reordering buffer in the decoder.
-     * For MPEG-2 it is 1 IPB or 0 low delay IP.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int has_b_frames;
-
-    /**
-     * number of bytes per packet if constant and known or 0
-     * Used by some WAV based audio codecs.
-     */
-    int block_align;
-
-    int parse_only; /* - decoding only: If true, only parsing is done
-                       (function avcodec_parse_frame()). The frame
-                       data is returned. Only MPEG codecs support this now. */
-
-    /**
-     * 0-> h263 quant 1-> mpeg quant
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mpeg_quant;
-
-    /**
-     * pass1 encoding statistics output buffer
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    char *stats_out;
-
-    /**
-     * pass2 encoding statistics input buffer
-     * Concatenated stuff from stats_out of pass1 should be placed here.
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    char *stats_in;
-
-    /**
-     * ratecontrol qmin qmax limiting method
-     * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_qsquish;
-
-    float rc_qmod_amp;
-    int rc_qmod_freq;
-
-    /**
-     * ratecontrol override, see RcOverride
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    RcOverride *rc_override;
-    int rc_override_count;
-
-    /**
-     * rate control equation
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    const char *rc_eq;
-
-    /**
-     * maximum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_max_rate;
-
-    /**
-     * minimum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_min_rate;
-
-    /**
-     * decoder bitstream buffer size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_buffer_size;
-    float rc_buffer_aggressivity;
-
-    /**
-     * qscale factor between P and I-frames
-     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_factor;
-
-    /**
-     * qscale offset between P and I-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_offset;
-
-    /**
-     * initial complexity for pass1 ratecontrol
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_initial_cplx;
-
-    /**
-     * DCT algorithm, see FF_DCT_* below
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dct_algo;
-#define FF_DCT_AUTO    0
-#define FF_DCT_FASTINT 1
-#define FF_DCT_INT     2
-#define FF_DCT_MMX     3
-#define FF_DCT_MLIB    4
-#define FF_DCT_ALTIVEC 5
-#define FF_DCT_FAAN    6
-
-    /**
-     * luminance masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float lumi_masking;
-
-    /**
-     * temporary complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float temporal_cplx_masking;
-
-    /**
-     * spatial complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float spatial_cplx_masking;
-
-    /**
-     * p block masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float p_masking;
-
-    /**
-     * darkness masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float dark_masking;
-
-    /**
-     * IDCT algorithm, see FF_IDCT_* below.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int idct_algo;
-#define FF_IDCT_AUTO          0
-#define FF_IDCT_INT           1
-#define FF_IDCT_SIMPLE        2
-#define FF_IDCT_SIMPLEMMX     3
-#define FF_IDCT_LIBMPEG2MMX   4
-#define FF_IDCT_PS2           5
-#define FF_IDCT_MLIB          6
-#define FF_IDCT_ARM           7
-#define FF_IDCT_ALTIVEC       8
-#define FF_IDCT_SH4           9
-#define FF_IDCT_SIMPLEARM     10
-#define FF_IDCT_H264          11
-#define FF_IDCT_VP3           12
-#define FF_IDCT_IPP           13
-#define FF_IDCT_XVIDMMX       14
-#define FF_IDCT_CAVS          15
-#define FF_IDCT_SIMPLEARMV5TE 16
-#define FF_IDCT_SIMPLEARMV6   17
-#define FF_IDCT_SIMPLEVIS     18
-#define FF_IDCT_WMV2          19
-#define FF_IDCT_FAAN          20
-#define FF_IDCT_EA            21
-#define FF_IDCT_SIMPLENEON    22
-#define FF_IDCT_SIMPLEALPHA   23
-#define FF_IDCT_BINK          24
-
-    /**
-     * slice count
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user (or 0).
-     */
-    int slice_count;
-    /**
-     * slice offsets in the frame in bytes
-     * - encoding: Set/allocated by libavcodec.
-     * - decoding: Set/allocated by user (or NULL).
-     */
-    int *slice_offset;
-
-    /**
-     * error concealment flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_concealment;
-#define FF_EC_GUESS_MVS   1
-#define FF_EC_DEBLOCK     2
-
-    /**
-     * dsp_mask could be add used to disable unwanted CPU features
-     * CPU features (i.e. MMX, SSE. ...)
-     *
-     * With the FORCE flag you may instead enable given CPU features.
-     * (Dangerous: Usable in case of misdetection, improper usage however will
-     * result into program crash.)
-     */
-    unsigned dsp_mask;
-#define FF_MM_FORCE    0x80000000 /* Force usage of selected flags (OR) */
-    /* lower 16 bits - CPU features */
-#define FF_MM_MMX      0x0001 ///< standard MMX
-#define FF_MM_3DNOW    0x0004 ///< AMD 3DNOW
-#if LIBAVCODEC_VERSION_MAJOR < 53
-#define FF_MM_MMXEXT   0x0002 ///< SSE integer functions or AMD MMX ext
-#endif
-#define FF_MM_MMX2     0x0002 ///< SSE integer functions or AMD MMX ext
-#define FF_MM_SSE      0x0008 ///< SSE functions
-#define FF_MM_SSE2     0x0010 ///< PIV SSE2 functions
-#define FF_MM_3DNOWEXT 0x0020 ///< AMD 3DNowExt
-#define FF_MM_SSE3     0x0040 ///< Prescott SSE3 functions
-#define FF_MM_SSSE3    0x0080 ///< Conroe SSSE3 functions
-#define FF_MM_SSE4     0x0100 ///< Penryn SSE4.1 functions
-#define FF_MM_SSE42    0x0200 ///< Nehalem SSE4.2 functions
-#define FF_MM_IWMMXT   0x0100 ///< XScale IWMMXT
-#define FF_MM_ALTIVEC  0x0001 ///< standard AltiVec
-
-    /**
-     * bits per sample/pixel from the demuxer (needed for huffyuv).
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user.
-     */
-     int bits_per_coded_sample;
-
-    /**
-     * prediction method (needed for huffyuv)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int prediction_method;
-#define FF_PRED_LEFT   0
-#define FF_PRED_PLANE  1
-#define FF_PRED_MEDIAN 2
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * That is the width of a pixel divided by the height of the pixel.
-     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * the picture in the bitstream
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    AVFrame *coded_frame;
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug;
-#define FF_DEBUG_PICT_INFO   1
-#define FF_DEBUG_RC          2
-#define FF_DEBUG_BITSTREAM   4
-#define FF_DEBUG_MB_TYPE     8
-#define FF_DEBUG_QP          16
-#define FF_DEBUG_MV          32
-#define FF_DEBUG_DCT_COEFF   0x00000040
-#define FF_DEBUG_SKIP        0x00000080
-#define FF_DEBUG_STARTCODE   0x00000100
-#define FF_DEBUG_PTS         0x00000200
-#define FF_DEBUG_ER          0x00000400
-#define FF_DEBUG_MMCO        0x00000800
-#define FF_DEBUG_BUGS        0x00001000
-#define FF_DEBUG_VIS_QP      0x00002000
-#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-#define FF_DEBUG_BUFFERS     0x00008000
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-
-    /**
-     * error
-     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
-     * - decoding: unused
-     */
-    uint64_t error[4];
-
-    /**
-     * minimum MB quantizer
-     * - encoding: unused
-     * - decoding: unused
-     */
-    int mb_qmin;
-
-    /**
-     * maximum MB quantizer
-     * - encoding: unused
-     * - decoding: unused
-     */
-    int mb_qmax;
-
-    /**
-     * motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_cmp;
-    /**
-     * subpixel motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_sub_cmp;
-    /**
-     * macroblock comparison function (not supported yet)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_cmp;
-    /**
-     * interlaced DCT comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int ildct_cmp;
-#define FF_CMP_SAD    0
-#define FF_CMP_SSE    1
-#define FF_CMP_SATD   2
-#define FF_CMP_DCT    3
-#define FF_CMP_PSNR   4
-#define FF_CMP_BIT    5
-#define FF_CMP_RD     6
-#define FF_CMP_ZERO   7
-#define FF_CMP_VSAD   8
-#define FF_CMP_VSSE   9
-#define FF_CMP_NSSE   10
-#define FF_CMP_W53    11
-#define FF_CMP_W97    12
-#define FF_CMP_DCTMAX 13
-#define FF_CMP_DCT264 14
-#define FF_CMP_CHROMA 256
-
-    /**
-     * ME diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dia_size;
-
-    /**
-     * amount of previous MV predictors (2a+1 x 2a+1 square)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int last_predictor_count;
-
-    /**
-     * prepass for motion estimation
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_me;
-
-    /**
-     * motion estimation prepass comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_pre_cmp;
-
-    /**
-     * ME prepass diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_dia_size;
-
-    /**
-     * subpel ME quality
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_subpel_quality;
-
-    /**
-     * callback to negotiate the pixelFormat
-     * @param fmt is the list of formats which are supported by the codec,
-     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
-     * The first is always the native one.
-     * @return the chosen format
-     * - encoding: unused
-     * - decoding: Set by user, if not set the native format will be chosen.
-     */
-    enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-    /**
-     * DTG active format information (additional aspect ratio
-     * information only used in DVB MPEG-2 transport streams)
-     * 0 if not set.
-     *
-     * - encoding: unused
-     * - decoding: Set by decoder.
-     */
-    int dtg_active_format;
-#define FF_DTG_AFD_SAME         8
-#define FF_DTG_AFD_4_3          9
-#define FF_DTG_AFD_16_9         10
-#define FF_DTG_AFD_14_9         11
-#define FF_DTG_AFD_4_3_SP_14_9  13
-#define FF_DTG_AFD_16_9_SP_14_9 14
-#define FF_DTG_AFD_SP_4_3       15
-
-    /**
-     * maximum motion estimation search range in subpel units
-     * If 0 then no limit.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_range;
-
-    /**
-     * intra quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_quant_bias;
-#define FF_DEFAULT_QUANT_BIAS 999999
-
-    /**
-     * inter quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_quant_bias;
-
-    /**
-     * color table ID
-     * - encoding: unused
-     * - decoding: Which clrtable should be used for 8bit RGB images.
-     *             Tables have to be stored somewhere. FIXME
-     */
-    int color_table_id;
-
-    /**
-     * internal_buffer count
-     * Don't touch, used by libavcodec default_get_buffer().
-     */
-    int internal_buffer_count;
-
-    /**
-     * internal_buffers
-     * Don't touch, used by libavcodec default_get_buffer().
-     */
-    void *internal_buffer;
-
-#define FF_LAMBDA_SHIFT 7
-#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
-#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
-#define FF_LAMBDA_MAX (256*128-1)
-
-#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
-    /**
-     * Global quality for codecs which cannot change it per frame.
-     * This should be proportional to MPEG-1/2/4 qscale.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int global_quality;
-
-#define FF_CODER_TYPE_VLC       0
-#define FF_CODER_TYPE_AC        1
-#define FF_CODER_TYPE_RAW       2
-#define FF_CODER_TYPE_RLE       3
-#define FF_CODER_TYPE_DEFLATE   4
-    /**
-     * coder type
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int coder_type;
-
-    /**
-     * context model
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int context_model;
-#if 0
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
-#endif
-
-    /**
-     * slice flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int slice_flags;
-#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
-#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
-
-    /**
-     * XVideo Motion Acceleration
-     * - encoding: forbidden
-     * - decoding: set by decoder
-     */
-    int xvmc_acceleration;
-
-    /**
-     * macroblock decision mode
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_decision;
-#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
-#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
-#define FF_MB_DECISION_RD     2        ///< rate distortion
-
-    /**
-     * custom intra quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *intra_matrix;
-
-    /**
-     * custom inter quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *inter_matrix;
-
-    /**
-     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * - encoding: unused
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int stream_codec_tag;
-
-    /**
-     * scene change detection threshold
-     * 0 is default, larger means fewer detected scene changes.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_threshold;
-
-    /**
-     * minimum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmin;
-
-    /**
-     * maximum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmax;
-
-    /**
-     * palette control structure
-     * - encoding: ??? (no palette-enabled encoder yet)
-     * - decoding: Set by user.
-     */
-    struct AVPaletteControl *palctrl;
-
-    /**
-     * noise reduction strength
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int noise_reduction;
-
-    /**
-     * Called at the beginning of a frame to get cr buffer for it.
-     * Buffer type (size, hints) must be the same. libavcodec won't check it.
-     * libavcodec will pass previous buffer in pic, function should return
-     * same buffer or new buffer with old frame "painted" into it.
-     * If pic.data[0] == NULL must behave like get_buffer().
-     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
-     * avcodec_default_reget_buffer() instead of providing buffers allocated by
-     * some other means.
-     * - encoding: unused
-     * - decoding: Set by libavcodec., user can override
-     */
-    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Number of bits which should be loaded into the rc buffer before decoding starts.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_initial_buffer_occupancy;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_threshold;
-
-    /**
-     * CODEC_FLAG2_*
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags2;
-
-    /**
-     * Simulates errors in the bitstream to test error concealment.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int error_rate;
-
-    /**
-     * MP3 antialias algorithm, see FF_AA_* below.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int antialias_algo;
-#define FF_AA_AUTO    0
-#define FF_AA_FASTINT 1 //not implemented yet
-#define FF_AA_INT     2
-#define FF_AA_FLOAT   3
-    /**
-     * quantizer noise shaping
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int quantizer_noise_shaping;
-
-    /**
-     * thread count
-     * is used to decide how many independent tasks should be passed to execute()
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_count;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * @param count the number of things to execute
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
-
-    /**
-     * thread opaque
-     * Can be used by execute() to store some per AVCodecContext stuff.
-     * - encoding: set by execute()
-     * - decoding: set by execute()
-     */
-    void *thread_opaque;
-
-    /**
-     * Motion estimation threshold below which no motion estimation is
-     * performed, but instead the user specified motion vectors are used.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int me_threshold;
-
-    /**
-     * Macroblock threshold below which the user specified macroblock types will be used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int mb_threshold;
-
-    /**
-     * precision of the intra DC coefficient - 8
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int intra_dc_precision;
-
-    /**
-     * noise vs. sse weight for the nsse comparsion function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int nsse_weight;
-
-    /**
-     * Number of macroblock rows at the top which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int skip_top;
-
-    /**
-     * Number of macroblock rows at the bottom which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int skip_bottom;
-
-    /**
-     * profile
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int profile;
-#define FF_PROFILE_UNKNOWN -99
-
-#define FF_PROFILE_AAC_MAIN 0
-#define FF_PROFILE_AAC_LOW  1
-#define FF_PROFILE_AAC_SSR  2
-#define FF_PROFILE_AAC_LTP  3
-
-#define FF_PROFILE_H264_BASELINE    66
-#define FF_PROFILE_H264_MAIN        77
-#define FF_PROFILE_H264_EXTENDED    88
-#define FF_PROFILE_H264_HIGH        100
-#define FF_PROFILE_H264_HIGH_10     110
-#define FF_PROFILE_H264_HIGH_422    122
-#define FF_PROFILE_H264_HIGH_444    244
-#define FF_PROFILE_H264_CAVLC_444   44
-
-    /**
-     * level
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int level;
-#define FF_LEVEL_UNKNOWN -99
-
-    /**
-     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int lowres;
-
-    /**
-     * Bitstream width / height, may be different from width/height if lowres
-     * or other things are used.
-     * - encoding: unused
-     * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
-     */
-    int coded_width, coded_height;
-
-    /**
-     * frame skip threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_threshold;
-
-    /**
-     * frame skip factor
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_factor;
-
-    /**
-     * frame skip exponent
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_exp;
-
-    /**
-     * frame skip comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_cmp;
-
-    /**
-     * Border processing masking, raises the quantizer for mbs on the borders
-     * of the picture.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float border_masking;
-
-    /**
-     * minimum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmin;
-
-    /**
-     * maximum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmax;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_penalty_compensation;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_loop_filter;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_idct;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_frame;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bidir_refine;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int brd_scale;
-
-    /**
-     * constant rate factor - quality-based VBR - values ~correspond to qps
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float crf;
-
-    /**
-     * constant quantization parameter rate control method
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cqp;
-
-    /**
-     * minimum GOP size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int keyint_min;
-
-    /**
-     * number of reference frames
-     * - encoding: Set by user.
-     * - decoding: Set by lavc.
-     */
-    int refs;
-
-    /**
-     * chroma qp offset from luma
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chromaoffset;
-
-    /**
-     * Influences how often B-frames are used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bframebias;
-
-    /**
-     * trellis RD quantization
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int trellis;
-
-    /**
-     * Reduce fluctuations in qp (before curve compression).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float complexityblur;
-
-    /**
-     * in-loop deblocking filter alphac0 parameter
-     * alpha is in the range -6...6
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int deblockalpha;
-
-    /**
-     * in-loop deblocking filter beta parameter
-     * beta is in the range -6...6
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int deblockbeta;
-
-    /**
-     * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int partitions;
-#define X264_PART_I4X4 0x001  /* Analyze i4x4 */
-#define X264_PART_I8X8 0x002  /* Analyze i8x8 (requires 8x8 transform) */
-#define X264_PART_P8X8 0x010  /* Analyze p16x8, p8x16 and p8x8 */
-#define X264_PART_P4X4 0x020  /* Analyze p8x4, p4x8, p4x4 */
-#define X264_PART_B8X8 0x100  /* Analyze b16x8, b8x16 and b8x8 */
-
-    /**
-     * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int directpred;
-
-    /**
-     * Audio cutoff bandwidth (0 means "automatic")
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cutoff;
-
-    /**
-     * Multiplied by qscale for each frame and added to scene_change_score.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_factor;
-
-    /**
-     *
-     * Note: Value depends upon the compare function used for fullpel ME.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mv0_threshold;
-
-    /**
-     * Adjusts sensitivity of b_frame_strategy 1.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int b_sensitivity;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int compression_level;
-#define FF_COMPRESSION_DEFAULT -1
-
-    /**
-     * Sets whether to use LPC mode - used by FLAC encoder.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int use_lpc;
-
-    /**
-     * LPC coefficient precision - used by FLAC encoder
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lpc_coeff_precision;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_prediction_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_prediction_order;
-
-    /**
-     * search method for selecting prediction order
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int prediction_order_method;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_partition_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_partition_order;
-
-    /**
-     * GOP timecode frame start number, in non drop frame format
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int64_t timecode_frame_start;
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-    /**
-     * Decoder should decode to this many channels if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @deprecated Deprecated in favor of request_channel_layout.
-     */
-    int request_channels;
-#endif
-
-    /**
-     * Percentage of dynamic range compression to be applied by the decoder.
-     * The default value is 1.0, corresponding to full compression.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    float drc_scale;
-
-    /**
-     * opaque 64bit number (generally a PTS) that will be reordered and
-     * output in AVFrame.reordered_opaque
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int64_t reordered_opaque;
-
-    /**
-     * Bits per sample/pixel of internal libavcodec pixel/sample format.
-     * This field is applicable only when sample_fmt is SAMPLE_FMT_S32.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    int bits_per_raw_sample;
-
-    /**
-     * Audio channel layout.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    int64_t channel_layout;
-
-    /**
-     * Request decoder to use this channel layout if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int64_t request_channel_layout;
-
-    /**
-     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_max_available_vbv_use;
-
-    /**
-     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_min_vbv_overflow_use;
-
-    /**
-     * Hardware accelerator in use
-     * - encoding: unused.
-     * - decoding: Set by libavcodec
-     */
-    struct AVHWAccel *hwaccel;
-
-    /**
-     * For some codecs, the time base is closer to the field rate than the frame rate.
-     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
-     * if no telecine is used ...
-     *
-     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
-     */
-    int ticks_per_frame;
-
-    /**
-     * Hardware accelerator context.
-     * For some hardware accelerators, a global context needs to be
-     * provided by the user. In that case, this holds display-dependent
-     * data FFmpeg cannot instantiate itself. Please refer to the
-     * FFmpeg HW accelerator documentation to know how to fill this
-     * is. e.g. for VA API, this is a struct vaapi_context.
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *hwaccel_context;
-
-    /**
-     * Chromaticity coordinates of the source primaries.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorPrimaries color_primaries;
-
-    /**
-     * Color Transfer Characteristic.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorTransferCharacteristic color_trc;
-
-    /**
-     * YUV colorspace type.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorSpace colorspace;
-
-    /**
-     * MPEG vs JPEG YUV range.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorRange color_range;
-
-    /**
-     * This defines the location of chroma samples.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVChromaLocation chroma_sample_location;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
-     * @param c context passed also to func
-     * @param count the number of things to execute
-     * @param arg2 argument passed unchanged to func
-     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
-     * @param func function that will be called count times, with jobnr from 0 to count-1.
-     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
-     *             two instances of func executing at the same time will have the same threadnr.
-     * @return always 0 currently, but code should handle a future improvement where when any call to func
-     *         returns < 0 no further calls to func may be done and < 0 is returned.
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
-
-    /**
-     * explicit P-frame weighted prediction analysis method
-     * 0: off
-     * 1: fast blind weighting (one reference duplicate with -1 offset)
-     * 2: smart weighting (full fade detection analysis)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int weighted_p_pred;
-
-    /**
-     * AQ mode
-     * 0: Disabled
-     * 1: Variance AQ (complexity mask)
-     * 2: Auto-variance AQ (experimental)
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int aq_mode;
-
-    /**
-     * AQ strength
-     * Reduces blocking and blurring in flat and textured areas.
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    float aq_strength;
-
-    /**
-     * PSY RD
-     * Strength of psychovisual optimization
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    float psy_rd;
-
-    /**
-     * PSY trellis
-     * Strength of psychovisual optimization
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    float psy_trellis;
-
-    /**
-     * RC lookahead
-     * Number of frames for frametype and ratecontrol lookahead
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int rc_lookahead;
-} AVCodecContext;
-
-/**
- * AVCodec.
- */
-typedef struct AVCodec {
-    /**
-     * Name of the codec implementation.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     * This is the primary way to find a codec from the user perspective.
-     */
-    const char *name;
-    enum AVMediaType type;
-    enum CodecID id;
-    int priv_data_size;
-    int (*init)(AVCodecContext *);
-    int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
-    int (*close)(AVCodecContext *);
-    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
-    /**
-     * Codec capabilities.
-     * see CODEC_CAP_*
-     */
-    int capabilities;
-    struct AVCodec *next;
-    /**
-     * Flush buffers.
-     * Will be called when seeking
-     */
-    void (*flush)(AVCodecContext *);
-    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
-    const enum PixelFormat *pix_fmts;       ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
-    /**
-     * Descriptive name for the codec, meant to be more human readable than name.
-     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *long_name;
-    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
-    const enum SampleFormat *sample_fmts;   ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
-    const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
-} AVCodec;
-
-/**
- * AVHWAccel.
- */
-typedef struct AVHWAccel {
-    /**
-     * Name of the hardware accelerated codec.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     */
-    const char *name;
-
-    /**
-     * Type of codec implemented by the hardware accelerator.
-     *
-     * See AVMEDIA_TYPE_xxx
-     */
-    enum AVMediaType type;
-
-    /**
-     * Codec implemented by the hardware accelerator.
-     *
-     * See CODEC_ID_xxx
-     */
-    enum CodecID id;
-
-    /**
-     * Supported pixel format.
-     *
-     * Only hardware accelerated formats are supported here.
-     */
-    enum PixelFormat pix_fmt;
-
-    /**
-     * Hardware accelerated codec capabilities.
-     * see FF_HWACCEL_CODEC_CAP_*
-     */
-    int capabilities;
-
-    struct AVHWAccel *next;
-
-    /**
-     * Called at the beginning of each frame or field picture.
-     *
-     * Meaningful frame information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * Note that buf can be NULL along with buf_size set to 0.
-     * Otherwise, this means the whole frame is available at this point.
-     *
-     * @param avctx the codec context
-     * @param buf the frame data buffer base
-     * @param buf_size the size of the frame in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Callback for each slice.
-     *
-     * Meaningful slice information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @param buf the slice data buffer base
-     * @param buf_size the size of the slice in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Called at the end of each frame or field picture.
-     *
-     * The whole picture is parsed at this point and can now be sent
-     * to the hardware accelerator. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*end_frame)(AVCodecContext *avctx);
-
-    /**
-     * Size of HW accelerator private data.
-     *
-     * Private data is allocated with av_mallocz() before
-     * AVCodecContext.get_buffer() and deallocated after
-     * AVCodecContext.release_buffer().
-     */
-    int priv_data_size;
-} AVHWAccel;
-
-/**
- * four components are given, that's all.
- * the last component is alpha
- */
-typedef struct AVPicture {
-    uint8_t *data[4];
-    int linesize[4];       ///< number of bytes per line
-} AVPicture;
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * AVPaletteControl
- * This structure defines a method for communicating palette changes
- * between and demuxer and a decoder.
- *
- * @deprecated Use AVPacket to send palette changes instead.
- * This is totally broken.
- */
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
-typedef struct AVPaletteControl {
-
-    /* Demuxer sets this to 1 to indicate the palette has changed;
-     * decoder resets to 0. */
-    int palette_changed;
-
-    /* 4-byte ARGB palette entries, stored in native byte order; note that
-     * the individual palette components should be on a 8-bit scale; if
-     * the palette data comes from an IBM VGA native format, the component
-     * data is probably 6 bits in size and needs to be scaled. */
-    unsigned int palette[AVPALETTE_COUNT];
-
-} AVPaletteControl attribute_deprecated;
-#endif
-
-enum AVSubtitleType {
-    SUBTITLE_NONE,
-
-    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
-
-    /**
-     * Plain text, the text field must be set by the decoder and is
-     * authoritative. ass and pict fields may contain approximations.
-     */
-    SUBTITLE_TEXT,
-
-    /**
-     * Formatted text, the ass field must be set by the decoder and is
-     * authoritative. pict and text fields may contain approximations.
-     */
-    SUBTITLE_ASS,
-};
-
-typedef struct AVSubtitleRect {
-    int x;         ///< top left corner  of pict, undefined when pict is not set
-    int y;         ///< top left corner  of pict, undefined when pict is not set
-    int w;         ///< width            of pict, undefined when pict is not set
-    int h;         ///< height           of pict, undefined when pict is not set
-    int nb_colors; ///< number of colors in pict, undefined when pict is not set
-
-    /**
-     * data+linesize for the bitmap of this subtitle.
-     * can be set for text/ass as well once they where rendered
-     */
-    AVPicture pict;
-    enum AVSubtitleType type;
-
-    char *text;                     ///< 0 terminated plain UTF-8 text
-
-    /**
-     * 0 terminated ASS/SSA compatible event line.
-     * The pressentation of this is unaffected by the other values in this
-     * struct.
-     */
-    char *ass;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
-    uint16_t format; /* 0 = graphics */
-    uint32_t start_display_time; /* relative to packet pts, in ms */
-    uint32_t end_display_time; /* relative to packet pts, in ms */
-    unsigned num_rects;
-    AVSubtitleRect **rects;
-    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
-} AVSubtitle;
-
-/* packet functions */
-
-/**
- * @deprecated use NULL instead
- */
-attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
-
-/**
- * Default packet destructor.
- */
-void av_destruct_packet(AVPacket *pkt);
-
-/**
- * Initialize optional fields of a packet with default values.
- *
- * @param pkt packet
- */
-void av_init_packet(AVPacket *pkt);
-
-/**
- * Allocate the payload of a packet and initialize its fields with
- * default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_new_packet(AVPacket *pkt, int size);
-
-/**
- * Reduce packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param size new size
- */
-void av_shrink_packet(AVPacket *pkt, int size);
-
-/**
- * @warning This is a hack - the packet memory allocation stuff is broken. The
- * packet is allocated if it was not really allocated.
- */
-int av_dup_packet(AVPacket *pkt);
-
-/**
- * Free a packet.
- *
- * @param pkt packet to free
- */
-void av_free_packet(AVPacket *pkt);
-
-/* resample.c */
-
-struct ReSampleContext;
-struct AVResampleContext;
-
-typedef struct ReSampleContext ReSampleContext;
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * @deprecated Use av_audio_resample_init() instead.
- */
-attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
-                                                          int output_rate, int input_rate);
-#endif
-/**
- *  Initializes audio resampling context
- *
- * @param output_channels  number of output channels
- * @param input_channels   number of input channels
- * @param output_rate      output sample rate
- * @param input_rate       input sample rate
- * @param sample_fmt_out   requested output sample format
- * @param sample_fmt_in    input sample format
- * @param filter_length    length of each FIR filter in the filterbank relative to the cutoff freq
- * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
- * @param linear           If 1 then the used FIR filter will be linearly interpolated
-                           between the 2 closest, if 0 the closest will be used
- * @param cutoff           cutoff frequency, 1.0 corresponds to half the output sampling rate
- * @return allocated ReSampleContext, NULL if error occured
- */
-ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
-                                        int output_rate, int input_rate,
-                                        enum SampleFormat sample_fmt_out,
-                                        enum SampleFormat sample_fmt_in,
-                                        int filter_length, int log2_phase_count,
-                                        int linear, double cutoff);
-
-int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
-void audio_resample_close(ReSampleContext *s);
-
-
-/**
- * Initializes an audio resampler.
- * Note, if either rate is not an integer then simply scale both rates up so they are.
- * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
- * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
- * @param linear If 1 then the used FIR filter will be linearly interpolated
-                 between the 2 closest, if 0 the closest will be used
- * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
- */
-struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
-
-/**
- * resamples.
- * @param src an array of unconsumed samples
- * @param consumed the number of samples of src which have been consumed are returned here
- * @param src_size the number of unconsumed samples available
- * @param dst_size the amount of space in samples available in dst
- * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
- * @return the number of samples written in dst or -1 if an error occurred
- */
-int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
-
-
-/**
- * Compensates samplerate/timestamp drift. The compensation is done by changing
- * the resampler parameters, so no audible clicks or similar distortions occur
- * @param compensation_distance distance in output samples over which the compensation should be performed
- * @param sample_delta number of output samples which should be output less
- *
- * example: av_resample_compensate(c, 10, 500)
- * here instead of 510 samples only 500 samples would be output
- *
- * note, due to rounding the actual compensation might be slightly different,
- * especially if the compensation_distance is large and the in_rate used during init is small
- */
-void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
-void av_resample_close(struct AVResampleContext *c);
-
-/**
- * Allocate memory for a picture.  Call avpicture_free to free it.
- *
- * @param picture the picture to be filled in
- * @param pix_fmt the format of the picture
- * @param width the width of the picture
- * @param height the height of the picture
- * @return zero if successful, a negative value if not
- */
-int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
-
-/**
- * Free a picture previously allocated by avpicture_alloc().
- *
- * @param picture the AVPicture to be freed
- */
-void avpicture_free(AVPicture *picture);
-
-/**
- * Fill in the AVPicture fields.
- * The fields of the given AVPicture are filled in by using the 'ptr' address
- * which points to the image data buffer. Depending on the specified picture
- * format, one or multiple image data pointers and line sizes will be set.
- * If a planar format is specified, several pointers will be set pointing to
- * the different picture planes and the line sizes of the different planes
- * will be stored in the lines_sizes array.
- * Call with ptr == NULL to get the required size for the ptr buffer.
- *
- * @param picture AVPicture whose fields are to be filled in
- * @param ptr Buffer which will contain or contains the actual image data
- * @param pix_fmt The format in which the picture data is stored.
- * @param width the width of the image in pixels
- * @param height the height of the image in pixels
- * @return size of the image data in bytes
- */
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
-                   enum PixelFormat pix_fmt, int width, int height);
-int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
-                     unsigned char *dest, int dest_size);
-
-/**
- * Calculate the size in bytes that a picture of the given width and height
- * would occupy if stored in the given picture format.
- * Note that this returns the size of a compact representation as generated
- * by avpicture_layout, which can be smaller than the size required for e.g.
- * avpicture_fill.
- *
- * @param pix_fmt the given picture format
- * @param width the width of the image
- * @param height the height of the image
- * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
- */
-int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
-void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
-const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * Returns the pixel format corresponding to the name name.
- *
- * If there is no pixel format with name name, then looks for a
- * pixel format with the name corresponding to the native endian
- * format of name.
- * For example in a little-endian system, first looks for "gray16",
- * then for "gray16le".
- *
- * Finally if no pixel format has been found, returns PIX_FMT_NONE.
- *
- * @deprecated Deprecated in favor of av_get_pix_fmt().
- */
-attribute_deprecated enum PixelFormat avcodec_get_pix_fmt(const char* name);
-#endif
-
-/**
- * Returns a value representing the fourCC code associated to the
- * pixel format pix_fmt, or 0 if no associated fourCC code can be
- * found.
- */
-unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
-
-#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
-#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
-#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
-#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
-#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
-#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
-
-/**
- * Computes what kind of losses will occur when converting from one specific
- * pixel format to another.
- * When converting from one pixel format to another, information loss may occur.
- * For example, when converting from RGB24 to GRAY, the color information will
- * be lost. Similarly, other losses occur when converting from some formats to
- * other formats. These losses can involve loss of chroma, but also loss of
- * resolution, loss of color depth, loss due to the color space conversion, loss
- * of the alpha bits or loss due to color quantization.
- * avcodec_get_fix_fmt_loss() informs you about the various types of losses
- * which will occur when converting from one pixel format to another.
- *
- * @param[in] dst_pix_fmt destination pixel format
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @return Combination of flags informing you what kind of losses will occur.
- */
-int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
-                             int has_alpha);
-
-/**
- * Finds the best pixel format to convert to given a certain source pixel
- * format.  When converting from one pixel format to another, information loss
- * may occur.  For example, when converting from RGB24 to GRAY, the color
- * information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
- * the given pixel formats should be used to suffer the least amount of loss.
- * The pixel formats from which it chooses one, are determined by the
- * pix_fmt_mask parameter.
- *
- * @code
- * src_pix_fmt = PIX_FMT_YUV420P;
- * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);
- * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
- * @endcode
- *
- * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
- * @return The best pixel format to convert to or -1 if none was found.
- */
-enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
-                              int has_alpha, int *loss_ptr);
-
-
-/**
- * Print in buf the string corresponding to the pixel format with
- * number pix_fmt, or an header if pix_fmt is negative.
- *
- * @param[in] buf the buffer where to write the string
- * @param[in] buf_size the size of buf
- * @param[in] pix_fmt the number of the pixel format to print the corresponding info string, or
- * a negative value to print the corresponding header.
- * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
- */
-void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
-
-#define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */
-#define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */
-
-/**
- * Tell if an image really has transparent alpha values.
- * @return ored mask of FF_ALPHA_xxx constants
- */
-int img_get_alpha_info(const AVPicture *src,
-                       enum PixelFormat pix_fmt, int width, int height);
-
-/* deinterlace a picture */
-/* deinterlace - if not supported return -1 */
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
-                          enum PixelFormat pix_fmt, int width, int height);
-
-/* external high level API */
-
-/**
- * If c is NULL, returns the first registered codec,
- * if c is non-NULL, returns the next registered codec after c,
- * or NULL if c is the last one.
- */
-AVCodec *av_codec_next(AVCodec *c);
-
-/**
- * Returns the LIBAVCODEC_VERSION_INT constant.
- */
-unsigned avcodec_version(void);
-
-/**
- * Returns the libavcodec build-time configuration.
- */
-const char *avcodec_configuration(void);
-
-/**
- * Returns the libavcodec license.
- */
-const char *avcodec_license(void);
-
-/**
- * Initializes libavcodec.
- *
- * @warning This function must be called before any other libavcodec
- * function.
- */
-void avcodec_init(void);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * @deprecated Deprecated in favor of avcodec_register().
- */
-attribute_deprecated void register_avcodec(AVCodec *codec);
-#endif
-
-/**
- * Register the codec codec and initialize libavcodec.
- *
- * @see avcodec_init()
- */
-void avcodec_register(AVCodec *codec);
-
-/**
- * Finds a registered encoder with a matching codec ID.
- *
- * @param id CodecID of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder(enum CodecID id);
-
-/**
- * Finds a registered encoder with the specified name.
- *
- * @param name name of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder_by_name(const char *name);
-
-/**
- * Finds a registered decoder with a matching codec ID.
- *
- * @param id CodecID of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder(enum CodecID id);
-
-/**
- * Finds a registered decoder with the specified name.
- *
- * @param name name of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder_by_name(const char *name);
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
-
-/**
- * Sets the fields of the given AVCodecContext to default values.
- *
- * @param s The AVCodecContext of which the fields should be set to default values.
- */
-void avcodec_get_context_defaults(AVCodecContext *s);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
-
-/**
- * Allocates an AVCodecContext and sets its fields to default values.  The
- * resulting struct can be deallocated by simply calling av_free().
- *
- * @return An AVCodecContext filled with default values or NULL on failure.
- * @see avcodec_get_context_defaults
- */
-AVCodecContext *avcodec_alloc_context(void);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
-
-/**
- * Copy the settings of the source AVCodecContext into the destination
- * AVCodecContext. The resulting destination codec context will be
- * unopened, i.e. you are required to call avcodec_open() before you
- * can use this AVCodecContext to decode/encode video/audio data.
- *
- * @param dest target codec context, should be initialized with
- *             avcodec_alloc_context(), but otherwise uninitialized
- * @param src source codec context
- * @return AVERROR() on error (e.g. memory allocation error), 0 on success
- */
-int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
-
-/**
- * Sets the fields of the given AVFrame to default values.
- *
- * @param pic The AVFrame of which the fields should be set to default values.
- */
-void avcodec_get_frame_defaults(AVFrame *pic);
-
-/**
- * Allocates an AVFrame and sets its fields to default values.  The resulting
- * struct can be deallocated by simply calling av_free().
- *
- * @return An AVFrame filled with default values or NULL on failure.
- * @see avcodec_get_frame_defaults
- */
-AVFrame *avcodec_alloc_frame(void);
-
-int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-
-/**
- * Returns the amount of padding in pixels which the get_buffer callback must
- * provide around the edge of the image for codecs which do not have the
- * CODEC_FLAG_EMU_EDGE flag.
- *
- * @return Required padding in pixels.
- */
-unsigned avcodec_get_edge_width(void);
-/**
- * Modifies width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you do not use any horizontal
- * padding.
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
- */
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
-/**
- * Modifies width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you also ensure that all
- * line sizes are a multiple of the respective linesize_align[i].
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
- */
-void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
-                               int linesize_align[4]);
-
-/**
- * Checks if the given dimension of a picture is valid, meaning that all
- * bytes of the picture can be addressed with a signed int.
- *
- * @param[in] w Width of the picture.
- * @param[in] h Height of the picture.
- * @return Zero if valid, a negative value if invalid.
- */
-int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
-enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-int avcodec_thread_init(AVCodecContext *s, int thread_count);
-void avcodec_thread_free(AVCodecContext *s);
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
-int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
-//FIXME func typedef
-
-/**
- * Initializes the AVCodecContext to use the given AVCodec. Prior to using this
- * function the context has to be allocated.
- *
- * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
- * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
- * retrieving a codec.
- *
- * @warning This function is not thread safe!
- *
- * @code
- * avcodec_register_all();
- * codec = avcodec_find_decoder(CODEC_ID_H264);
- * if (!codec)
- *     exit(1);
- *
- * context = avcodec_alloc_context();
- *
- * if (avcodec_open(context, codec) < 0)
- *     exit(1);
- * @endcode
- *
- * @param avctx The context which will be set up to use the given codec.
- * @param codec The codec to use within the context.
- * @return zero on success, a negative value on error
- * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder
- */
-int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * Decodes an audio frame from buf into samples.
- * Wrapper function which calls avcodec_decode_audio3.
- *
- * @deprecated Use avcodec_decode_audio3 instead.
- * @param avctx the codec context
- * @param[out] samples the output buffer
- * @param[in,out] frame_size_ptr the output buffer size in bytes
- * @param[in] buf the input buffer
- * @param[in] buf_size the input buffer size in bytes
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
-                         int *frame_size_ptr,
-                         const uint8_t *buf, int buf_size);
-#endif
-
-/**
- * Decodes the audio frame of size avpkt->size from avpkt->data into samples.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame. In this case,
- * avcodec_decode_audio3 has to be called again with an AVPacket that contains
- * the remaining data in order to decode the second frame etc.
- * If no frame
- * could be outputted, frame_size_ptr is zero. Otherwise, it is the
- * decompressed frame size in bytes.
- *
- * @warning You must set frame_size_ptr to the allocated size of the
- * output buffer before calling avcodec_decode_audio3().
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer avpkt->data and output buffer
- * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum and
- * samples should be 16 byte aligned unless the CPU doesn't need it
- * (AltiVec and SSE do).
- *
- * @param avctx the codec context
- * @param[out] samples the output buffer, sample type in avctx->sample_fmt
- * @param[in,out] frame_size_ptr the output buffer size in bytes
- * @param[in] avpkt The input AVPacket containing the input buffer.
- *            You can create such packet with av_init_packet() and by then setting
- *            data and size, some decoders might in addition need other fields.
- *            All decoders are designed to use the least fields possible though.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame data was decompressed (used) from the input AVPacket.
- */
-int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
-                         int *frame_size_ptr,
-                         AVPacket *avpkt);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * Decodes a video frame from buf into picture.
- * Wrapper function which calls avcodec_decode_video2.
- *
- * @deprecated Use avcodec_decode_video2 instead.
- * @param avctx the codec context
- * @param[out] picture The AVFrame in which the decoded video frame will be stored.
- * @param[in] buf the input buffer
- * @param[in] buf_size the size of the input buffer in bytes
- * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_picture_ptr,
-                         const uint8_t *buf, int buf_size);
-#endif
-
-/**
- * Decodes the video frame of size avpkt->size from avpkt->data into picture.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame.
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer buf should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer avpkt->data.
- * The alignment requirements depend on the CPU: on some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum.
- *
- * @note Some codecs have a delay between input and output, these need to be
- * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
- *
- * @param avctx the codec context
- * @param[out] picture The AVFrame in which the decoded video frame will be stored.
- *             Use avcodec_alloc_frame to get an AVFrame, the codec will
- *             allocate memory for the actual bitmap.
- * @param[in] avpkt The input AVpacket containing the input buffer.
- *            You can create such packet with av_init_packet() and by then setting
- *            data and size, some decoders might in addition need other fields like
- *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
- *            fields possible.
- * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_picture_ptr,
-                         AVPacket *avpkt);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/* Decode a subtitle message. Return -1 if error, otherwise return the
- * number of bytes used. If no subtitle could be decompressed,
- * got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
-attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
-                            int *got_sub_ptr,
-                            const uint8_t *buf, int buf_size);
-#endif
-
-/**
- * Decodes a subtitle message.
- * Returns a negative value on error, otherwise returns the number of bytes used.
- * If no subtitle could be decompressed, got_sub_ptr is zero.
- * Otherwise, the subtitle is stored in *sub.
- *
- * @param avctx the codec context
- * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored.
- * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
- * @param[in] avpkt The input AVPacket containing the input buffer.
- */
-int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
-                            int *got_sub_ptr,
-                            AVPacket *avpkt);
-int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
-                        int *data_size_ptr,
-                        uint8_t *buf, int buf_size);
-
-/**
- * Encodes an audio frame from samples into buf.
- *
- * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
- * However, for PCM audio the user will know how much space is needed
- * because it depends on the value passed in buf_size as described
- * below. In that case a lower value can be used.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer
- * @param[in] buf_size the output buffer size
- * @param[in] samples the input buffer containing the samples
- * The number of samples read from this buffer is frame_size*channels,
- * both of which are defined in avctx.
- * For PCM audio the number of samples read from samples is equal to
- * buf_size * input_sample_size / output_sample_size.
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used to encode the data read from the input buffer.
- */
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                         const short *samples);
-
-/**
- * Encodes a video frame from pict into buf.
- * The input picture should be
- * stored using a specific format, namely avctx.pix_fmt.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer for the bitstream of encoded frame
- * @param[in] buf_size the size of the output buffer in bytes
- * @param[in] pict the input picture to encode
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used from the output buffer.
- */
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                         const AVFrame *pict);
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                            const AVSubtitle *sub);
-
-int avcodec_close(AVCodecContext *avctx);
-
-/**
- * Register all the codecs, parsers and bitstream filters which were enabled at
- * configuration time. If you do not call this function you can select exactly
- * which formats you want to support, by using the individual registration
- * functions.
- *
- * @see avcodec_register
- * @see av_register_codec_parser
- * @see av_register_bitstream_filter
- */
-void avcodec_register_all(void);
-
-/**
- * Flush buffers, should be called when seeking or when switching to a different stream.
- */
-void avcodec_flush_buffers(AVCodecContext *avctx);
-
-void avcodec_default_free_buffers(AVCodecContext *s);
-
-/* misc useful functions */
-
-/**
- * Returns a single letter to describe the given picture type pict_type.
- *
- * @param[in] pict_type the picture type
- * @return A single character representing the picture type.
- */
-char av_get_pict_type_char(int pict_type);
-
-/**
- * Returns codec bits per sample.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_bits_per_sample(enum CodecID codec_id);
-
-/**
- * Returns sample format bits per sample.
- *
- * @param[in] sample_fmt the sample format
- * @return Number of bits per sample or zero if unknown for the given sample format.
- */
-int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
-
-/* frame parsing */
-typedef struct AVCodecParserContext {
-    void *priv_data;
-    struct AVCodecParser *parser;
-    int64_t frame_offset; /* offset of the current frame */
-    int64_t cur_offset; /* current offset
-                           (incremented by each av_parser_parse()) */
-    int64_t next_frame_offset; /* offset of the next frame */
-    /* video info */
-    int pict_type; /* XXX: Put it back in AVCodecContext. */
-    /**
-     * This field is used for proper frame duration computation in lavf.
-     * It signals, how much longer the frame duration of the current frame
-     * is compared to normal frame duration.
-     *
-     * frame_duration = (1 + repeat_pict) * time_base
-     *
-     * It is used by codecs like H.264 to display telecined material.
-     */
-    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
-    int64_t pts;     /* pts of the current frame */
-    int64_t dts;     /* dts of the current frame */
-
-    /* private data */
-    int64_t last_pts;
-    int64_t last_dts;
-    int fetch_timestamp;
-
-#define AV_PARSER_PTS_NB 4
-    int cur_frame_start_index;
-    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
-    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
-    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
-    int flags;
-#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
-
-    int64_t offset;      ///< byte offset from starting packet start
-    int64_t cur_frame_end[AV_PARSER_PTS_NB];
-
-    /*!
-     * Set by parser to 1 for key frames and 0 for non-key frames.
-     * It is initialized to -1, so if the parser doesn't set this flag,
-     * old-style fallback using FF_I_TYPE picture type as key frames
-     * will be used.
-     */
-    int key_frame;
-
-    /**
-     * Time difference in stream time base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current frame.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-
-    // Timestamp generation support:
-    /**
-     * Synchronization point for start of timestamp generation.
-     *
-     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
-     * (default).
-     *
-     * For example, this corresponds to presence of H.264 buffering period
-     * SEI message.
-     */
-    int dts_sync_point;
-
-    /**
-     * Offset of the current timestamp against last timestamp sync point in
-     * units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain a valid timestamp offset.
-     *
-     * Note that the timestamp of sync point has usually a nonzero
-     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
-     * the next frame after timestamp sync point will be usually 1.
-     *
-     * For example, this corresponds to H.264 cpb_removal_delay.
-     */
-    int dts_ref_dts_delta;
-
-    /**
-     * Presentation delay of current frame in units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain valid non-negative timestamp delta (presentation time of a frame
-     * must not lie in the past).
-     *
-     * This delay represents the difference between decoding and presentation
-     * time of the frame.
-     *
-     * For example, this corresponds to H.264 dpb_output_delay.
-     */
-    int pts_dts_delta;
-
-    /**
-     * Position of the packet in file.
-     *
-     * Analogous to cur_frame_pts/dts
-     */
-    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
-
-    /**
-     * Byte position of currently parsed frame in stream.
-     */
-    int64_t pos;
-
-    /**
-     * Previous frame byte position.
-     */
-    int64_t last_pos;
-} AVCodecParserContext;
-
-typedef struct AVCodecParser {
-    int codec_ids[5]; /* several codec IDs are permitted */
-    int priv_data_size;
-    int (*parser_init)(AVCodecParserContext *s);
-    int (*parser_parse)(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size);
-    void (*parser_close)(AVCodecParserContext *s);
-    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-    struct AVCodecParser *next;
-} AVCodecParser;
-
-AVCodecParser *av_parser_next(AVCodecParser *c);
-
-void av_register_codec_parser(AVCodecParser *parser);
-AVCodecParserContext *av_parser_init(int codec_id);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-attribute_deprecated
-int av_parser_parse(AVCodecParserContext *s,
-                    AVCodecContext *avctx,
-                    uint8_t **poutbuf, int *poutbuf_size,
-                    const uint8_t *buf, int buf_size,
-                    int64_t pts, int64_t dts);
-#endif
-
-/**
- * Parse a packet.
- *
- * @param s             parser context.
- * @param avctx         codec context.
- * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
- * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
- * @param buf           input buffer.
- * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
- * @param pts           input presentation timestamp.
- * @param dts           input decoding timestamp.
- * @param pos           input byte position in stream.
- * @return the number of bytes of the input bitstream used.
- *
- * Example:
- * @code
- *   while(in_len){
- *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
- *                                        in_data, in_len,
- *                                        pts, dts, pos);
- *       in_data += len;
- *       in_len  -= len;
- *
- *       if(size)
- *          decode_frame(data, size);
- *   }
- * @endcode
- */
-int av_parser_parse2(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size,
-                     int64_t pts, int64_t dts,
-                     int64_t pos);
-
-int av_parser_change(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe);
-void av_parser_close(AVCodecParserContext *s);
-
-
-typedef struct AVBitStreamFilterContext {
-    void *priv_data;
-    struct AVBitStreamFilter *filter;
-    AVCodecParserContext *parser;
-    struct AVBitStreamFilterContext *next;
-} AVBitStreamFilterContext;
-
-
-typedef struct AVBitStreamFilter {
-    const char *name;
-    int priv_data_size;
-    int (*filter)(AVBitStreamFilterContext *bsfc,
-                  AVCodecContext *avctx, const char *args,
-                  uint8_t **poutbuf, int *poutbuf_size,
-                  const uint8_t *buf, int buf_size, int keyframe);
-    void (*close)(AVBitStreamFilterContext *bsfc);
-    struct AVBitStreamFilter *next;
-} AVBitStreamFilter;
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-                               AVCodecContext *avctx, const char *args,
-                               uint8_t **poutbuf, int *poutbuf_size,
-                               const uint8_t *buf, int buf_size, int keyframe);
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-
-AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
-
-/* memory */
-
-/**
- * Reallocates the given block if it is not large enough, otherwise it
- * does nothing.
- *
- * @see av_realloc
- */
-void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
-
-/**
- * Allocates a buffer, reusing the given one if large enough.
- *
- * Contrary to av_fast_realloc the current buffer contents might not be
- * preserved and on error the old buffer is freed, thus no special
- * handling to avoid memleaks is necessary.
- *
- * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
- * @param size size of the buffer *ptr points to
- * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
- *                 *size 0 if an error occurred.
- */
-void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size);
-
-/**
- * Copy image 'src' to 'dst'.
- */
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
-                     enum PixelFormat pix_fmt, int width, int height);
-
-/**
- * Crop image top and left side.
- */
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
-                    enum PixelFormat pix_fmt, int top_band, int left_band);
-
-/**
- * Pad image.
- */
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
-            int padtop, int padbottom, int padleft, int padright, int *color);
-
-/**
- * Encodes extradata length to a buffer. Used by xiph codecs.
- *
- * @param s buffer to write to; must be at least (v/255+1) bytes long
- * @param v size of extradata in bytes
- * @return number of bytes written to the buffer.
- */
-unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-/**
- * Parses str and put in width_ptr and height_ptr the detected values.
- *
- * @return 0 in case of a successful parsing, a negative value otherwise
- * @param[in] str the string to parse: it has to be a string in the format
- * <width>x<height> or a valid video frame size abbreviation.
- * @param[in,out] width_ptr pointer to the variable which will contain the detected
- * frame width value
- * @param[in,out] height_ptr pointer to the variable which will contain the detected
- * frame height value
- */
-int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
-
-/**
- * Parses str and put in frame_rate the detected values.
- *
- * @return 0 in case of a successful parsing, a negative value otherwise
- * @param[in] str the string to parse: it has to be a string in the format
- * <frame_rate_num>/<frame_rate_den>, a float number or a valid video rate abbreviation
- * @param[in,out] frame_rate pointer to the AVRational which will contain the detected
- * frame rate
- */
-int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
-
-/**
- * Logs a generic warning message about a missing feature. This function is
- * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] feature string containing the name of the missing feature
- * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
- * If want_sample is non-zero, additional verbage will be added to the log
- * message which tells the user how to report samples to the development
- * mailing list.
- */
-void av_log_missing_feature(void *avc, const char *feature, int want_sample);
-
-/**
- * Logs a generic warning message asking for a sample. This function is
- * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] msg string containing an optional message, or NULL if no message
- */
-void av_log_ask_for_sample(void *avc, const char *msg);
-
-/**
- * Registers the hardware accelerator hwaccel.
- */
-void av_register_hwaccel(AVHWAccel *hwaccel);
-
-/**
- * If hwaccel is NULL, returns the first registered hardware accelerator,
- * if hwaccel is non-NULL, returns the next registered hardware accelerator
- * after hwaccel, or NULL if hwaccel is the last one.
- */
-AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
-
-
-/**
- * Lock operation used by lockmgr
- */
-enum AVLockOp {
-  AV_LOCK_CREATE,  ///< Create a mutex
-  AV_LOCK_OBTAIN,  ///< Lock the mutex
-  AV_LOCK_RELEASE, ///< Unlock the mutex
-  AV_LOCK_DESTROY, ///< Free mutex resources
-};
-
-/**
- * Register a user provided lock manager supporting the operations
- * specified by AVLockOp. mutex points to a (void *) where the
- * lockmgr should store/get a pointer to a user allocated mutex. It's
- * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
- *
- * @param cb User defined callback. Note: FFmpeg may invoke calls to this
- *           callback during the call to av_lockmgr_register().
- *           Thus, the application must be prepared to handle that.
- *           If cb is set to NULL the lockmgr will be unregistered.
- *           Also note that during unregistration the previously registered
- *           lockmgr callback may also be invoked.
- */
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
-
-#endif /* AVCODEC_AVCODEC_H */
diff --git a/ffmpeg 0.6/include/libavcodec/avfft.h b/ffmpeg 0.6/include/libavcodec/avfft.h
deleted file mode 100644 (file)
index 623f0a3..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVFFT_H
-#define AVCODEC_AVFFT_H
-
-typedef float FFTSample;
-
-typedef struct FFTComplex {
-    FFTSample re, im;
-} FFTComplex;
-
-typedef struct FFTContext FFTContext;
-
-/**
- * Set up a complex FFT.
- * @param nbits           log2 of the length of the input array
- * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
- */
-FFTContext *av_fft_init(int nbits, int inverse);
-
-/**
- * Do the permutation needed BEFORE calling ff_fft_calc().
- */
-void av_fft_permute(FFTContext *s, FFTComplex *z);
-
-/**
- * Do a complex FFT with the parameters defined in av_fft_init(). The
- * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
- */
-void av_fft_calc(FFTContext *s, FFTComplex *z);
-
-void av_fft_end(FFTContext *s);
-
-FFTContext *av_mdct_init(int nbits, int inverse, double scale);
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_end(FFTContext *s);
-
-/* Real Discrete Fourier Transform */
-
-enum RDFTransformType {
-    DFT_R2C,
-    IDFT_C2R,
-    IDFT_R2C,
-    DFT_C2R,
-};
-
-typedef struct RDFTContext RDFTContext;
-
-/**
- * Set up a real FFT.
- * @param nbits           log2 of the length of the input array
- * @param trans           the type of transform
- */
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
-void av_rdft_calc(RDFTContext *s, FFTSample *data);
-void av_rdft_end(RDFTContext *s);
-
-/* Discrete Cosine Transform */
-
-typedef struct DCTContext DCTContext;
-
-enum DCTTransformType {
-    DCT_II = 0,
-    DCT_III,
-    DCT_I,
-    DST_I,
-};
-
-/**
- * Sets up DCT.
- * @param nbits           size of the input array:
- *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
- *                        (1 << nbits) + 1 for DCT-I
- *
- * @note the first element of the input of DST-I is ignored
- */
-DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
-void av_dct_calc(DCTContext *s, FFTSample *data);
-void av_dct_end (DCTContext *s);
-
-#endif /* AVCODEC_AVFFT_H */
diff --git a/ffmpeg 0.6/include/libavcodec/dxva2.h b/ffmpeg 0.6/include/libavcodec/dxva2.h
deleted file mode 100644 (file)
index 5c5fe21..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DXVA2 HW acceleration
- *
- * copyright (c) 2009 Laurent Aimar
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DXVA_H
-#define AVCODEC_DXVA_H
-
-#include <stdint.h>
-
-#include <dxva2api.h>
-
-/**
- * This structure is used to provides the necessary configurations and data
- * to the DXVA2 FFmpeg HWAccel implementation.
- *
- * The application must make it available as AVCodecContext.hwaccel_context.
- */
-struct dxva_context {
-    /**
-     * DXVA2 decoder object
-     */
-    IDirectXVideoDecoder *decoder;
-
-    /**
-     * DXVA2 configuration used to create the decoder
-     */
-    const DXVA2_ConfigPictureDecode *cfg;
-
-    /**
-     * The number of surface in the surface array
-     */
-    unsigned surface_count;
-
-    /**
-     * The array of Direct3D surfaces used to create the decoder
-     */
-    LPDIRECT3DSURFACE9 *surface;
-
-    /**
-     * A bit field configuring the workarounds needed for using the decoder
-     */
-    uint64_t workaround;
-
-    /**
-     * Private to the FFmpeg AVHWAccel implementation
-     */
-    unsigned report_id;
-};
-
-#endif /* AVCODEC_DXVA_H */
diff --git a/ffmpeg 0.6/include/libavcodec/opt.h b/ffmpeg 0.6/include/libavcodec/opt.h
deleted file mode 100644 (file)
index 55ca4ea..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * AVOptions
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_OPT_H
-#define AVCODEC_OPT_H
-
-/**
- * @file
- * AVOptions
- */
-
-#include "libavutil/rational.h"
-#include "avcodec.h"
-
-enum AVOptionType{
-    FF_OPT_TYPE_FLAGS,
-    FF_OPT_TYPE_INT,
-    FF_OPT_TYPE_INT64,
-    FF_OPT_TYPE_DOUBLE,
-    FF_OPT_TYPE_FLOAT,
-    FF_OPT_TYPE_STRING,
-    FF_OPT_TYPE_RATIONAL,
-    FF_OPT_TYPE_BINARY,  ///< offset must point to a pointer immediately followed by an int for the length
-    FF_OPT_TYPE_CONST=128,
-};
-
-/**
- * AVOption
- */
-typedef struct AVOption {
-    const char *name;
-
-    /**
-     * short English help text
-     * @todo What about other languages?
-     */
-    const char *help;
-
-    /**
-     * The offset relative to the context structure where the option
-     * value is stored. It should be 0 for named constants.
-     */
-    int offset;
-    enum AVOptionType type;
-
-    /**
-     * the default value for scalar options
-     */
-    double default_val;
-    double min;                 ///< minimum valid value for the option
-    double max;                 ///< maximum valid value for the option
-
-    int flags;
-#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM     8
-#define AV_OPT_FLAG_VIDEO_PARAM     16
-#define AV_OPT_FLAG_SUBTITLE_PARAM  32
-//FIXME think about enc-audio, ... style flags
-
-    /**
-     * The logical unit to which the option belongs. Non-constant
-     * options and corresponding named constants share the same
-     * unit. May be NULL.
-     */
-    const char *unit;
-} AVOption;
-
-/**
- * AVOption2.
- * THIS IS NOT PART OF THE API/ABI YET!
- * This is identical to AVOption except that default_val was replaced by
- * an union, it should be compatible with AVOption on normal platforms.
- */
-typedef struct AVOption2 {
-    const char *name;
-
-    /**
-     * short English help text
-     * @todo What about other languages?
-     */
-    const char *help;
-
-    /**
-     * The offset relative to the context structure where the option
-     * value is stored. It should be 0 for named constants.
-     */
-    int offset;
-    enum AVOptionType type;
-
-    /**
-     * the default value for scalar options
-     */
-    union {
-        double dbl;
-        const char *str;
-    } default_val;
-
-    double min;                 ///< minimum valid value for the option
-    double max;                 ///< maximum valid value for the option
-
-    int flags;
-/*
-#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM     8
-#define AV_OPT_FLAG_VIDEO_PARAM     16
-#define AV_OPT_FLAG_SUBTITLE_PARAM  32
-*/
-//FIXME think about enc-audio, ... style flags
-
-    /**
-     * The logical unit to which the option belongs. Non-constant
-     * options and corresponding named constants share the same
-     * unit. May be NULL.
-     */
-    const char *unit;
-} AVOption2;
-
-
-/**
- * Looks for an option in obj. Looks only for the options which
- * have the flags set as specified in mask and flags (that is,
- * for which it is the case that opt->flags & mask == flags).
- *
- * @param[in] obj a pointer to a struct whose first element is a
- * pointer to an AVClass
- * @param[in] name the name of the option to look for
- * @param[in] unit the unit of the option to look for, or any if NULL
- * @return a pointer to the option found, or NULL if no option
- * has been found
- */
-const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * @see av_set_string2()
- */
-attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
-
-/**
- * @return a pointer to the AVOption corresponding to the field set or
- * NULL if no matching AVOption exists, or if the value val is not
- * valid
- * @see av_set_string3()
- */
-attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
-#endif
-
-/**
- * Sets the field of obj with the given name to value.
- *
- * @param[in] obj A struct whose first element is a pointer to an
- * AVClass.
- * @param[in] name the name of the field to set
- * @param[in] val The value to set. If the field is not of a string
- * type, then the given string is parsed.
- * SI postfixes and some named scalars are supported.
- * If the field is of a numeric type, it has to be a numeric or named
- * scalar. Behavior with more than one scalar and +- infix operators
- * is undefined.
- * If the field is of a flags type, it has to be a sequence of numeric
- * scalars or named flags separated by '+' or '-'. Prefixing a flag
- * with '+' causes it to be set without affecting the other flags;
- * similarly, '-' unsets a flag.
- * @param[out] o_out if non-NULL put here a pointer to the AVOption
- * found
- * @param alloc when 1 then the old value will be av_freed() and the
- *                     new av_strduped()
- *              when 0 then no av_free() nor av_strdup() will be used
- * @return 0 if the value has been set, or an AVERROR code in case of
- * error:
- * AVERROR(ENOENT) if no matching option exists
- * AVERROR(ERANGE) if the value is out of range
- * AVERROR(EINVAL) if the value is not valid
- */
-int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
-
-const AVOption *av_set_double(void *obj, const char *name, double n);
-const AVOption *av_set_q(void *obj, const char *name, AVRational n);
-const AVOption *av_set_int(void *obj, const char *name, int64_t n);
-double av_get_double(void *obj, const char *name, const AVOption **o_out);
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
-const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
-const AVOption *av_next_option(void *obj, const AVOption *last);
-int av_opt_show(void *obj, void *av_log_obj);
-void av_opt_set_defaults(void *s);
-void av_opt_set_defaults2(void *s, int mask, int flags);
-
-#endif /* AVCODEC_OPT_H */
diff --git a/ffmpeg 0.6/include/libavcodec/vaapi.h b/ffmpeg 0.6/include/libavcodec/vaapi.h
deleted file mode 100644 (file)
index 07568a4..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Video Acceleration API (shared data between FFmpeg and the video player)
- * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VAAPI_H
-#define AVCODEC_VAAPI_H
-
-#include <stdint.h>
-
-/**
- * \defgroup VAAPI_Decoding VA API Decoding
- * \ingroup Decoder
- * @{
- */
-
-/**
- * This structure is used to share data between the FFmpeg library and
- * the client video application.
- * This shall be zero-allocated and available as
- * AVCodecContext.hwaccel_context. All user members can be set once
- * during initialization or through each AVCodecContext.get_buffer()
- * function call. In any case, they must be valid prior to calling
- * decoding functions.
- */
-struct vaapi_context {
-    /**
-     * Window system dependent data
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *display;
-
-    /**
-     * Configuration ID
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    uint32_t config_id;
-
-    /**
-     * Context ID (video decode pipeline)
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    uint32_t context_id;
-
-    /**
-     * VAPictureParameterBuffer ID
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t pic_param_buf_id;
-
-    /**
-     * VAIQMatrixBuffer ID
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t iq_matrix_buf_id;
-
-    /**
-     * VABitPlaneBuffer ID (for VC-1 decoding)
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t bitplane_buf_id;
-
-    /**
-     * Slice parameter/data buffer IDs
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t *slice_buf_ids;
-
-    /**
-     * Number of effective slice buffer IDs to send to the HW
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int n_slice_buf_ids;
-
-    /**
-     * Size of pre-allocated slice_buf_ids
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_buf_ids_alloc;
-
-    /**
-     * Pointer to VASliceParameterBuffers
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    void *slice_params;
-
-    /**
-     * Size of a VASliceParameterBuffer element
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_param_size;
-
-    /**
-     * Size of pre-allocated slice_params
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_params_alloc;
-
-    /**
-     * Number of slices currently filled in
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_count;
-
-    /**
-     * Pointer to slice data buffer base
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    const uint8_t *slice_data;
-
-    /**
-     * Current size of slice data
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t slice_data_size;
-};
-
-/* @} */
-
-#endif /* AVCODEC_VAAPI_H */
diff --git a/ffmpeg 0.6/include/libavcodec/vdpau.h b/ffmpeg 0.6/include/libavcodec/vdpau.h
deleted file mode 100644 (file)
index a8fa4d3..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * The Video Decode and Presentation API for UNIX (VDPAU) is used for
- * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
- *
- * Copyright (C) 2008 NVIDIA
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VDPAU_H
-#define AVCODEC_VDPAU_H
-
-/**
- * \defgroup Decoder VDPAU Decoder and Renderer
- *
- * VDPAU hardware acceleration has two modules
- * - VDPAU decoding
- * - VDPAU presentation
- *
- * The VDPAU decoding module parses all headers using FFmpeg
- * parsing mechanisms and uses VDPAU for the actual decoding.
- *
- * As per the current implementation, the actual decoding
- * and rendering (API calls) are done as part of the VDPAU
- * presentation (vo_vdpau.c) module.
- *
- * @{
- * \defgroup  VDPAU_Decoding VDPAU Decoding
- * \ingroup Decoder
- * @{
- */
-
-#include <vdpau/vdpau.h>
-#include <vdpau/vdpau_x11.h>
-
-/** \brief The videoSurface is used for rendering. */
-#define FF_VDPAU_STATE_USED_FOR_RENDER 1
-
-/**
- * \brief The videoSurface is needed for reference/prediction.
- * The codec manipulates this.
- */
-#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
-
-/**
- * \brief This structure is used as a callback between the FFmpeg
- * decoder (vd_) and presentation (vo_) module.
- * This is used for defining a video frame containing surface,
- * picture parameter, bitstream information etc which are passed
- * between the FFmpeg decoder and its clients.
- */
-struct vdpau_render_state {
-    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
-
-    int state; ///< Holds FF_VDPAU_STATE_* values.
-
-    /** picture parameter information for all supported codecs */
-    union VdpPictureInfo {
-        VdpPictureInfoH264        h264;
-        VdpPictureInfoMPEG1Or2    mpeg;
-        VdpPictureInfoVC1          vc1;
-        VdpPictureInfoMPEG4Part2 mpeg4;
-    } info;
-
-    /** Describe size/location of the compressed video data.
-        Set to 0 when freeing bitstream_buffers. */
-    int bitstream_buffers_allocated;
-    int bitstream_buffers_used;
-    /** The user is responsible for freeing this buffer using av_freep(). */
-    VdpBitstreamBuffer *bitstream_buffers;
-};
-
-/* @}*/
-
-#endif /* AVCODEC_VDPAU_H */
diff --git a/ffmpeg 0.6/include/libavcodec/xvmc.h b/ffmpeg 0.6/include/libavcodec/xvmc.h
deleted file mode 100644 (file)
index 01f84b2..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2003 Ivan Kalvachev
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XVMC_H
-#define AVCODEC_XVMC_H
-
-#include <X11/extensions/XvMC.h>
-
-#include "avcodec.h"
-
-#if LIBAVCODEC_VERSION_MAJOR < 53
-#define AV_XVMC_STATE_DISPLAY_PENDING          1  /**  the surface should be shown, the video driver manipulates this */
-#define AV_XVMC_STATE_PREDICTION               2  /**  the surface is needed for prediction, the codec manipulates this */
-#define AV_XVMC_STATE_OSD_SOURCE               4  /**  the surface is needed for subpicture rendering */
-#endif
-#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
-                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
-
-struct xvmc_pix_fmt {
-    /** The field contains the special constant value AV_XVMC_ID.
-        It is used as a test that the application correctly uses the API,
-        and that there is no corruption caused by pixel routines.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             xvmc_id;
-
-    /** Pointer to the block array allocated by XvMCCreateBlocks().
-        The array has to be freed by XvMCDestroyBlocks().
-        Each group of 64 values represents one data block of differential
-        pixel information (in MoCo mode) or coefficients for IDCT.
-        - application - set the pointer during initialization
-        - libavcodec  - fills coefficients/pixel data into the array
-    */
-    short*          data_blocks;
-
-    /** Pointer to the macroblock description array allocated by
-        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
-        - application - set the pointer during initialization
-        - libavcodec  - fills description data into the array
-    */
-    XvMCMacroBlock* mv_blocks;
-
-    /** Number of macroblock descriptions that can be stored in the mv_blocks
-        array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_mv_blocks;
-
-    /** Number of blocks that can be stored at once in the data_blocks array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_data_blocks;
-
-    /** Indicates that the hardware would interpret data_blocks as IDCT
-        coefficients and perform IDCT on them.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             idct;
-
-    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
-        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             unsigned_intra;
-
-    /** Pointer to the surface allocated by XvMCCreateSurface().
-        It has to be freed by XvMCDestroySurface() on application exit.
-        It identifies the frame and its state on the video hardware.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    XvMCSurface*    p_surface;
-
-/** Set by the decoder before calling ff_draw_horiz_band(),
-    needed by the XvMCRenderSurface function. */
-//@{
-    /** Pointer to the surface used as past reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_past_surface;
-
-    /** Pointer to the surface used as future reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_future_surface;
-
-    /** top/bottom field or frame
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    picture_structure;
-
-    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    flags;
-//}@
-
-    /** Number of macroblock descriptions in the mv_blocks array
-        that have already been passed to the hardware.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may increment it
-                        with filled_mb_block_num or zero both.
-        - libavcodec  - unchanged
-    */
-    int             start_mv_blocks_num;
-
-    /** Number of new macroblock descriptions in the mv_blocks array (after
-        start_mv_blocks_num) that are filled by libavcodec and have to be
-        passed to the hardware.
-        - application - zeroes it on get_buffer() or after successful
-                        ff_draw_horiz_band().
-        - libavcodec  - increment with one of each stored MB
-    */
-    int             filled_mv_blocks_num;
-
-    /** Number of the the next free data block; one data block consists of
-        64 short values in the data_blocks array.
-        All blocks before this one have already been claimed by placing their
-        position into the corresponding block description structure field,
-        that are part of the mv_blocks array.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may zero it together
-                        with start_mb_blocks_num.
-        - libavcodec  - each decoded macroblock increases it by the number
-                        of coded blocks it contains.
-    */
-    int             next_free_data_block_num;
-
-/** extensions may be placed here */
-#if LIBAVCODEC_VERSION_MAJOR < 53
-//@{
-    /** State flags used to work around limitations in the MPlayer video system.
-        0   - Surface is not used.
-        1   - Surface is still held in application to be displayed or is
-              still visible.
-        2   - Surface is still held in libavcodec buffer for prediction.
-    */
-    int             state;
-
-    /** pointer to the surface where the subpicture is rendered */
-    void*           p_osd_target_surface_render;
-//}@
-#endif
-};
-
-#endif /* AVCODEC_XVMC_H */
diff --git a/ffmpeg 0.6/include/libavdevice/avdevice.h b/ffmpeg 0.6/include/libavdevice/avdevice.h
deleted file mode 100644 (file)
index dcd835c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_AVDEVICE_H
-#define AVDEVICE_AVDEVICE_H
-
-#include "libavutil/avutil.h"
-
-#define LIBAVDEVICE_VERSION_MAJOR 52
-#define LIBAVDEVICE_VERSION_MINOR  2
-#define LIBAVDEVICE_VERSION_MICRO  0
-
-#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
-                                               LIBAVDEVICE_VERSION_MINOR, \
-                                               LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_VERSION     AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
-                                           LIBAVDEVICE_VERSION_MINOR, \
-                                           LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_BUILD       LIBAVDEVICE_VERSION_INT
-
-/**
- * Returns the LIBAVDEVICE_VERSION_INT constant.
- */
-unsigned avdevice_version(void);
-
-/**
- * Returns the libavdevice build-time configuration.
- */
-const char *avdevice_configuration(void);
-
-/**
- * Returns the libavdevice license.
- */
-const char *avdevice_license(void);
-
-/**
- * Initialize libavdevice and register all the input and output devices.
- * @warning This function is not thread safe.
- */
-void avdevice_register_all(void);
-
-#endif /* AVDEVICE_AVDEVICE_H */
-
diff --git a/ffmpeg 0.6/include/libavformat/avformat.h b/ffmpeg 0.6/include/libavformat/avformat.h
deleted file mode 100644 (file)
index 0e93376..0000000
+++ /dev/null
@@ -1,1355 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVFORMAT_H
-#define AVFORMAT_AVFORMAT_H
-
-#define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 64
-#define LIBAVFORMAT_VERSION_MICRO  2
-
-#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-                                               LIBAVFORMAT_VERSION_MINOR, \
-                                               LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
-                                           LIBAVFORMAT_VERSION_MINOR,   \
-                                           LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
-
-#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
-
-/**
- * I return the LIBAVFORMAT_VERSION_INT constant.  You got
- * a fucking problem with that, douchebag?
- */
-unsigned avformat_version(void);
-
-/**
- * Returns the libavformat build-time configuration.
- */
-const char *avformat_configuration(void);
-
-/**
- * Returns the libavformat license.
- */
-const char *avformat_license(void);
-
-#include <time.h>
-#include <stdio.h>  /* FILE */
-#include "libavcodec/avcodec.h"
-
-#include "avio.h"
-
-struct AVFormatContext;
-
-
-/*
- * Public Metadata API.
- * The metadata API allows libavformat to export metadata tags to a client
- * application using a sequence of key/value pairs. Like all strings in FFmpeg,
- * metadata must be stored as UTF-8 encoded Unicode. Note that metadata
- * exported by demuxers isn't checked to be valid UTF-8 in most cases.
- * Important concepts to keep in mind:
- * 1. Keys are unique; there can never be 2 tags with the same key. This is
- *    also meant semantically, i.e., a demuxer should not knowingly produce
- *    several keys that are literally different but semantically identical.
- *    E.g., key=Author5, key=Author6. In this example, all authors must be
- *    placed in the same tag.
- * 2. Metadata is flat, not hierarchical; there are no subtags. If you
- *    want to store, e.g., the email address of the child of producer Alice
- *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
- * 3. Several modifiers can be applied to the tag name. This is done by
- *    appending a dash character ('-') and the modifier name in the order
- *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
- *    a) language -- a tag whose value is localized for a particular language
- *       is appended with the ISO 639-2/B 3-letter language code.
- *       For example: Author-ger=Michael, Author-eng=Mike
- *       The original/default language is in the unqualified "Author" tag.
- *       A demuxer should set a default if it sets any translated tag.
- *    b) sorting  -- a modified version of a tag that should be used for
- *       sorting will have '-sort' appended. E.g. artist="The Beatles",
- *       artist-sort="Beatles, The".
- *
- * 4. Tag names are normally exported exactly as stored in the container to
- *    allow lossless remuxing to the same format. For container-independent
- *    handling of metadata, av_metadata_conv() can convert it to ffmpeg generic
- *    format. Follows a list of generic tag names:
- *
- * album        -- name of the set this work belongs to
- * album_artist -- main creator of the set/album, if different from artist.
- *                 e.g. "Various Artists" for compilation albums.
- * artist       -- main creator of the work
- * comment      -- any additional description of the file.
- * composer     -- who composed the work, if different from artist.
- * copyright    -- name of copyright holder.
- * date         -- date when the work was created, preferably in ISO 8601.
- * disc         -- number of a subset, e.g. disc in a multi-disc collection.
- * encoder      -- name/settings of the software/hardware that produced the file.
- * encoded_by   -- person/group who created the file.
- * filename     -- original name of the file.
- * genre        -- <self-evident>.
- * language     -- main language in which the work is performed, preferably
- *                 in ISO 639-2 format.
- * performer    -- artist who performed the work, if different from artist.
- *                 E.g for "Also sprach Zarathustra", artist would be "Richard
- *                 Strauss" and performer "London Philharmonic Orchestra".
- * publisher    -- name of the label/publisher.
- * title        -- name of the work.
- * track        -- number of this work in the set, can be in form current/total.
- */
-
-#define AV_METADATA_MATCH_CASE      1
-#define AV_METADATA_IGNORE_SUFFIX   2
-#define AV_METADATA_DONT_STRDUP_KEY 4
-#define AV_METADATA_DONT_STRDUP_VAL 8
-#define AV_METADATA_DONT_OVERWRITE 16   ///< Don't overwrite existing tags.
-
-typedef struct {
-    char *key;
-    char *value;
-}AVMetadataTag;
-
-typedef struct AVMetadata AVMetadata;
-typedef struct AVMetadataConv AVMetadataConv;
-
-/**
- * Gets a metadata element with matching key.
- * @param prev Set to the previous matching element to find the next.
- *             If set to NULL the first matching element is returned.
- * @param flags Allows case as well as suffix-insensitive comparisons.
- * @return Found tag or NULL, changing key or value leads to undefined behavior.
- */
-AVMetadataTag *
-av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
-
-#if LIBAVFORMAT_VERSION_MAJOR == 52
-/**
- * Sets the given tag in m, overwriting an existing tag.
- * @param key tag key to add to m (will be av_strduped)
- * @param value tag value to add to m (will be av_strduped)
- * @return >= 0 on success otherwise an error code <0
- * @deprecated Use av_metadata_set2() instead.
- */
-attribute_deprecated int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
-#endif
-
-/**
- * Sets the given tag in m, overwriting an existing tag.
- * @param key tag key to add to m (will be av_strduped depending on flags)
- * @param value tag value to add to m (will be av_strduped depending on flags)
- * @return >= 0 on success otherwise an error code <0
- */
-int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags);
-
-/**
- * Converts all the metadata sets from ctx according to the source and
- * destination conversion tables. If one of the tables is NULL, then
- * tags are converted to/from ffmpeg generic tag names.
- * @param d_conv destination tags format conversion table
- * @param s_conv source tags format conversion table
- */
-void av_metadata_conv(struct AVFormatContext *ctx,const AVMetadataConv *d_conv,
-                                                  const AVMetadataConv *s_conv);
-
-/**
- * Frees all the memory allocated for an AVMetadata struct.
- */
-void av_metadata_free(AVMetadata **m);
-
-
-/* packet functions */
-
-
-/**
- * Allocates and reads the payload of a packet and initializes its
- * fields with default values.
- *
- * @param pkt packet
- * @param size desired payload size
- * @return >0 (read size) if OK, AVERROR_xxx otherwise
- */
-int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size);
-
-
-/*************************************************/
-/* fractional numbers for exact pts handling */
-
-/**
- * The exact value of the fractional number is: 'val + num / den'.
- * num is assumed to be 0 <= num < den.
- */
-typedef struct AVFrac {
-    int64_t val, num, den;
-} AVFrac;
-
-/*************************************************/
-/* input/output formats */
-
-struct AVCodecTag;
-
-/** This structure contains the data a format has to probe a file. */
-typedef struct AVProbeData {
-    const char *filename;
-    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
-    int buf_size;       /**< Size of buf except extra allocated bytes */
-} AVProbeData;
-
-#define AVPROBE_SCORE_MAX 100               ///< maximum score, half of that is used for file-extension-based detection
-#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
-
-typedef struct AVFormatParameters {
-    AVRational time_base;
-    int sample_rate;
-    int channels;
-    int width;
-    int height;
-    enum PixelFormat pix_fmt;
-    int channel; /**< Used to select DV channel. */
-    const char *standard; /**< TV standard, NTSC, PAL, SECAM */
-    unsigned int mpeg2ts_raw:1;  /**< Force raw MPEG-2 transport stream output, if possible. */
-    unsigned int mpeg2ts_compute_pcr:1; /**< Compute exact PCR for each transport
-                                            stream packet (only meaningful if
-                                            mpeg2ts_raw is TRUE). */
-    unsigned int initial_pause:1;       /**< Do not begin to play the stream
-                                            immediately (RTSP only). */
-    unsigned int prealloced_context:1;
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    enum CodecID video_codec_id;
-    enum CodecID audio_codec_id;
-#endif
-} AVFormatParameters;
-
-//! Demuxer will use url_fopen, no opened file should be provided by the caller.
-#define AVFMT_NOFILE        0x0001
-#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
-#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
-#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
-                                      raw picture data. */
-#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
-#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
-#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
-#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. */
-#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
-#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
-
-typedef struct AVOutputFormat {
-    const char *name;
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-    const char *mime_type;
-    const char *extensions; /**< comma-separated filename extensions */
-    /** size of private data so that it can be allocated in the wrapper */
-    int priv_data_size;
-    /* output support */
-    enum CodecID audio_codec; /**< default audio codec */
-    enum CodecID video_codec; /**< default video codec */
-    int (*write_header)(struct AVFormatContext *);
-    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
-    int (*write_trailer)(struct AVFormatContext *);
-    /** can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER */
-    int flags;
-    /** Currently only used to set pixel format if not YUV420P. */
-    int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *);
-    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
-                             AVPacket *in, int flush);
-
-    /**
-     * List of supported codec_id-codec_tag pairs, ordered by "better
-     * choice first". The arrays are all terminated by CODEC_ID_NONE.
-     */
-    const struct AVCodecTag * const *codec_tag;
-
-    enum CodecID subtitle_codec; /**< default subtitle codec */
-
-    const AVMetadataConv *metadata_conv;
-
-    /* private fields */
-    struct AVOutputFormat *next;
-} AVOutputFormat;
-
-typedef struct AVInputFormat {
-    const char *name;
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-    /** Size of private data so that it can be allocated in the wrapper. */
-    int priv_data_size;
-    /**
-     * Tell if a given file has a chance of being parsed as this format.
-     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
-     * big so you do not have to check for that unless you need more.
-     */
-    int (*read_probe)(AVProbeData *);
-    /** Read the format header and initialize the AVFormatContext
-       structure. Return 0 if OK. 'ap' if non-NULL contains
-       additional parameters. Only used in raw format right
-       now. 'av_new_stream' should be called to create new streams.  */
-    int (*read_header)(struct AVFormatContext *,
-                       AVFormatParameters *ap);
-    /** Read one packet and put it in 'pkt'. pts and flags are also
-       set. 'av_new_stream' can be called only if the flag
-       AVFMTCTX_NOHEADER is used.
-       @return 0 on success, < 0 on error.
-               When returning an error, pkt must not have been allocated
-               or must be freed before returning */
-    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
-    /** Close the stream. The AVFormatContext and AVStreams are not
-       freed by this function */
-    int (*read_close)(struct AVFormatContext *);
-
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-    /**
-     * Seek to a given timestamp relative to the frames in
-     * stream component stream_index.
-     * @param stream_index Must not be -1.
-     * @param flags Selects which direction should be preferred if no exact
-     *              match is available.
-     * @return >= 0 on success (but not necessarily the new offset)
-     */
-    int (*read_seek)(struct AVFormatContext *,
-                     int stream_index, int64_t timestamp, int flags);
-#endif
-    /**
-     * Gets the next timestamp in stream[stream_index].time_base units.
-     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
-     */
-    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
-                              int64_t *pos, int64_t pos_limit);
-    /** Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. */
-    int flags;
-    /** If extensions are defined, then no probe is done. You should
-       usually not use extension format guessing because it is not
-       reliable enough */
-    const char *extensions;
-    /** General purpose read-only value that the format can use. */
-    int value;
-
-    /** Starts/resumes playing - only meaningful if using a network-based format
-       (RTSP). */
-    int (*read_play)(struct AVFormatContext *);
-
-    /** Pauses playing - only meaningful if using a network-based format
-       (RTSP). */
-    int (*read_pause)(struct AVFormatContext *);
-
-    const struct AVCodecTag * const *codec_tag;
-
-    /**
-     * Seeks to timestamp ts.
-     * Seeking will be done so that the point from which all active streams
-     * can be presented successfully will be closest to ts and within min/max_ts.
-     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
-     */
-    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
-    const AVMetadataConv *metadata_conv;
-
-    /* private fields */
-    struct AVInputFormat *next;
-} AVInputFormat;
-
-enum AVStreamParseType {
-    AVSTREAM_PARSE_NONE,
-    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
-    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
-    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
-};
-
-typedef struct AVIndexEntry {
-    int64_t pos;
-    int64_t timestamp;
-#define AVINDEX_KEYFRAME 0x0001
-    int flags:2;
-    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
-    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
-} AVIndexEntry;
-
-#define AV_DISPOSITION_DEFAULT   0x0001
-#define AV_DISPOSITION_DUB       0x0002
-#define AV_DISPOSITION_ORIGINAL  0x0004
-#define AV_DISPOSITION_COMMENT   0x0008
-#define AV_DISPOSITION_LYRICS    0x0010
-#define AV_DISPOSITION_KARAOKE   0x0020
-
-/**
- * Stream structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVStream) must not be used outside libav*.
- */
-typedef struct AVStream {
-    int index;    /**< stream index in AVFormatContext */
-    int id;       /**< format-specific stream ID */
-    AVCodecContext *codec; /**< codec context */
-    /**
-     * Real base framerate of the stream.
-     * This is the lowest framerate with which all timestamps can be
-     * represented accurately (it is the least common multiple of all
-     * framerates in the stream). Note, this value is just a guess!
-     * For example, if the time base is 1/90000 and all frames have either
-     * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
-     */
-    AVRational r_frame_rate;
-    void *priv_data;
-
-    /* internal data used in av_find_stream_info() */
-    int64_t first_dts;
-    /** encoding: pts generation when outputting stream */
-    struct AVFrac pts;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * time base should be 1/framerate and timestamp increments should be 1.
-     */
-    AVRational time_base;
-    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-    /* ffmpeg.c private use */
-    int stream_copy; /**< If set, just copy stream. */
-    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
-    //FIXME move stuff to a flags field?
-    /** Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.
-     * MN: dunno if that is the right place for it */
-    float quality;
-    /**
-     * Decoding: pts of the first frame of the stream, in stream time base.
-     * Only set this if you are absolutely 100% sure that the value you set
-     * it to really is the pts of the first frame.
-     * This may be undefined (AV_NOPTS_VALUE).
-     * @note The ASF header does NOT contain a correct start_time the ASF
-     * demuxer must NOT set this.
-     */
-    int64_t start_time;
-    /**
-     * Decoding: duration of the stream, in stream time base.
-     * If a source file does not specify a duration, but does specify
-     * a bitrate, this value will be estimated from bitrate and file size.
-     */
-    int64_t duration;
-
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    char language[4]; /** ISO 639-2/B 3-letter language code (empty string if undefined) */
-#endif
-
-    /* av_read_frame() support */
-    enum AVStreamParseType need_parsing;
-    struct AVCodecParserContext *parser;
-
-    int64_t cur_dts;
-    int last_IP_duration;
-    int64_t last_IP_pts;
-    /* av_seek_frame() support */
-    AVIndexEntry *index_entries; /**< Only used if the format does not
-                                    support seeking natively. */
-    int nb_index_entries;
-    unsigned int index_entries_allocated_size;
-
-    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
-
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    int64_t unused[4+1];
-
-    char *filename; /**< source filename of the stream */
-#endif
-
-    int disposition; /**< AV_DISPOSITION_* bit field */
-
-    AVProbeData probe_data;
-#define MAX_REORDER_DELAY 16
-    int64_t pts_buffer[MAX_REORDER_DELAY+1];
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * - encoding: Set by user.
-     * - decoding: Set by libavformat.
-     */
-    AVRational sample_aspect_ratio;
-
-    AVMetadata *metadata;
-
-    /* av_read_frame() support */
-    const uint8_t *cur_ptr;
-    int cur_len;
-    AVPacket cur_pkt;
-
-    // Timestamp generation support:
-    /**
-     * Timestamp corresponding to the last dts sync point.
-     *
-     * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
-     * a DTS is received from the underlying container. Otherwise set to
-     * AV_NOPTS_VALUE by default.
-     */
-    int64_t reference_dts;
-
-    /**
-     * Number of packets to buffer for codec probing
-     * NOT PART OF PUBLIC API
-     */
-#define MAX_PROBE_PACKETS 2500
-    int probe_packets;
-
-    /**
-     * last packet in packet_buffer for this stream when muxing.
-     * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
-     */
-    struct AVPacketList *last_in_packet_buffer;
-
-    /**
-     * Average framerate
-     */
-    AVRational avg_frame_rate;
-
-    /**
-     * Number of frames that have been demuxed during av_find_stream_info()
-     */
-    int codec_info_nb_frames;
-} AVStream;
-
-#define AV_PROGRAM_RUNNING 1
-
-/**
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVProgram) must not be used outside libav*.
- */
-typedef struct AVProgram {
-    int            id;
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    char           *provider_name; ///< network name for DVB streams
-    char           *name;          ///< service name for DVB streams
-#endif
-    int            flags;
-    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
-    unsigned int   *stream_index;
-    unsigned int   nb_stream_indexes;
-    AVMetadata *metadata;
-} AVProgram;
-
-#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
-                                         (streams are added dynamically) */
-
-typedef struct AVChapter {
-    int id;                 ///< unique ID to identify the chapter
-    AVRational time_base;   ///< time base in which the start/end timestamps are specified
-    int64_t start, end;     ///< chapter start/end time in time_base units
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    char *title;            ///< chapter title
-#endif
-    AVMetadata *metadata;
-} AVChapter;
-
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-#define MAX_STREAMS 20
-#else
-#define MAX_STREAMS 100
-#endif
-
-/**
- * Format I/O context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVFormatContext) must not be used outside libav*.
- */
-typedef struct AVFormatContext {
-    const AVClass *av_class; /**< Set by avformat_alloc_context. */
-    /* Can only be iformat or oformat, not both at the same time. */
-    struct AVInputFormat *iformat;
-    struct AVOutputFormat *oformat;
-    void *priv_data;
-    ByteIOContext *pb;
-    unsigned int nb_streams;
-    AVStream *streams[MAX_STREAMS];
-    char filename[1024]; /**< input or output filename */
-    /* stream info */
-    int64_t timestamp;
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    char title[512];
-    char author[512];
-    char copyright[512];
-    char comment[512];
-    char album[512];
-    int year;  /**< ID3 year, 0 if none */
-    int track; /**< track number, 0 if none */
-    char genre[32]; /**< ID3 genre */
-#endif
-
-    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
-    /* private data for pts handling (do not modify directly). */
-    /** This buffer is only needed when packets were already buffered but
-       not decoded, for example to get the codec parameters in MPEG
-       streams. */
-    struct AVPacketList *packet_buffer;
-
-    /** Decoding: position of the first frame of the component, in
-       AV_TIME_BASE fractional seconds. NEVER set this value directly:
-       It is deduced from the AVStream values.  */
-    int64_t start_time;
-    /** Decoding: duration of the stream, in AV_TIME_BASE fractional
-       seconds. Only set this value if you know none of the individual stream
-       durations and also dont set any of them. This is deduced from the
-       AVStream values if not set.  */
-    int64_t duration;
-    /** decoding: total file size, 0 if unknown */
-    int64_t file_size;
-    /** Decoding: total stream bitrate in bit/s, 0 if not
-       available. Never set it directly if the file_size and the
-       duration are known as FFmpeg can compute it automatically. */
-    int bit_rate;
-
-    /* av_read_frame() support */
-    AVStream *cur_st;
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-    const uint8_t *cur_ptr_deprecated;
-    int cur_len_deprecated;
-    AVPacket cur_pkt_deprecated;
-#endif
-
-    /* av_seek_frame() support */
-    int64_t data_offset; /** offset of the first packet */
-    int index_built;
-
-    int mux_rate;
-    unsigned int packet_size;
-    int preload;
-    int max_delay;
-
-#define AVFMT_NOOUTPUTLOOP -1
-#define AVFMT_INFINITEOUTPUTLOOP 0
-    /** number of times to loop output in formats that support it */
-    int loop_output;
-
-    int flags;
-#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
-#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
-#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
-#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
-#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
-#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
-#define AVFMT_FLAG_RTP_HINT     0x0040 ///< Add RTP hinting to the output file
-
-    int loop_input;
-    /** decoding: size of data to probe; encoding: unused. */
-    unsigned int probesize;
-
-    /**
-     * Maximum time (in AV_TIME_BASE units) during which the input should
-     * be analyzed in av_find_stream_info().
-     */
-    int max_analyze_duration;
-
-    const uint8_t *key;
-    int keylen;
-
-    unsigned int nb_programs;
-    AVProgram **programs;
-
-    /**
-     * Forced video codec_id.
-     * Demuxing: Set by user.
-     */
-    enum CodecID video_codec_id;
-    /**
-     * Forced audio codec_id.
-     * Demuxing: Set by user.
-     */
-    enum CodecID audio_codec_id;
-    /**
-     * Forced subtitle codec_id.
-     * Demuxing: Set by user.
-     */
-    enum CodecID subtitle_codec_id;
-
-    /**
-     * Maximum amount of memory in bytes to use for the index of each stream.
-     * If the index exceeds this size, entries will be discarded as
-     * needed to maintain a smaller size. This can lead to slower or less
-     * accurate seeking (depends on demuxer).
-     * Demuxers for which a full in-memory index is mandatory will ignore
-     * this.
-     * muxing  : unused
-     * demuxing: set by user
-     */
-    unsigned int max_index_size;
-
-    /**
-     * Maximum amount of memory in bytes to use for buffering frames
-     * obtained from realtime capture devices.
-     */
-    unsigned int max_picture_buffer;
-
-    unsigned int nb_chapters;
-    AVChapter **chapters;
-
-    /**
-     * Flags to enable debugging.
-     */
-    int debug;
-#define FF_FDEBUG_TS        0x0001
-
-    /**
-     * Raw packets from the demuxer, prior to parsing and decoding.
-     * This buffer is used for buffering packets until the codec can
-     * be identified, as parsing cannot be done without knowing the
-     * codec.
-     */
-    struct AVPacketList *raw_packet_buffer;
-    struct AVPacketList *raw_packet_buffer_end;
-
-    struct AVPacketList *packet_buffer_end;
-
-    AVMetadata *metadata;
-
-    /**
-     * Remaining size available for raw_packet_buffer, in bytes.
-     * NOT PART OF PUBLIC API
-     */
-#define RAW_PACKET_BUFFER_SIZE 2500000
-    int raw_packet_buffer_remaining_size;
-
-    /**
-     * Start time of the stream in real world time, in microseconds
-     * since the unix epoch (00:00 1st January 1970). That is, pts=0
-     * in the stream was captured at this real world time.
-     * - encoding: Set by user.
-     * - decoding: Unused.
-     */
-    int64_t start_time_realtime;
-} AVFormatContext;
-
-typedef struct AVPacketList {
-    AVPacket pkt;
-    struct AVPacketList *next;
-} AVPacketList;
-
-#if LIBAVFORMAT_VERSION_INT < (53<<16)
-extern AVInputFormat *first_iformat;
-extern AVOutputFormat *first_oformat;
-#endif
-
-/**
- * If f is NULL, returns the first registered input format,
- * if f is non-NULL, returns the next registered input format after f
- * or NULL if f is the last one.
- */
-AVInputFormat  *av_iformat_next(AVInputFormat  *f);
-
-/**
- * If f is NULL, returns the first registered output format,
- * if f is non-NULL, returns the next registered output format after f
- * or NULL if f is the last one.
- */
-AVOutputFormat *av_oformat_next(AVOutputFormat *f);
-
-enum CodecID av_guess_image2_codec(const char *filename);
-
-/* XXX: Use automatic init with either ELF sections or C file parser */
-/* modules. */
-
-/* utils.c */
-void av_register_input_format(AVInputFormat *format);
-void av_register_output_format(AVOutputFormat *format);
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name,
-                                    const char *filename,
-                                    const char *mime_type);
-
-/**
- * @deprecated Use av_guess_format() instead.
- */
-attribute_deprecated AVOutputFormat *guess_format(const char *short_name,
-                                                  const char *filename,
-                                                  const char *mime_type);
-#endif
-
-/**
- * Returns the output format in the list of registered output formats
- * which best matches the provided parameters, or returns NULL if
- * there is no match.
- *
- * @param short_name if non-NULL checks if short_name matches with the
- * names of the registered formats
- * @param filename if non-NULL checks if filename terminates with the
- * extensions of the registered formats
- * @param mime_type if non-NULL checks if mime_type matches with the
- * MIME type of the registered formats
- */
-AVOutputFormat *av_guess_format(const char *short_name,
-                                const char *filename,
-                                const char *mime_type);
-
-/**
- * Guesses the codec ID based upon muxer and filename.
- */
-enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
-                            const char *filename, const char *mime_type,
-                            enum AVMediaType type);
-
-/**
- * Sends a nice hexadecimal dump of a buffer to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log
- */
-void av_hex_dump(FILE *f, uint8_t *buf, int size);
-
-/**
- * Sends a nice hexadecimal dump of a buffer to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log
- */
-void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
-
-/**
- * Sends a nice dump of a packet to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- */
-void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
-
-/**
- * Sends a nice dump of a packet to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- */
-void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
-
-/**
- * Initializes libavformat and registers all the muxers, demuxers and
- * protocols. If you do not call this function, then you can select
- * exactly which formats you want to support.
- *
- * @see av_register_input_format()
- * @see av_register_output_format()
- * @see av_register_protocol()
- */
-void av_register_all(void);
-
-/** codec tag <-> codec id */
-enum CodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
-unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum CodecID id);
-
-/* media file input */
-
-/**
- * Finds AVInputFormat based on the short name of the input format.
- */
-AVInputFormat *av_find_input_format(const char *short_name);
-
-/**
- * Guesses the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- */
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
-
-/**
- * Guesses the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- * @param score_max A probe score larger that this is required to accept a
- *                  detection, the variable is set to the actual detection
- *                  score afterwards.
- *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
- *                  to retry with a larger probe buffer.
- */
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
-
-/**
- * Allocates all the structures needed to read an input stream.
- *        This does not open the needed codecs for decoding the stream[s].
- */
-int av_open_input_stream(AVFormatContext **ic_ptr,
-                         ByteIOContext *pb, const char *filename,
-                         AVInputFormat *fmt, AVFormatParameters *ap);
-
-/**
- * Opens a media file as input. The codecs are not opened. Only the file
- * header (if present) is read.
- *
- * @param ic_ptr The opened media file handle is put here.
- * @param filename filename to open
- * @param fmt If non-NULL, force the file format to use.
- * @param buf_size optional buffer size (zero if default is OK)
- * @param ap Additional parameters needed when opening the file
- *           (NULL if default).
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
-                       AVInputFormat *fmt,
-                       int buf_size,
-                       AVFormatParameters *ap);
-
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-/**
- * @deprecated Use avformat_alloc_context() instead.
- */
-attribute_deprecated AVFormatContext *av_alloc_format_context(void);
-#endif
-
-/**
- * Allocates an AVFormatContext.
- * Can be freed with av_free() but do not forget to free everything you
- * explicitly allocated as well!
- */
-AVFormatContext *avformat_alloc_context(void);
-
-/**
- * Reads packets of a media file to get stream information. This
- * is useful for file formats with no headers such as MPEG. This
- * function also computes the real framerate in case of MPEG-2 repeat
- * frame mode.
- * The logical file position is not changed by this function;
- * examined packets may be buffered for later processing.
- *
- * @param ic media file handle
- * @return >=0 if OK, AVERROR_xxx on error
- * @todo Let the user decide somehow what information is needed so that
- *       we do not waste time getting stuff the user does not need.
- */
-int av_find_stream_info(AVFormatContext *ic);
-
-/**
- * Reads a transport packet from a media file.
- *
- * This function is obsolete and should never be used.
- * Use av_read_frame() instead.
- *
- * @param s media file handle
- * @param pkt is filled
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_read_packet(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Returns the next frame of a stream.
- *
- * The returned packet is valid
- * until the next av_read_frame() or until av_close_input_file() and
- * must be freed with av_free_packet. For video, the packet contains
- * exactly one frame. For audio, it contains an integer number of
- * frames if each frame has a known fixed size (e.g. PCM or ADPCM
- * data). If the audio frames have a variable size (e.g. MPEG audio),
- * then it contains one frame.
- *
- * pkt->pts, pkt->dts and pkt->duration are always set to correct
- * values in AVStream.time_base units (and guessed if the format cannot
- * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
- * has B-frames, so it is better to rely on pkt->dts if you do not
- * decompress the payload.
- *
- * @return 0 if OK, < 0 on error or end of file
- */
-int av_read_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Seeks to the keyframe at timestamp.
- * 'timestamp' in 'stream_index'.
- * @param stream_index If stream_index is (-1), a default
- * stream is selected, and timestamp is automatically converted
- * from AV_TIME_BASE units to the stream specific time_base.
- * @param timestamp Timestamp in AVStream.time_base units
- *        or, if no stream is specified, in AV_TIME_BASE units.
- * @param flags flags which select direction and seeking mode
- * @return >= 0 on success
- */
-int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
-                  int flags);
-
-/**
- * Seeks to timestamp ts.
- * Seeking will be done so that the point from which all active streams
- * can be presented successfully will be closest to ts and within min/max_ts.
- * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
- *
- * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
- * are the file position (this may not be supported by all demuxers).
- * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
- * in the stream with stream_index (this may not be supported by all demuxers).
- * Otherwise all timestamps are in units of the stream selected by stream_index
- * or if stream_index is -1, in AV_TIME_BASE units.
- * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
- * keyframes (this may not be supported by all demuxers).
- *
- * @param stream_index index of the stream which is used as time base reference
- * @param min_ts smallest acceptable timestamp
- * @param ts target timestamp
- * @param max_ts largest acceptable timestamp
- * @param flags flags
- * @return >=0 on success, error code otherwise
- *
- * @NOTE This is part of the new seek API which is still under construction.
- *       Thus do not use this yet. It may change at any time, do not expect
- *       ABI compatibility yet!
- */
-int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
-/**
- * Starts playing a network-based stream (e.g. RTSP stream) at the
- * current position.
- */
-int av_read_play(AVFormatContext *s);
-
-/**
- * Pauses a network-based stream (e.g. RTSP stream).
- *
- * Use av_read_play() to resume it.
- */
-int av_read_pause(AVFormatContext *s);
-
-/**
- * Frees a AVFormatContext allocated by av_open_input_stream.
- * @param s context to free
- */
-void av_close_input_stream(AVFormatContext *s);
-
-/**
- * Closes a media file (but not its codecs).
- *
- * @param s media file handle
- */
-void av_close_input_file(AVFormatContext *s);
-
-/**
- * Adds a new stream to a media file.
- *
- * Can only be called in the read_header() function. If the flag
- * AVFMTCTX_NOHEADER is in the format context, then new streams
- * can be added in read_packet too.
- *
- * @param s media file handle
- * @param id file-format-dependent stream ID
- */
-AVStream *av_new_stream(AVFormatContext *s, int id);
-AVProgram *av_new_program(AVFormatContext *s, int id);
-
-/**
- * Adds a new chapter.
- * This function is NOT part of the public API
- * and should ONLY be used by demuxers.
- *
- * @param s media file handle
- * @param id unique ID for this chapter
- * @param start chapter start time in time_base units
- * @param end chapter end time in time_base units
- * @param title chapter title
- *
- * @return AVChapter or NULL on error
- */
-AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base,
-                          int64_t start, int64_t end, const char *title);
-
-/**
- * Sets the pts for a given stream.
- *
- * @param s stream
- * @param pts_wrap_bits number of bits effectively used by the pts
- *        (used for wrap control, 33 is the value for MPEG)
- * @param pts_num numerator to convert to seconds (MPEG: 1)
- * @param pts_den denominator to convert to seconds (MPEG: 90000)
- */
-void av_set_pts_info(AVStream *s, int pts_wrap_bits,
-                     unsigned int pts_num, unsigned int pts_den);
-
-#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
-#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
-#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
-#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
-
-int av_find_default_stream_index(AVFormatContext *s);
-
-/**
- * Gets the index for a specific timestamp.
- * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
- *                 to the timestamp which is <= the requested one, if backward
- *                 is 0, then it will be >=
- *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
- * @return < 0 if no such timestamp could be found
- */
-int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
-
-/**
- * Ensures the index uses less memory than the maximum specified in
- * AVFormatContext.max_index_size by discarding entries if it grows
- * too large.
- * This function is not part of the public API and should only be called
- * by demuxers.
- */
-void ff_reduce_index(AVFormatContext *s, int stream_index);
-
-/**
- * Adds an index entry into a sorted list. Updates the entry if the list
- * already contains it.
- *
- * @param timestamp timestamp in the time base of the given stream
- */
-int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
-                       int size, int distance, int flags);
-
-/**
- * Does a binary search using av_index_search_timestamp() and
- * AVCodec.read_timestamp().
- * This is not supposed to be called directly by a user application,
- * but by demuxers.
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int av_seek_frame_binary(AVFormatContext *s, int stream_index,
-                         int64_t target_ts, int flags);
-
-/**
- * Updates cur_dts of all streams based on the given timestamp and AVStream.
- *
- * Stream ref_st unchanged, others set cur_dts in their native time base.
- * Only needed for timestamp wrapping or if (dts not set and pts!=dts).
- * @param timestamp new dts expressed in time_base of param ref_st
- * @param ref_st reference stream giving time_base of param timestamp
- */
-void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
-
-/**
- * Does a binary search using read_timestamp().
- * This is not supposed to be called directly by a user application,
- * but by demuxers.
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int64_t av_gen_search(AVFormatContext *s, int stream_index,
-                      int64_t target_ts, int64_t pos_min,
-                      int64_t pos_max, int64_t pos_limit,
-                      int64_t ts_min, int64_t ts_max,
-                      int flags, int64_t *ts_ret,
-                      int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
-
-/** media file output */
-int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
-
-/**
- * Allocates the stream private data and writes the stream header to an
- * output media file.
- *
- * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_write_header(AVFormatContext *s);
-
-/**
- * Writes a packet to an output media file.
- *
- * The packet shall contain one audio or video frame.
- * The packet must be correctly interleaved according to the container
- * specification, if not then av_interleaved_write_frame must be used.
- *
- * @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
-              dts/pts, ...
- * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
- */
-int av_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Writes a packet to an output media file ensuring correct interleaving.
- *
- * The packet must contain one audio or video frame.
- * If the packets are already correctly interleaved, the application should
- * call av_write_frame() instead as it is slightly faster. It is also important
- * to keep in mind that completely non-interleaved input will need huge amounts
- * of memory to interleave with this, so it is preferable to interleave at the
- * demuxer level.
- *
- * @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
-              dts/pts, ...
- * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
- */
-int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Interleaves a packet per dts in an output media file.
- *
- * Packets with pkt->destruct == av_destruct_packet will be freed inside this
- * function, so they cannot be used after it. Note that calling av_free_packet()
- * on them is still safe.
- *
- * @param s media file handle
- * @param out the interleaved packet will be output here
- * @param in the input packet
- * @param flush 1 if no further packets are available as input and all
- *              remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
- *         < 0 if an error occurred
- */
-int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
-                                 AVPacket *pkt, int flush);
-
-/**
- * Writes the stream trailer to an output media file and frees the
- * file private data.
- *
- * May only be called after a successful call to av_write_header.
- *
- * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_write_trailer(AVFormatContext *s);
-
-void dump_format(AVFormatContext *ic,
-                 int index,
-                 const char *url,
-                 int is_output);
-
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-/**
- * Parses width and height out of string str.
- * @deprecated Use av_parse_video_frame_size instead.
- */
-attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr,
-                                          const char *str);
-
-/**
- * Converts framerate from a string to a fraction.
- * @deprecated Use av_parse_video_frame_rate instead.
- */
-attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base,
-                                          const char *arg);
-#endif
-
-/**
- * Parses datestr and returns a corresponding number of microseconds.
- * @param datestr String representing a date or a duration.
- * - If a date the syntax is:
- * @code
- *  [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]}
- * @endcode
- * Time is local time unless Z is appended, in which case it is
- * interpreted as UTC.
- * If the year-month-day part is not specified it takes the current
- * year-month-day.
- * Returns the number of microseconds since 1st of January, 1970 up to
- * the time of the parsed date or INT64_MIN if datestr cannot be
- * successfully parsed.
- * - If a duration the syntax is:
- * @code
- *  [-]HH[:MM[:SS[.m...]]]
- *  [-]S+[.m...]
- * @endcode
- * Returns the number of microseconds contained in a time interval
- * with the specified duration or INT64_MIN if datestr cannot be
- * successfully parsed.
- * @param duration Flag which tells how to interpret datestr, if
- * not zero datestr is interpreted as a duration, otherwise as a
- * date.
- */
-int64_t parse_date(const char *datestr, int duration);
-
-/** Gets the current time in microseconds. */
-int64_t av_gettime(void);
-
-/* ffm-specific for ffserver */
-#define FFM_PACKET_SIZE 4096
-int64_t ffm_read_write_index(int fd);
-int ffm_write_write_index(int fd, int64_t pos);
-void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
-
-/**
- * Attempts to find a specific tag in a URL.
- *
- * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
- * Return 1 if found.
- */
-int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
-
-/**
- * Returns in 'buf' the path with '%d' replaced by a number.
- *
- * Also handles the '%0nd' format where 'n' is the total number
- * of digits and '%%'.
- *
- * @param buf destination buffer
- * @param buf_size destination buffer size
- * @param path numbered sequence string
- * @param number frame number
- * @return 0 if OK, -1 on format error
- */
-int av_get_frame_filename(char *buf, int buf_size,
-                          const char *path, int number);
-
-/**
- * Checks whether filename actually is a numbered sequence generator.
- *
- * @param filename possible numbered sequence string
- * @return 1 if a valid numbered sequence string, 0 otherwise
- */
-int av_filename_number_test(const char *filename);
-
-/**
- * Generates an SDP for an RTP session.
- *
- * @param ac array of AVFormatContexts describing the RTP streams. If the
- *           array is composed by only one context, such context can contain
- *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
- *           all the contexts in the array (an AVCodecContext per RTP stream)
- *           must contain only one AVStream.
- * @param n_files number of AVCodecContexts contained in ac
- * @param buff buffer where the SDP will be stored (must be allocated by
- *             the caller)
- * @param size the size of the buffer
- * @return 0 if OK, AVERROR_xxx on error
- */
-int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
-
-/**
- * Returns a positive value if the given filename has one of the given
- * extensions, 0 otherwise.
- *
- * @param extensions a comma-separated list of filename extensions
- */
-int av_match_ext(const char *filename, const char *extensions);
-
-#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/ffmpeg 0.6/include/libavformat/avio.h b/ffmpeg 0.6/include/libavformat/avio.h
deleted file mode 100644 (file)
index 9ffe935..0000000
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_AVIO_H
-#define AVFORMAT_AVIO_H
-
-/**
- * @file
- * unbuffered I/O operations
- *
- * @warning This file has to be considered an internal but installed
- * header, so it should not be directly included in your projects.
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-
-/* unbuffered I/O */
-
-/**
- * URL Context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(URLContext) must not be used outside libav*.
- */
-typedef struct URLContext {
-#if LIBAVFORMAT_VERSION_MAJOR >= 53
-    const AVClass *av_class; ///< information for av_log(). Set by url_open().
-#endif
-    struct URLProtocol *prot;
-    int flags;
-    int is_streamed;  /**< true if streamed (no seek possible), default = false */
-    int max_packet_size;  /**< if non zero, the stream is packetized with this max packet size */
-    void *priv_data;
-    char *filename; /**< specified URL */
-} URLContext;
-
-typedef struct URLPollEntry {
-    URLContext *handle;
-    int events;
-    int revents;
-} URLPollEntry;
-
-#define URL_RDONLY 0
-#define URL_WRONLY 1
-#define URL_RDWR   2
-
-typedef int URLInterruptCB(void);
-
-/**
- * Creates an URLContext for accessing to the resource indicated by
- * url, and opens it using the URLProtocol up.
- *
- * @param puc pointer to the location where, in case of success, the
- * function puts the pointer to the created URLContext
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int url_open_protocol (URLContext **puc, struct URLProtocol *up,
-                       const char *url, int flags);
-
-/**
- * Creates an URLContext for accessing to the resource indicated by
- * url, and opens it.
- *
- * @param puc pointer to the location where, in case of success, the
- * function puts the pointer to the created URLContext
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int url_open(URLContext **h, const char *url, int flags);
-
-/**
- * Reads up to size bytes from the resource accessed by h, and stores
- * the read bytes in buf.
- *
- * @return The number of bytes actually read, or a negative value
- * corresponding to an AVERROR code in case of error. A value of zero
- * indicates that it is not possible to read more from the accessed
- * resource (except if the value of the size argument is also zero).
- */
-int url_read(URLContext *h, unsigned char *buf, int size);
-
-/**
- * Read as many bytes as possible (up to size), calling the
- * read function multiple times if necessary.
- * Will also retry if the read function returns AVERROR(EAGAIN).
- * This makes special short-read handling in applications
- * unnecessary, if the return value is < size then it is
- * certain there was either an error or the end of file was reached.
- */
-int url_read_complete(URLContext *h, unsigned char *buf, int size);
-int url_write(URLContext *h, unsigned char *buf, int size);
-
-/**
- * Changes the position that will be used by the next read/write
- * operation on the resource accessed by h.
- *
- * @param pos specifies the new position to set
- * @param whence specifies how pos should be interpreted, it must be
- * one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the
- * current position), SEEK_END (seek from the end), or AVSEEK_SIZE
- * (return the filesize of the requested resource, pos is ignored).
- * @return a negative value corresponding to an AVERROR code in case
- * of failure, or the resulting file position, measured in bytes from
- * the beginning of the file. You can use this feature together with
- * SEEK_CUR to read the current file position.
- */
-int64_t url_seek(URLContext *h, int64_t pos, int whence);
-
-/**
- * Closes the resource accessed by the URLContext h, and frees the
- * memory used by it.
- *
- * @return a negative value if an error condition occurred, 0
- * otherwise
- */
-int url_close(URLContext *h);
-
-/**
- * Returns a non-zero value if the resource indicated by url
- * exists, 0 otherwise.
- */
-int url_exist(const char *url);
-
-int64_t url_filesize(URLContext *h);
-
-/**
- * Return the file descriptor associated with this URL. For RTP, this
- * will return only the RTP file descriptor, not the RTCP file descriptor.
- * To get both, use rtp_get_file_handles().
- *
- * @return the file descriptor associated with this URL, or <0 on error.
- */
-int url_get_file_handle(URLContext *h);
-
-/**
- * Return the maximum packet size associated to packetized file
- * handle. If the file is not packetized (stream like HTTP or file on
- * disk), then 0 is returned.
- *
- * @param h file handle
- * @return maximum packet size in bytes
- */
-int url_get_max_packet_size(URLContext *h);
-void url_get_filename(URLContext *h, char *buf, int buf_size);
-
-/**
- * The callback is called in blocking functions to test regulary if
- * asynchronous interruption is needed. AVERROR(EINTR) is returned
- * in this case by the interrupted function. 'NULL' means no interrupt
- * callback is given.
- */
-void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
-
-/* not implemented */
-int url_poll(URLPollEntry *poll_table, int n, int timeout);
-
-/**
- * Pause and resume playing - only meaningful if using a network streaming
- * protocol (e.g. MMS).
- * @param pause 1 for pause, 0 for resume
- */
-int av_url_read_pause(URLContext *h, int pause);
-
-/**
- * Seek to a given timestamp relative to some component stream.
- * Only meaningful if using a network streaming protocol (e.g. MMS.).
- * @param stream_index The stream index that the timestamp is relative to.
- *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
- *        units from the beginning of the presentation.
- *        If a stream_index >= 0 is used and the protocol does not support
- *        seeking based on component streams, the call will fail with ENOTSUP.
- * @param timestamp timestamp in AVStream.time_base units
- *        or if there is no stream specified then in AV_TIME_BASE units.
- * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
- *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
- *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
- *        fail with ENOTSUP if used and not supported.
- * @return >= 0 on success
- * @see AVInputFormat::read_seek
- */
-int64_t av_url_read_seek(URLContext *h, int stream_index,
-                         int64_t timestamp, int flags);
-
-/**
- * Passing this as the "whence" parameter to a seek function causes it to
- * return the filesize without seeking anywhere. Supporting this is optional.
- * If it is not supported then the seek function will return <0.
- */
-#define AVSEEK_SIZE 0x10000
-
-/**
- * Oring this flag as into the "whence" parameter to a seek function causes it to
- * seek by any means (like reopening and linear reading) or other normally unreasonble
- * means that can be extreemly slow.
- * This may be ignored by the seek code.
- */
-#define AVSEEK_FORCE 0x20000
-
-typedef struct URLProtocol {
-    const char *name;
-    int (*url_open)(URLContext *h, const char *url, int flags);
-    int (*url_read)(URLContext *h, unsigned char *buf, int size);
-    int (*url_write)(URLContext *h, unsigned char *buf, int size);
-    int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
-    int (*url_close)(URLContext *h);
-    struct URLProtocol *next;
-    int (*url_read_pause)(URLContext *h, int pause);
-    int64_t (*url_read_seek)(URLContext *h, int stream_index,
-                             int64_t timestamp, int flags);
-    int (*url_get_file_handle)(URLContext *h);
-} URLProtocol;
-
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-extern URLProtocol *first_protocol;
-#endif
-
-extern URLInterruptCB *url_interrupt_cb;
-
-/**
- * If protocol is NULL, returns the first registered protocol,
- * if protocol is non-NULL, returns the next registered protocol after protocol,
- * or NULL if protocol is the last one.
- */
-URLProtocol *av_protocol_next(URLProtocol *p);
-
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-/**
- * @deprecated Use av_register_protocol() instead.
- */
-attribute_deprecated int register_protocol(URLProtocol *protocol);
-#endif
-
-/**
- * Registers the URLProtocol protocol.
- */
-int av_register_protocol(URLProtocol *protocol);
-
-/**
- * Bytestream IO Context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(ByteIOContext) must not be used outside libav*.
- */
-typedef struct {
-    unsigned char *buffer;
-    int buffer_size;
-    unsigned char *buf_ptr, *buf_end;
-    void *opaque;
-    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int64_t (*seek)(void *opaque, int64_t offset, int whence);
-    int64_t pos; /**< position in the file of the current buffer */
-    int must_flush; /**< true if the next seek should flush */
-    int eof_reached; /**< true if eof reached */
-    int write_flag;  /**< true if open for writing */
-    int is_streamed;
-    int max_packet_size;
-    unsigned long checksum;
-    unsigned char *checksum_ptr;
-    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
-    int error;         ///< contains the error code or 0 if no error happened
-    int (*read_pause)(void *opaque, int pause);
-    int64_t (*read_seek)(void *opaque, int stream_index,
-                         int64_t timestamp, int flags);
-} ByteIOContext;
-
-int init_put_byte(ByteIOContext *s,
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-ByteIOContext *av_alloc_put_byte(
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-
-void put_byte(ByteIOContext *s, int b);
-void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
-void put_le64(ByteIOContext *s, uint64_t val);
-void put_be64(ByteIOContext *s, uint64_t val);
-void put_le32(ByteIOContext *s, unsigned int val);
-void put_be32(ByteIOContext *s, unsigned int val);
-void put_le24(ByteIOContext *s, unsigned int val);
-void put_be24(ByteIOContext *s, unsigned int val);
-void put_le16(ByteIOContext *s, unsigned int val);
-void put_be16(ByteIOContext *s, unsigned int val);
-void put_tag(ByteIOContext *s, const char *tag);
-
-void put_strz(ByteIOContext *s, const char *buf);
-
-/**
- * fseek() equivalent for ByteIOContext.
- * @return new position or AVERROR.
- */
-int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
-
-/**
- * Skip given number of bytes forward.
- * @param offset number of bytes
- */
-void url_fskip(ByteIOContext *s, int64_t offset);
-
-/**
- * ftell() equivalent for ByteIOContext.
- * @return position or AVERROR.
- */
-int64_t url_ftell(ByteIOContext *s);
-
-/**
- * Gets the filesize.
- * @return filesize or AVERROR
- */
-int64_t url_fsize(ByteIOContext *s);
-
-/**
- * feof() equivalent for ByteIOContext.
- * @return non zero if and only if end of file
- */
-int url_feof(ByteIOContext *s);
-
-int url_ferror(ByteIOContext *s);
-
-int av_url_read_fpause(ByteIOContext *h, int pause);
-int64_t av_url_read_fseek(ByteIOContext *h, int stream_index,
-                          int64_t timestamp, int flags);
-
-#define URL_EOF (-1)
-/** @note return URL_EOF (-1) if EOF */
-int url_fgetc(ByteIOContext *s);
-
-/** @warning currently size is limited */
-#ifdef __GNUC__
-int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
-#else
-int url_fprintf(ByteIOContext *s, const char *fmt, ...);
-#endif
-
-/** @note unlike fgets, the EOL character is not returned and a whole
-    line is parsed. return NULL if first char read was EOF */
-char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
-
-void put_flush_packet(ByteIOContext *s);
-
-
-/**
- * Reads size bytes from ByteIOContext into buf.
- * @return number of bytes read or AVERROR
- */
-int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
-
-/**
- * Reads size bytes from ByteIOContext into buf.
- * This reads at most 1 packet. If that is not enough fewer bytes will be
- * returned.
- * @return number of bytes read or AVERROR
- */
-int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
-
-/** @note return 0 if EOF, so you cannot use it if EOF handling is
-    necessary */
-int get_byte(ByteIOContext *s);
-unsigned int get_le24(ByteIOContext *s);
-unsigned int get_le32(ByteIOContext *s);
-uint64_t get_le64(ByteIOContext *s);
-unsigned int get_le16(ByteIOContext *s);
-
-char *get_strz(ByteIOContext *s, char *buf, int maxlen);
-unsigned int get_be16(ByteIOContext *s);
-unsigned int get_be24(ByteIOContext *s);
-unsigned int get_be32(ByteIOContext *s);
-uint64_t get_be64(ByteIOContext *s);
-
-uint64_t ff_get_v(ByteIOContext *bc);
-
-static inline int url_is_streamed(ByteIOContext *s)
-{
-    return s->is_streamed;
-}
-
-/**
- * Creates and initializes a ByteIOContext for accessing the
- * resource referenced by the URLContext h.
- * @note When the URLContext h has been opened in read+write mode, the
- * ByteIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created ByteIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int url_fdopen(ByteIOContext **s, URLContext *h);
-
-/** @warning must be called before any I/O */
-int url_setbufsize(ByteIOContext *s, int buf_size);
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-/** Reset the buffer for reading or writing.
- * @note Will drop any data currently in the buffer without transmitting it.
- * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
- *        to set up the buffer for writing. */
-int url_resetbuf(ByteIOContext *s, int flags);
-#endif
-
-/**
- * Rewinds the ByteIOContext using the specified buffer containing the first buf_size bytes of the file.
- * Used after probing to avoid seeking.
- * Joins buf and s->buffer, taking any overlap into consideration.
- * @note s->buffer must overlap with buf or they can't be joined and the function fails
- * @note This function is NOT part of the public API
- *
- * @param s The read-only ByteIOContext to rewind
- * @param buf The probe buffer containing the first buf_size bytes of the file
- * @param buf_size The size of buf
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size);
-
-/**
- * Creates and initializes a ByteIOContext for accessing the
- * resource indicated by url.
- * @note When the resource indicated by url has been opened in
- * read+write mode, the ByteIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created ByteIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int url_fopen(ByteIOContext **s, const char *url, int flags);
-
-int url_fclose(ByteIOContext *s);
-URLContext *url_fileno(ByteIOContext *s);
-
-/**
- * Return the maximum packet size associated to packetized buffered file
- * handle. If the file is not packetized (stream like http or file on
- * disk), then 0 is returned.
- *
- * @param s buffered file handle
- * @return maximum packet size in bytes
- */
-int url_fget_max_packet_size(ByteIOContext *s);
-
-int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags);
-
-/** return the written or read size */
-int url_close_buf(ByteIOContext *s);
-
-/**
- * Open a write only memory stream.
- *
- * @param s new IO context
- * @return zero if no error.
- */
-int url_open_dyn_buf(ByteIOContext **s);
-
-/**
- * Open a write only packetized memory stream with a maximum packet
- * size of 'max_packet_size'.  The stream is stored in a memory buffer
- * with a big endian 4 byte header giving the packet size in bytes.
- *
- * @param s new IO context
- * @param max_packet_size maximum packet size (must be > 0)
- * @return zero if no error.
- */
-int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
-
-/**
- * Return the written size and a pointer to the buffer. The buffer
- *  must be freed with av_free().
- * @param s IO context
- * @param pbuffer pointer to a byte buffer
- * @return the length of the byte buffer
- */
-int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
-
-unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
-                                    unsigned int len);
-unsigned long get_checksum(ByteIOContext *s);
-void init_checksum(ByteIOContext *s,
-                   unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
-                   unsigned long checksum);
-
-/* udp.c */
-int udp_set_remote_url(URLContext *h, const char *uri);
-int udp_get_local_port(URLContext *h);
-#if (LIBAVFORMAT_VERSION_MAJOR <= 52)
-int udp_get_file_handle(URLContext *h);
-#endif
-
-#endif /* AVFORMAT_AVIO_H */
diff --git a/ffmpeg 0.6/include/libavutil/adler32.h b/ffmpeg 0.6/include/libavutil/adler32.h
deleted file mode 100644 (file)
index 9626c80..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * copyright (c) 2006 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ADLER32_H
-#define AVUTIL_ADLER32_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
-                                unsigned int len) av_pure;
-
-#endif /* AVUTIL_ADLER32_H */
diff --git a/ffmpeg 0.6/include/libavutil/attributes.h b/ffmpeg 0.6/include/libavutil/attributes.h
deleted file mode 100644 (file)
index da45234..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Macro definitions for various function/variable attributes
- */
-
-#ifndef AVUTIL_ATTRIBUTES_H
-#define AVUTIL_ATTRIBUTES_H
-
-#ifdef __GNUC__
-#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
-#else
-#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
-#endif
-
-#ifndef av_always_inline
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_always_inline __attribute__((always_inline)) inline
-#else
-#    define av_always_inline inline
-#endif
-#endif
-
-#ifndef av_noinline
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_noinline __attribute__((noinline))
-#else
-#    define av_noinline
-#endif
-#endif
-
-#ifndef av_pure
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_pure __attribute__((pure))
-#else
-#    define av_pure
-#endif
-#endif
-
-#ifndef av_const
-#if AV_GCC_VERSION_AT_LEAST(2,6)
-#    define av_const __attribute__((const))
-#else
-#    define av_const
-#endif
-#endif
-
-#ifndef av_cold
-#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
-#    define av_cold __attribute__((cold))
-#else
-#    define av_cold
-#endif
-#endif
-
-#ifndef av_flatten
-#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
-#    define av_flatten __attribute__((flatten))
-#else
-#    define av_flatten
-#endif
-#endif
-
-#ifndef attribute_deprecated
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define attribute_deprecated __attribute__((deprecated))
-#else
-#    define attribute_deprecated
-#endif
-#endif
-
-#ifndef av_unused
-#if defined(__GNUC__)
-#    define av_unused __attribute__((unused))
-#else
-#    define av_unused
-#endif
-#endif
-
-#ifndef av_uninit
-#if defined(__GNUC__) && !defined(__ICC)
-#    define av_uninit(x) x=x
-#else
-#    define av_uninit(x) x
-#endif
-#endif
-
-#ifdef __GNUC__
-#    define av_builtin_constant_p __builtin_constant_p
-#else
-#    define av_builtin_constant_p(x) 0
-#endif
-
-#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/ffmpeg 0.6/include/libavutil/avconfig.h b/ffmpeg 0.6/include/libavutil/avconfig.h
deleted file mode 100644 (file)
index b028bb4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Generated by ffconf */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-#define AV_HAVE_BIGENDIAN 0
-#endif /* AVUTIL_AVCONFIG_H */
diff --git a/ffmpeg 0.6/include/libavutil/avstring.h b/ffmpeg 0.6/include/libavutil/avstring.h
deleted file mode 100644 (file)
index 01c2391..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2007 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVSTRING_H
-#define AVUTIL_AVSTRING_H
-
-#include <stddef.h>
-
-/**
- * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
- * the address of the first character in str after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated if the prefix is matched inside str
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_strstart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Return non-zero if pfx is a prefix of str independent of case. If
- * it is, *ptr is set to the address of the first character in str
- * after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated if the prefix is matched inside str
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_stristart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Locate the first case-independent occurrence in the string haystack
- * of the string needle.  A zero-length string needle is considered to
- * match at the start of haystack.
- *
- * This function is a case-insensitive version of the standard strstr().
- *
- * @param haystack string to search in
- * @param needle   string to search for
- * @return         pointer to the located match within haystack
- *                 or a null pointer if no match
- */
-char *av_stristr(const char *haystack, const char *needle);
-
-/**
- * Copy the string src to dst, but no more than size - 1 bytes, and
- * null-terminate dst.
- *
- * This function is the same as BSD strlcpy().
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the length of src
- *
- * WARNING: since the return value is the length of src, src absolutely
- * _must_ be a properly 0-terminated string, otherwise this will read beyond
- * the end of the buffer and possibly crash.
- */
-size_t av_strlcpy(char *dst, const char *src, size_t size);
-
-/**
- * Append the string src to the string dst, but to a total length of
- * no more than size - 1 bytes, and null-terminate dst.
- *
- * This function is similar to BSD strlcat(), but differs when
- * size <= strlen(dst).
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the total length of src and dst
- *
- * WARNING: since the return value use the length of src and dst, these absolutely
- * _must_ be a properly 0-terminated strings, otherwise this will read beyond
- * the end of the buffer and possibly crash.
- */
-size_t av_strlcat(char *dst, const char *src, size_t size);
-
-/**
- * Append output to a string, according to a format. Never write out of
- * the destination buffer, and always put a terminating 0 within
- * the buffer.
- * @param dst destination buffer (string to which the output is
- *  appended)
- * @param size total size of the destination buffer
- * @param fmt printf-compatible format string, specifying how the
- *  following parameters are used
- * @return the length of the string that would have been generated
- *  if enough space had been available
- */
-size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
-
-/**
- * Convert a number to a av_malloced string.
- */
-char *av_d2str(double d);
-
-#endif /* AVUTIL_AVSTRING_H */
diff --git a/ffmpeg 0.6/include/libavutil/avutil.h b/ffmpeg 0.6/include/libavutil/avutil.h
deleted file mode 100644 (file)
index e9e07b9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVUTIL_H
-#define AVUTIL_AVUTIL_H
-
-/**
- * @file
- * external API header
- */
-
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-#define AV_PRAGMA(s) _Pragma(#s)
-
-#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
-#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-
-#define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR 15
-#define LIBAVUTIL_VERSION_MICRO  1
-
-#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-                                               LIBAVUTIL_VERSION_MINOR, \
-                                               LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
-                                           LIBAVUTIL_VERSION_MINOR,     \
-                                           LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-/**
- * Returns the LIBAVUTIL_VERSION_INT constant.
- */
-unsigned avutil_version(void);
-
-/**
- * Returns the libavutil build-time configuration.
- */
-const char *avutil_configuration(void);
-
-/**
- * Returns the libavutil license.
- */
-const char *avutil_license(void);
-
-enum AVMediaType {
-    AVMEDIA_TYPE_UNKNOWN = -1,
-    AVMEDIA_TYPE_VIDEO,
-    AVMEDIA_TYPE_AUDIO,
-    AVMEDIA_TYPE_DATA,
-    AVMEDIA_TYPE_SUBTITLE,
-    AVMEDIA_TYPE_ATTACHMENT,
-    AVMEDIA_TYPE_NB
-};
-
-#include "common.h"
-#include "error.h"
-#include "mathematics.h"
-#include "rational.h"
-#include "intfloat_readwrite.h"
-#include "log.h"
-#include "pixfmt.h"
-
-#endif /* AVUTIL_AVUTIL_H */
diff --git a/ffmpeg 0.6/include/libavutil/base64.h b/ffmpeg 0.6/include/libavutil/base64.h
deleted file mode 100644 (file)
index 103860e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BASE64_H
-#define AVUTIL_BASE64_H
-
-#include <stdint.h>
-
-/**
- * Decodes the base64-encoded string in in and puts the decoded
- * data in out.
- *
- * @param out_size size in bytes of the out buffer, it should be at
- * least 3/4 of the length of in
- * @return the number of bytes written, or a negative value in case of
- * error
- */
-int av_base64_decode(uint8_t *out, const char *in, int out_size);
-
-/**
- * Encodes in base64 the data in in and puts the resulting string
- * in out.
- *
- * @param out_size size in bytes of the out string, it should be at
- * least ((in_size + 2) / 3) * 4 + 1
- * @param in_size size in bytes of the in buffer
- * @return the string containing the encoded data, or NULL in case of
- * error
- */
-char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
-
-#endif /* AVUTIL_BASE64_H */
diff --git a/ffmpeg 0.6/include/libavutil/common.h b/ffmpeg 0.6/include/libavutil/common.h
deleted file mode 100644 (file)
index 4aa00a9..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common internal and external API header
- */
-
-#ifndef AVUTIL_COMMON_H
-#define AVUTIL_COMMON_H
-
-#include <ctype.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "attributes.h"
-
-//rounded division & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
-/* assume b>0 */
-#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
-#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
-
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
-#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
-
-#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
-
-/* misc math functions */
-extern const uint8_t ff_log2_tab[256];
-
-extern const uint8_t av_reverse[256];
-
-static inline av_const int av_log2_c(unsigned int v)
-{
-    int n = 0;
-    if (v & 0xffff0000) {
-        v >>= 16;
-        n += 16;
-    }
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-
-static inline av_const int av_log2_16bit_c(unsigned int v)
-{
-    int n = 0;
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-
-#ifdef HAVE_AV_CONFIG_H
-#   include "config.h"
-#   include "intmath.h"
-#endif
-
-#ifndef av_log2
-#   define av_log2       av_log2_c
-#endif
-#ifndef av_log2_16bit
-#   define av_log2_16bit av_log2_16bit_c
-#endif
-
-/**
- * Clips a signed integer value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static inline av_const int av_clip(int a, int amin, int amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/**
- * Clips a signed integer value into the 0-255 range.
- * @param a value to clip
- * @return clipped value
- */
-static inline av_const uint8_t av_clip_uint8(int a)
-{
-    if (a&(~0xFF)) return (-a)>>31;
-    else           return a;
-}
-
-/**
- * Clips a signed integer value into the 0-65535 range.
- * @param a value to clip
- * @return clipped value
- */
-static inline av_const uint16_t av_clip_uint16(int a)
-{
-    if (a&(~0xFFFF)) return (-a)>>31;
-    else             return a;
-}
-
-/**
- * Clips a signed integer value into the -32768,32767 range.
- * @param a value to clip
- * @return clipped value
- */
-static inline av_const int16_t av_clip_int16(int a)
-{
-    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
-    else                      return a;
-}
-
-/**
- * Clips a signed 64-bit integer value into the -2147483648,2147483647 range.
- * @param a value to clip
- * @return clipped value
- */
-static inline av_const int32_t av_clipl_int32(int64_t a)
-{
-    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
-    else                                         return a;
-}
-
-/**
- * Clips a float value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static inline av_const float av_clipf(float a, float amin, float amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/** Computes ceil(log2(x)).
- * @param x value used to compute ceil(log2(x))
- * @return computed ceiling of log2(x)
- */
-static inline av_const int av_ceil_log2(int x)
-{
-    return av_log2((x - 1) << 1);
-}
-
-#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
-#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
-
-/*!
- * \def GET_UTF8(val, GET_BYTE, ERROR)
- * Converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
- * \param val is the output and should be of type uint32_t. It holds the converted
- * UCS-4 character and should be a left value.
- * \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
- * a function or a statement whose return value or evaluated value is of type
- * uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range,
- * and up to 7 times in the general case.
- * \param ERROR action that should be taken when an invalid UTF-8 byte is returned
- * from GET_BYTE. It should be a statement that jumps out of the macro,
- * like exit(), goto, return, break, or continue.
- */
-#define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= GET_BYTE;\
-    {\
-        int ones= 7 - av_log2(val ^ 255);\
-        if(ones==1)\
-            ERROR\
-        val&= 127>>ones;\
-        while(--ones > 0){\
-            int tmp= GET_BYTE - 128;\
-            if(tmp>>6)\
-                ERROR\
-            val= (val<<6) + tmp;\
-        }\
-    }
-
-/*!
- * \def GET_UTF16(val, GET_16BIT, ERROR)
- * Converts a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form
- * \param val is the output and should be of type uint32_t. It holds the converted
- * UCS-4 character and should be a left value.
- * \param GET_16BIT gets two bytes of UTF-16 encoded data converted to native endianness.
- * It can be a function or a statement whose return value or evaluated value is of type
- * uint16_t. It will be executed up to 2 times.
- * \param ERROR action that should be taken when an invalid UTF-16 surrogate is
- * returned from GET_BYTE. It should be a statement that jumps out of the macro,
- * like exit(), goto, return, break, or continue.
- */
-#define GET_UTF16(val, GET_16BIT, ERROR)\
-    val = GET_16BIT;\
-    {\
-        unsigned int hi = val - 0xD800;\
-        if (hi < 0x800) {\
-            val = GET_16BIT - 0xDC00;\
-            if (val > 0x3FFU || hi > 0x3FFU)\
-                ERROR\
-            val += (hi<<10) + 0x10000;\
-        }\
-    }\
-
-/*!
- * \def PUT_UTF8(val, tmp, PUT_BYTE)
- * Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
- * \param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
- * val is given as a function it is executed only once.
- * \param tmp is a temporary variable and should be of type uint8_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_BYTE.
- * \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
- * It could be a function or a statement, and uses tmp as the input byte.
- * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
- * executed up to 4 times for values in the valid UTF-8 range and up to
- * 7 times in the general case, depending on the length of the converted
- * Unicode character.
- */
-#define PUT_UTF8(val, tmp, PUT_BYTE)\
-    {\
-        int bytes, shift;\
-        uint32_t in = val;\
-        if (in < 0x80) {\
-            tmp = in;\
-            PUT_BYTE\
-        } else {\
-            bytes = (av_log2(in) + 4) / 5;\
-            shift = (bytes - 1) * 6;\
-            tmp = (256 - (256 >> bytes)) | (in >> shift);\
-            PUT_BYTE\
-            while (shift >= 6) {\
-                shift -= 6;\
-                tmp = 0x80 | ((in >> shift) & 0x3f);\
-                PUT_BYTE\
-            }\
-        }\
-    }
-
-/*!
- * \def PUT_UTF16(val, tmp, PUT_16BIT)
- * Converts a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
- * \param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
- * val is given as a function it is executed only once.
- * \param tmp is a temporary variable and should be of type uint16_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_16BIT.
- * \param PUT_16BIT writes the converted UTF-16 data to any proper destination
- * in desired endianness. It could be a function or a statement, and uses tmp
- * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
- * PUT_BYTE will be executed 1 or 2 times depending on input character.
- */
-#define PUT_UTF16(val, tmp, PUT_16BIT)\
-    {\
-        uint32_t in = val;\
-        if (in < 0x10000) {\
-            tmp = in;\
-            PUT_16BIT\
-        } else {\
-            tmp = 0xD800 | ((in - 0x10000) >> 10);\
-            PUT_16BIT\
-            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
-            PUT_16BIT\
-        }\
-    }\
-
-
-
-#include "mem.h"
-
-#ifdef HAVE_AV_CONFIG_H
-#    include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
-
-#endif /* AVUTIL_COMMON_H */
diff --git a/ffmpeg 0.6/include/libavutil/crc.h b/ffmpeg 0.6/include/libavutil/crc.h
deleted file mode 100644 (file)
index 6c0baab..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CRC_H
-#define AVUTIL_CRC_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include "attributes.h"
-
-typedef uint32_t AVCRC;
-
-typedef enum {
-    AV_CRC_8_ATM,
-    AV_CRC_16_ANSI,
-    AV_CRC_16_CCITT,
-    AV_CRC_32_IEEE,
-    AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of AV_CRC_32_IEEE */
-    AV_CRC_MAX,         /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
-
-int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
-const AVCRC *av_crc_get_table(AVCRCId crc_id);
-uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
-
-#endif /* AVUTIL_CRC_H */
-
diff --git a/ffmpeg 0.6/include/libavutil/error.h b/ffmpeg 0.6/include/libavutil/error.h
deleted file mode 100644 (file)
index 13a9a35..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * error code definitions
- */
-
-#ifndef AVUTIL_ERROR_H
-#define AVUTIL_ERROR_H
-
-#include <errno.h>
-#include "avutil.h"
-
-/* error handling */
-#if EDOM > 0
-#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
-#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
-#else
-/* Some platforms have E* and errno already negated. */
-#define AVERROR(e) (e)
-#define AVUNERROR(e) (e)
-#endif
-
-#if LIBAVUTIL_VERSION_MAJOR < 51
-#define AVERROR_INVALIDDATA AVERROR(EINVAL)  ///< Invalid data found when processing input
-#define AVERROR_IO          AVERROR(EIO)     ///< I/O error
-#define AVERROR_NOENT       AVERROR(ENOENT)  ///< No such file or directory
-#define AVERROR_NOFMT       AVERROR(EILSEQ)  ///< Unknown format
-#define AVERROR_NOMEM       AVERROR(ENOMEM)  ///< Not enough memory
-#define AVERROR_NOTSUPP     AVERROR(ENOSYS)  ///< Operation not supported
-#define AVERROR_NUMEXPECTED AVERROR(EDOM)    ///< Number syntax expected in filename
-#define AVERROR_UNKNOWN     AVERROR(EINVAL)  ///< Unknown error
-#endif
-
-#define AVERROR_EOF         AVERROR(EPIPE)   ///< End of file
-
-#define AVERROR_PATCHWELCOME    (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
-
-#if LIBAVUTIL_VERSION_MAJOR > 50
-#define AVERROR_INVALIDDATA     (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
-#define AVERROR_NUMEXPECTED     (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
-#endif
-
-/**
- * Puts a description of the AVERROR code errnum in errbuf.
- * In case of failure the global variable errno is set to indicate the
- * error. Even in case of failure av_strerror() will print a generic
- * error message indicating the errnum provided to errbuf.
- *
- * @param errbuf_size the size in bytes of errbuf
- * @return 0 on success, a negative value if a description for errnum
- * cannot be found
- */
-int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
-
-#endif /* AVUTIL_ERROR_H */
diff --git a/ffmpeg 0.6/include/libavutil/fifo.h b/ffmpeg 0.6/include/libavutil/fifo.h
deleted file mode 100644 (file)
index fb1ed47..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a very simple circular buffer FIFO implementation
- */
-
-#ifndef AVUTIL_FIFO_H
-#define AVUTIL_FIFO_H
-
-#include <stdint.h>
-
-typedef struct AVFifoBuffer {
-    uint8_t *buffer;
-    uint8_t *rptr, *wptr, *end;
-    uint32_t rndx, wndx;
-} AVFifoBuffer;
-
-/**
- * Initializes an AVFifoBuffer.
- * @param size of FIFO
- * @return AVFifoBuffer or NULL in case of memory allocation failure
- */
-AVFifoBuffer *av_fifo_alloc(unsigned int size);
-
-/**
- * Frees an AVFifoBuffer.
- * @param *f AVFifoBuffer to free
- */
-void av_fifo_free(AVFifoBuffer *f);
-
-/**
- * Resets the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
- * @param *f AVFifoBuffer to reset
- */
-void av_fifo_reset(AVFifoBuffer *f);
-
-/**
- * Returns the amount of data in bytes in the AVFifoBuffer, that is the
- * amount of data you can read from it.
- * @param *f AVFifoBuffer to read from
- * @return size
- */
-int av_fifo_size(AVFifoBuffer *f);
-
-/**
- * Returns the amount of space in bytes in the AVFifoBuffer, that is the
- * amount of data you can write into it.
- * @param *f AVFifoBuffer to write into
- * @return size
- */
-int av_fifo_space(AVFifoBuffer *f);
-
-/**
- * Feeds data from an AVFifoBuffer to a user-supplied callback.
- * @param *f AVFifoBuffer to read from
- * @param buf_size number of bytes to read
- * @param *func generic read function
- * @param *dest data destination
- */
-int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
-
-/**
- * Feeds data from a user-supplied callback to an AVFifoBuffer.
- * @param *f AVFifoBuffer to write to
- * @param *src data source; non-const since it may be used as a
- * modifiable context by the function defined in func
- * @param size number of bytes to write
- * @param *func generic write function; the first parameter is src,
- * the second is dest_buf, the third is dest_buf_size.
- * func must return the number of bytes written to dest_buf, or <= 0 to
- * indicate no more data available to write.
- * If func is NULL, src is interpreted as a simple byte array for source data.
- * @return the number of bytes written to the FIFO
- */
-int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
-
-/**
- * Resizes an AVFifoBuffer.
- * @param *f AVFifoBuffer to resize
- * @param size new AVFifoBuffer size in bytes
- * @return <0 for failure, >=0 otherwise
- */
-int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
-
-/**
- * Reads and discards the specified amount of data from an AVFifoBuffer.
- * @param *f AVFifoBuffer to read from
- * @param size amount of data to read in bytes
- */
-void av_fifo_drain(AVFifoBuffer *f, int size);
-
-static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
-{
-    uint8_t *ptr = f->rptr + offs;
-    if (ptr >= f->end)
-        ptr -= f->end - f->buffer;
-    return *ptr;
-}
-#endif /* AVUTIL_FIFO_H */
diff --git a/ffmpeg 0.6/include/libavutil/intfloat_readwrite.h b/ffmpeg 0.6/include/libavutil/intfloat_readwrite.h
deleted file mode 100644 (file)
index 1b80fc6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTFLOAT_READWRITE_H
-#define AVUTIL_INTFLOAT_READWRITE_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-/* IEEE 80 bits extended float */
-typedef struct AVExtFloat  {
-    uint8_t exponent[2];
-    uint8_t mantissa[8];
-} AVExtFloat;
-
-double av_int2dbl(int64_t v) av_const;
-float av_int2flt(int32_t v) av_const;
-double av_ext2dbl(const AVExtFloat ext) av_const;
-int64_t av_dbl2int(double d) av_const;
-int32_t av_flt2int(float d) av_const;
-AVExtFloat av_dbl2ext(double d) av_const;
-
-#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/ffmpeg 0.6/include/libavutil/log.h b/ffmpeg 0.6/include/libavutil/log.h
deleted file mode 100644 (file)
index 1c3e490..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LOG_H
-#define AVUTIL_LOG_H
-
-#include <stdarg.h>
-#include "avutil.h"
-
-/**
- * Describes the class of an AVClass context structure. That is an
- * arbitrary struct of which the first field is a pointer to an
- * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
- */
-typedef struct {
-    /**
-     * The name of the class; usually it is the same name as the
-     * context structure type to which the AVClass is associated.
-     */
-    const char* class_name;
-
-    /**
-     * A pointer to a function which returns the name of a context
-     * instance ctx associated with the class.
-     */
-    const char* (*item_name)(void* ctx);
-
-    /**
-     * a pointer to the first option specified in the class if any or NULL
-     *
-     * @see av_set_default_options()
-     */
-    const struct AVOption *option;
-
-    /**
-     * LIBAVUTIL_VERSION with which this structure was created.
-     * This is used to allow fields to be added without requiring major
-     * version bumps everywhere.
-     */
-
-    int version;
-} AVClass;
-
-/* av_log API */
-
-#define AV_LOG_QUIET    -8
-
-/**
- * Something went really wrong and we will crash now.
- */
-#define AV_LOG_PANIC     0
-
-/**
- * Something went wrong and recovery is not possible.
- * For example, no header was found for a format which depends
- * on headers or an illegal combination of parameters is used.
- */
-#define AV_LOG_FATAL     8
-
-/**
- * Something went wrong and cannot losslessly be recovered.
- * However, not all future data is affected.
- */
-#define AV_LOG_ERROR    16
-
-/**
- * Something somehow does not look correct. This may or may not
- * lead to problems. An example would be the use of '-vstrict -2'.
- */
-#define AV_LOG_WARNING  24
-
-#define AV_LOG_INFO     32
-#define AV_LOG_VERBOSE  40
-
-/**
- * Stuff which is only useful for libav* developers.
- */
-#define AV_LOG_DEBUG    48
-
-/**
- * Sends the specified message to the log if the level is less than or equal
- * to the current av_log_level. By default, all logging messages are sent to
- * stderr. This behavior can be altered by setting a different av_vlog callback
- * function.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param fmt The format string (printf-compatible) that specifies how
- * subsequent arguments are converted to output.
- * @see av_vlog
- */
-#ifdef __GNUC__
-void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-#else
-void av_log(void*, int level, const char *fmt, ...);
-#endif
-
-void av_vlog(void*, int level, const char *fmt, va_list);
-int av_log_get_level(void);
-void av_log_set_level(int);
-void av_log_set_callback(void (*)(void*, int, const char*, va_list));
-void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
-
-#endif /* AVUTIL_LOG_H */
diff --git a/ffmpeg 0.6/include/libavutil/lzo.h b/ffmpeg 0.6/include/libavutil/lzo.h
deleted file mode 100644 (file)
index 6788054..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * LZO 1x decompression
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LZO_H
-#define AVUTIL_LZO_H
-
-#include <stdint.h>
-
-/** \defgroup errflags Error flags returned by av_lzo1x_decode
-  * \{ */
-//! end of the input buffer reached before decoding finished
-#define AV_LZO_INPUT_DEPLETED 1
-//! decoded data did not fit into output buffer
-#define AV_LZO_OUTPUT_FULL 2
-//! a reference to previously decoded data was wrong
-#define AV_LZO_INVALID_BACKPTR 4
-//! a non-specific error in the compressed bitstream
-#define AV_LZO_ERROR 8
-/** \} */
-
-#define AV_LZO_INPUT_PADDING 8
-#define AV_LZO_OUTPUT_PADDING 12
-
-/**
- * \brief Decodes LZO 1x compressed data.
- * \param out output buffer
- * \param outlen size of output buffer, number of bytes left are returned here
- * \param in input buffer
- * \param inlen size of input buffer, number of bytes left are returned here
- * \return 0 on success, otherwise a combination of the error flags above
- *
- * Make sure all buffers are appropriately padded, in must provide
- * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
- */
-int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
-
-/**
- * \brief deliberately overlapping memcpy implementation
- * \param dst destination buffer; must be padded with 12 additional bytes
- * \param back how many bytes back we start (the initial size of the overlapping window)
- * \param cnt number of bytes to copy, must be >= 0
- *
- * cnt > back is valid, this will copy the bytes we just copied,
- * thus creating a repeating pattern with a period length of back.
- */
-void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
-
-#endif /* AVUTIL_LZO_H */
diff --git a/ffmpeg 0.6/include/libavutil/mathematics.h b/ffmpeg 0.6/include/libavutil/mathematics.h
deleted file mode 100644 (file)
index e198aef..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MATHEMATICS_H
-#define AVUTIL_MATHEMATICS_H
-
-#include <stdint.h>
-#include <math.h>
-#include "attributes.h"
-#include "rational.h"
-
-#ifndef M_E
-#define M_E            2.7182818284590452354   /* e */
-#endif
-#ifndef M_LN2
-#define M_LN2          0.69314718055994530942  /* log_e 2 */
-#endif
-#ifndef M_LN10
-#define M_LN10         2.30258509299404568402  /* log_e 10 */
-#endif
-#ifndef M_LOG2_10
-#define M_LOG2_10      3.32192809488736234787  /* log_2 10 */
-#endif
-#ifndef M_PI
-#define M_PI           3.14159265358979323846  /* pi */
-#endif
-#ifndef M_SQRT1_2
-#define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2) */
-#endif
-#ifndef M_SQRT2
-#define M_SQRT2        1.41421356237309504880  /* sqrt(2) */
-#endif
-#ifndef NAN
-#define NAN            (0.0/0.0)
-#endif
-#ifndef INFINITY
-#define INFINITY       (1.0/0.0)
-#endif
-
-enum AVRounding {
-    AV_ROUND_ZERO     = 0, ///< Round toward zero.
-    AV_ROUND_INF      = 1, ///< Round away from zero.
-    AV_ROUND_DOWN     = 2, ///< Round toward -infinity.
-    AV_ROUND_UP       = 3, ///< Round toward +infinity.
-    AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
-};
-
-/**
- * Returns the greatest common divisor of a and b.
- * If both a and b are 0 or either or both are <0 then behavior is
- * undefined.
- */
-int64_t av_const av_gcd(int64_t a, int64_t b);
-
-/**
- * Rescales a 64-bit integer with rounding to nearest.
- * A simple a*b/c isn't possible as it can overflow.
- */
-int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
-
-/**
- * Rescales a 64-bit integer with specified rounding.
- * A simple a*b/c isn't possible as it can overflow.
- */
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
-
-/**
- * Rescales a 64-bit integer by 2 rational numbers.
- */
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
-
-/**
- * Compares 2 timestamps each in its own timebases.
- * The result of the function is undefined if one of the timestamps
- * is outside the int64_t range when represented in the others timebase.
- * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
- */
-int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
-
-
-#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/ffmpeg 0.6/include/libavutil/md5.h b/ffmpeg 0.6/include/libavutil/md5.h
deleted file mode 100644 (file)
index 969202a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MD5_H
-#define AVUTIL_MD5_H
-
-#include <stdint.h>
-
-extern const int av_md5_size;
-
-struct AVMD5;
-
-void av_md5_init(struct AVMD5 *ctx);
-void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
-void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
-
-#endif /* AVUTIL_MD5_H */
-
diff --git a/ffmpeg 0.6/include/libavutil/mem.h b/ffmpeg 0.6/include/libavutil/mem.h
deleted file mode 100644 (file)
index 1488792..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * memory handling functions
- */
-
-#ifndef AVUTIL_MEM_H
-#define AVUTIL_MEM_H
-
-#include "attributes.h"
-
-#if defined(__ICC) || defined(__SUNPRO_C)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
-#elif defined(__TI_COMPILER_VERSION__)
-    #define DECLARE_ALIGNED(n,t,v)                      \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        t __attribute__((aligned(n))) v
-    #define DECLARE_ASM_CONST(n,t,v)                    \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        static const t __attribute__((aligned(n))) v
-#elif defined(__GNUC__)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t attribute_used __attribute__ ((aligned (n))) v
-#elif defined(_MSC_VER)
-    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
-    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
-#else
-    #define DECLARE_ALIGNED(n,t,v)      t v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t v
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-    #define av_malloc_attrib __attribute__((__malloc__))
-#else
-    #define av_malloc_attrib
-#endif
-
-#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
-    #define av_alloc_size(n) __attribute__((alloc_size(n)))
-#else
-    #define av_alloc_size(n)
-#endif
-
-/**
- * Allocates a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU).
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_mallocz()
- */
-void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Allocates or reallocates a block of memory.
- * If ptr is NULL and size > 0, allocates a new block. If
- * size is zero, frees the memory block pointed to by ptr.
- * @param size Size in bytes for the memory block to be allocated or
- * reallocated.
- * @param ptr Pointer to a memory block already allocated with
- * av_malloc(z)() or av_realloc() or NULL.
- * @return Pointer to a newly reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory block.
- * @see av_fast_realloc()
- */
-void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
-
-/**
- * Frees a memory block which has been allocated with av_malloc(z)() or
- * av_realloc().
- * @param ptr Pointer to the memory block which should be freed.
- * @note ptr = NULL is explicitly allowed.
- * @note It is recommended that you use av_freep() instead.
- * @see av_freep()
- */
-void av_free(void *ptr);
-
-/**
- * Allocates a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU) and
- * zeroes all the bytes of the block.
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if it cannot be allocated.
- * @see av_malloc()
- */
-void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Duplicates the string s.
- * @param s string to be duplicated
- * @return Pointer to a newly allocated string containing a
- * copy of s or NULL if the string cannot be allocated.
- */
-char *av_strdup(const char *s) av_malloc_attrib;
-
-/**
- * Frees a memory block which has been allocated with av_malloc(z)() or
- * av_realloc() and set the pointer pointing to it to NULL.
- * @param ptr Pointer to the pointer to the memory block which should
- * be freed.
- * @see av_free()
- */
-void av_freep(void *ptr);
-
-#endif /* AVUTIL_MEM_H */
diff --git a/ffmpeg 0.6/include/libavutil/pixdesc.h b/ffmpeg 0.6/include/libavutil/pixdesc.h
deleted file mode 100644 (file)
index 8e4c85d..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * pixel format descriptor
- * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXDESC_H
-#define AVUTIL_PIXDESC_H
-
-#include <inttypes.h>
-
-typedef struct AVComponentDescriptor{
-    uint16_t plane        :2;            ///< which of the 4 planes contains the component
-
-    /**
-     * Number of elements between 2 horizontally consecutive pixels minus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t step_minus1  :3;
-
-    /**
-     * Number of elements before the component of the first pixel plus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t offset_plus1 :3;
-    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
-    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
-}AVComponentDescriptor;
-
-/**
- * Descriptor that unambiguously describes how the bits of a pixel are
- * stored in the up to 4 data planes of an image. It also stores the
- * subsampling factors and number of components.
- *
- * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
- *       and all the YUV variants) AVPixFmtDescriptor just stores how values
- *       are stored not what these values represent.
- */
-typedef struct AVPixFmtDescriptor{
-    const char *name;
-    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
-
-    /**
-     * Amount to shift the luma width right to find the chroma width.
-     * For YV12 this is 1 for example.
-     * chroma_width = -((-luma_width) >> log2_chroma_w)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
-
-    /**
-     * Amount to shift the luma height right to find the chroma height.
-     * For YV12 this is 1 for example.
-     * chroma_height= -((-luma_height) >> log2_chroma_h)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_h;
-    uint8_t flags;
-
-    /**
-     * Parameters that describe how pixels are packed. If the format
-     * has chroma components, they must be stored in comp[1] and
-     * comp[2].
-     */
-    AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
-
-#define PIX_FMT_BE        1 ///< Pixel format is big-endian.
-#define PIX_FMT_PAL       2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
-#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
-#define PIX_FMT_HWACCEL   8 ///< Pixel format is an HW accelerated format.
-
-/**
- * The array of all the pixel format descriptors.
- */
-extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-
-/**
- * Reads a line from an image, and writes the values of the
- * pixel format component c to dst.
- *
- * @param data the array containing the pointers to the planes of the image
- * @param linesizes the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to read
- * @param y the vertical coordinate of the first pixel to read
- * @param w the width of the line to read, that is the number of
- * values to write to dst
- * @param read_pal_component if not zero and the format is a paletted
- * format writes the values corresponding to the palette
- * component c in data[1] to dst, rather than the palette indexes in
- * data[0]. The behavior is undefined if the format is not paletted.
- */
-void read_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
-               const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
-
-/**
- * Writes the values from src to the pixel format component c of an
- * image line.
- *
- * @param src array containing the values to write
- * @param data the array containing the pointers to the planes of the
- * image to write into. It is supposed to be zeroed.
- * @param linesizes the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to write
- * @param y the vertical coordinate of the first pixel to write
- * @param w the width of the line to write, that is the number of
- * values to write to the image line
- */
-void write_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
-                const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
-
-/**
- * Returns the pixel format corresponding to name.
- *
- * If there is no pixel format with name name, then looks for a
- * pixel format with the name corresponding to the native endian
- * format of name.
- * For example in a little-endian system, first looks for "gray16",
- * then for "gray16le".
- *
- * Finally if no pixel format has been found, returns PIX_FMT_NONE.
- */
-enum PixelFormat av_get_pix_fmt(const char *name);
-
-/**
- * Returns the number of bits per pixel used by the pixel format
- * described by pixdesc.
- *
- * The returned number of bits refers to the number of bits actually
- * used for storing the pixel information, that is padding bits are
- * not counted.
- */
-int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
-
-#endif /* AVUTIL_PIXDESC_H */
diff --git a/ffmpeg 0.6/include/libavutil/pixfmt.h b/ffmpeg 0.6/include/libavutil/pixfmt.h
deleted file mode 100644 (file)
index d976f34..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXFMT_H
-#define AVUTIL_PIXFMT_H
-
-/**
- * @file
- * pixel format definitions
- *
- * @warning This file has to be considered an internal but installed
- * header, so it should not be directly included in your projects.
- */
-
-#include "libavutil/avconfig.h"
-
-/**
- * Pixel format. Notes:
- *
- * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
- * color is put together as:
- *  (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little-endian CPU architectures and ARGB on
- * big-endian CPUs.
- *
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- *
- * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
- * for pal8. This palette is filled in automatically by the function
- * allocating the picture.
- *
- * Note, make sure that all newly added big endian formats have pix_fmt&1==1
- *       and that all newly added little endian formats have pix_fmt&1==0
- *       this allows simpler detection of big vs little endian.
- */
-enum PixelFormat {
-    PIX_FMT_NONE= -1,
-    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
-    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
-    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
-    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
-    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
-    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
-    PIX_FMT_XVMC_MPEG2_IDCT,
-    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
-    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
-    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
-    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
-    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
-    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
-    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG)
-    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
-    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
-    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-};
-
-#if AV_HAVE_BIGENDIAN
-#   define PIX_FMT_NE(be, le) PIX_FMT_##be
-#else
-#   define PIX_FMT_NE(be, le) PIX_FMT_##le
-#endif
-
-#define PIX_FMT_RGB32   PIX_FMT_NE(ARGB, BGRA)
-#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
-#define PIX_FMT_BGR32   PIX_FMT_NE(ABGR, RGBA)
-#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
-
-#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
-#define PIX_FMT_RGB48  PIX_FMT_NE(RGB48BE,  RGB48LE)
-#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
-#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
-#define PIX_FMT_RGB444 PIX_FMT_NE(RGB444BE, RGB444LE)
-#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
-#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
-#define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE)
-
-#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
-#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
-#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
-
-#endif /* AVUTIL_PIXFMT_H */
diff --git a/ffmpeg 0.6/include/libavutil/rational.h b/ffmpeg 0.6/include/libavutil/rational.h
deleted file mode 100644 (file)
index 4d91f7b..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * rational numbers
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef AVUTIL_RATIONAL_H
-#define AVUTIL_RATIONAL_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-/**
- * rational number numerator/denominator
- */
-typedef struct AVRational{
-    int num; ///< numerator
-    int den; ///< denominator
-} AVRational;
-
-/**
- * Compares two rationals.
- * @param a first rational
- * @param b second rational
- * @return 0 if a==b, 1 if a>b and -1 if a<b
- */
-static inline int av_cmp_q(AVRational a, AVRational b){
-    const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
-
-    if(tmp) return (tmp>>63)|1;
-    else    return 0;
-}
-
-/**
- * Converts rational to double.
- * @param a rational to convert
- * @return (double) a
- */
-static inline double av_q2d(AVRational a){
-    return a.num / (double) a.den;
-}
-
-/**
- * Reduces a fraction.
- * This is useful for framerate calculations.
- * @param dst_num destination numerator
- * @param dst_den destination denominator
- * @param num source numerator
- * @param den source denominator
- * @param max the maximum allowed for dst_num & dst_den
- * @return 1 if exact, 0 otherwise
- */
-int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
-
-/**
- * Multiplies two rationals.
- * @param b first rational
- * @param c second rational
- * @return b*c
- */
-AVRational av_mul_q(AVRational b, AVRational c) av_const;
-
-/**
- * Divides one rational by another.
- * @param b first rational
- * @param c second rational
- * @return b/c
- */
-AVRational av_div_q(AVRational b, AVRational c) av_const;
-
-/**
- * Adds two rationals.
- * @param b first rational
- * @param c second rational
- * @return b+c
- */
-AVRational av_add_q(AVRational b, AVRational c) av_const;
-
-/**
- * Subtracts one rational from another.
- * @param b first rational
- * @param c second rational
- * @return b-c
- */
-AVRational av_sub_q(AVRational b, AVRational c) av_const;
-
-/**
- * Converts a double precision floating point number to a rational.
- * @param d double to convert
- * @param max the maximum allowed numerator and denominator
- * @return (AVRational) d
- */
-AVRational av_d2q(double d, int max) av_const;
-
-/**
- * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
- * than q1, 0 if they have the same distance.
- */
-int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
-
-/**
- * Finds the nearest value in q_list to q.
- * @param q_list an array of rationals terminated by {0, 0}
- * @return the index of the nearest value found in the array
- */
-int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
-
-#endif /* AVUTIL_RATIONAL_H */
diff --git a/ffmpeg 0.6/include/libavutil/sha1.h b/ffmpeg 0.6/include/libavutil/sha1.h
deleted file mode 100644 (file)
index cf7c4a6..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_SHA1_H
-#define AVUTIL_SHA1_H
-
-#include <stdint.h>
-
-extern const int av_sha1_size;
-
-struct AVSHA1;
-
-/**
- * Initializes SHA-1 hashing.
- *
- * @param context pointer to the function context (of size av_sha_size)
- * @deprecated use av_sha_init() instead
- */
-void av_sha1_init(struct AVSHA1* context);
-
-/**
- * Updates hash value.
- *
- * @param context hash function context
- * @param data    input data to update hash with
- * @param len     input data length
- * @deprecated use av_sha_update() instead
- */
-void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len);
-
-/**
- * Finishes hashing and output digest value.
- *
- * @param context hash function context
- * @param digest  buffer where output digest value is stored
- * @deprecated use av_sha_final() instead
- */
-void av_sha1_final(struct AVSHA1* context, uint8_t digest[20]);
-
-#endif /* AVUTIL_SHA1_H */
diff --git a/ffmpeg 0.6/include/libpostproc/postprocess.h b/ffmpeg 0.6/include/libpostproc/postprocess.h
deleted file mode 100644 (file)
index 4cfcf7c..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef POSTPROC_POSTPROCESS_H
-#define POSTPROC_POSTPROCESS_H
-
-/**
- * @file
- * @brief
- *     external postprocessing API
- */
-
-#include "libavutil/avutil.h"
-
-#define LIBPOSTPROC_VERSION_MAJOR 51
-#define LIBPOSTPROC_VERSION_MINOR  2
-#define LIBPOSTPROC_VERSION_MICRO  0
-
-#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
-                                               LIBPOSTPROC_VERSION_MINOR, \
-                                               LIBPOSTPROC_VERSION_MICRO)
-#define LIBPOSTPROC_VERSION     AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
-                                           LIBPOSTPROC_VERSION_MINOR, \
-                                           LIBPOSTPROC_VERSION_MICRO)
-#define LIBPOSTPROC_BUILD       LIBPOSTPROC_VERSION_INT
-
-#define LIBPOSTPROC_IDENT       "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
-
-/**
- * Returns the LIBPOSTPROC_VERSION_INT constant.
- */
-unsigned postproc_version(void);
-
-/**
- * Returns the libpostproc build-time configuration.
- */
-const char *postproc_configuration(void);
-
-/**
- * Returns the libpostproc license.
- */
-const char *postproc_license(void);
-
-#define PP_QUALITY_MAX 6
-
-#define QP_STORE_T int8_t
-
-#include <inttypes.h>
-
-typedef void pp_context;
-typedef void pp_mode;
-
-#if LIBPOSTPROC_VERSION_INT < (52<<16)
-typedef pp_context pp_context_t;
-typedef pp_mode pp_mode_t;
-extern const char *const pp_help; ///< a simple help text
-#else
-extern const char pp_help[]; ///< a simple help text
-#endif
-
-void  pp_postprocess(const uint8_t * src[3], const int srcStride[3],
-                     uint8_t * dst[3], const int dstStride[3],
-                     int horizontalSize, int verticalSize,
-                     const QP_STORE_T *QP_store,  int QP_stride,
-                     pp_mode *mode, pp_context *ppContext, int pict_type);
-
-
-/**
- * returns a pp_mode or NULL if an error occurred
- * name is the string after "-pp" on the command line
- * quality is a number from 0 to PP_QUALITY_MAX
- */
-pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality);
-void pp_free_mode(pp_mode *mode);
-
-pp_context *pp_get_context(int width, int height, int flags);
-void pp_free_context(pp_context *ppContext);
-
-#define PP_CPU_CAPS_MMX   0x80000000
-#define PP_CPU_CAPS_MMX2  0x20000000
-#define PP_CPU_CAPS_3DNOW 0x40000000
-#define PP_CPU_CAPS_ALTIVEC 0x10000000
-
-#define PP_FORMAT         0x00000008
-#define PP_FORMAT_420    (0x00000011|PP_FORMAT)
-#define PP_FORMAT_422    (0x00000001|PP_FORMAT)
-#define PP_FORMAT_411    (0x00000002|PP_FORMAT)
-#define PP_FORMAT_444    (0x00000000|PP_FORMAT)
-
-#define PP_PICT_TYPE_QP2  0x00000010 ///< MPEG2 style QScale
-
-#endif /* POSTPROC_POSTPROCESS_H */
diff --git a/ffmpeg 0.6/include/libswscale/swscale.h b/ffmpeg 0.6/include/libswscale/swscale.h
deleted file mode 100644 (file)
index 1e7af3a..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_SWSCALE_H
-#define SWSCALE_SWSCALE_H
-
-/**
- * @file
- * @brief
- *     external api for the swscale stuff
- */
-
-#include "libavutil/avutil.h"
-
-#define LIBSWSCALE_VERSION_MAJOR 0
-#define LIBSWSCALE_VERSION_MINOR 11
-#define LIBSWSCALE_VERSION_MICRO 0
-
-#define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
-                                               LIBSWSCALE_VERSION_MINOR, \
-                                               LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_VERSION      AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
-                                           LIBSWSCALE_VERSION_MINOR, \
-                                           LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_BUILD        LIBSWSCALE_VERSION_INT
-
-#define LIBSWSCALE_IDENT        "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
-
-/**
- * Returns the LIBSWSCALE_VERSION_INT constant.
- */
-unsigned swscale_version(void);
-
-/**
- * Returns the libswscale build-time configuration.
- */
-const char *swscale_configuration(void);
-
-/**
- * Returns the libswscale license.
- */
-const char *swscale_license(void);
-
-/* values for the flags, the stuff on the command line is different */
-#define SWS_FAST_BILINEAR     1
-#define SWS_BILINEAR          2
-#define SWS_BICUBIC           4
-#define SWS_X                 8
-#define SWS_POINT          0x10
-#define SWS_AREA           0x20
-#define SWS_BICUBLIN       0x40
-#define SWS_GAUSS          0x80
-#define SWS_SINC          0x100
-#define SWS_LANCZOS       0x200
-#define SWS_SPLINE        0x400
-
-#define SWS_SRC_V_CHR_DROP_MASK     0x30000
-#define SWS_SRC_V_CHR_DROP_SHIFT    16
-
-#define SWS_PARAM_DEFAULT           123456
-
-#define SWS_PRINT_INFO              0x1000
-
-//the following 3 flags are not completely implemented
-//internal chrominace subsampling info
-#define SWS_FULL_CHR_H_INT    0x2000
-//input subsampling info
-#define SWS_FULL_CHR_H_INP    0x4000
-#define SWS_DIRECT_BGR        0x8000
-#define SWS_ACCURATE_RND      0x40000
-#define SWS_BITEXACT          0x80000
-
-#define SWS_CPU_CAPS_MMX      0x80000000
-#define SWS_CPU_CAPS_MMX2     0x20000000
-#define SWS_CPU_CAPS_3DNOW    0x40000000
-#define SWS_CPU_CAPS_ALTIVEC  0x10000000
-#define SWS_CPU_CAPS_BFIN     0x01000000
-
-#define SWS_MAX_REDUCE_CUTOFF 0.002
-
-#define SWS_CS_ITU709         1
-#define SWS_CS_FCC            4
-#define SWS_CS_ITU601         5
-#define SWS_CS_ITU624         5
-#define SWS_CS_SMPTE170M      5
-#define SWS_CS_SMPTE240M      7
-#define SWS_CS_DEFAULT        5
-
-/**
- * Returns a pointer to yuv<->rgb coefficients for the given colorspace
- * suitable for sws_setColorspaceDetails().
- *
- * @param colorspace One of the SWS_CS_* macros. If invalid,
- * SWS_CS_DEFAULT is used.
- */
-const int *sws_getCoefficients(int colorspace);
-
-
-// when used for filters they must have an odd number of elements
-// coeffs cannot be shared between vectors
-typedef struct {
-    double *coeff;              ///< pointer to the list of coefficients
-    int length;                 ///< number of coefficients in the vector
-} SwsVector;
-
-// vectors can be shared
-typedef struct {
-    SwsVector *lumH;
-    SwsVector *lumV;
-    SwsVector *chrH;
-    SwsVector *chrV;
-} SwsFilter;
-
-struct SwsContext;
-
-/**
- * Returns a positive value if pix_fmt is a supported input format, 0
- * otherwise.
- */
-int sws_isSupportedInput(enum PixelFormat pix_fmt);
-
-/**
- * Returns a positive value if pix_fmt is a supported output format, 0
- * otherwise.
- */
-int sws_isSupportedOutput(enum PixelFormat pix_fmt);
-
-/**
- * Frees the swscaler context swsContext.
- * If swsContext is NULL, then does nothing.
- */
-void sws_freeContext(struct SwsContext *swsContext);
-
-/**
- * Allocates and returns a SwsContext. You need it to perform
- * scaling/conversion operations using sws_scale().
- *
- * @param srcW the width of the source image
- * @param srcH the height of the source image
- * @param srcFormat the source image format
- * @param dstW the width of the destination image
- * @param dstH the height of the destination image
- * @param dstFormat the destination image format
- * @param flags specify which algorithm and options to use for rescaling
- * @return a pointer to an allocated context, or NULL in case of error
- */
-struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
-                                  int dstW, int dstH, enum PixelFormat dstFormat,
-                                  int flags, SwsFilter *srcFilter,
-                                  SwsFilter *dstFilter, const double *param);
-
-/**
- * Scales the image slice in srcSlice and puts the resulting scaled
- * slice in the image in dst. A slice is a sequence of consecutive
- * rows in an image.
- *
- * Slices have to be provided in sequential order, either in
- * top-bottom or bottom-top order. If slices are provided in
- * non-sequential order the behavior of the function is undefined.
- *
- * @param context   the scaling context previously created with
- *                  sws_getContext()
- * @param srcSlice  the array containing the pointers to the planes of
- *                  the source slice
- * @param srcStride the array containing the strides for each plane of
- *                  the source image
- * @param srcSliceY the position in the source image of the slice to
- *                  process, that is the number (counted starting from
- *                  zero) in the image of the first row of the slice
- * @param srcSliceH the height of the source slice, that is the number
- *                  of rows in the slice
- * @param dst       the array containing the pointers to the planes of
- *                  the destination image
- * @param dstStride the array containing the strides for each plane of
- *                  the destination image
- * @return          the height of the output slice
- */
-int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[],
-              int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);
-#if LIBSWSCALE_VERSION_MAJOR < 1
-/**
- * @deprecated Use sws_scale() instead.
- */
-int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[],
-                      int srcStride[], int srcSliceY, int srcSliceH,
-                      uint8_t* dst[], int dstStride[]) attribute_deprecated;
-#endif
-
-/**
- * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
- * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
- * @return -1 if not supported
- */
-int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
-                             int srcRange, const int table[4], int dstRange,
-                             int brightness, int contrast, int saturation);
-
-/**
- * @return -1 if not supported
- */
-int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
-                             int *srcRange, int **table, int *dstRange,
-                             int *brightness, int *contrast, int *saturation);
-
-/**
- * Allocates and returns an uninitialized vector with length coefficients.
- */
-SwsVector *sws_allocVec(int length);
-
-/**
- * Returns a normalized Gaussian curve used to filter stuff
- * quality=3 is high quality, lower is lower quality.
- */
-SwsVector *sws_getGaussianVec(double variance, double quality);
-
-/**
- * Allocates and returns a vector with length coefficients, all
- * with the same value c.
- */
-SwsVector *sws_getConstVec(double c, int length);
-
-/**
- * Allocates and returns a vector with just one coefficient, with
- * value 1.0.
- */
-SwsVector *sws_getIdentityVec(void);
-
-/**
- * Scales all the coefficients of a by the scalar value.
- */
-void sws_scaleVec(SwsVector *a, double scalar);
-
-/**
- * Scales all the coefficients of a so that their sum equals height.
- */
-void sws_normalizeVec(SwsVector *a, double height);
-void sws_convVec(SwsVector *a, SwsVector *b);
-void sws_addVec(SwsVector *a, SwsVector *b);
-void sws_subVec(SwsVector *a, SwsVector *b);
-void sws_shiftVec(SwsVector *a, int shift);
-
-/**
- * Allocates and returns a clone of the vector a, that is a vector
- * with the same coefficients as a.
- */
-SwsVector *sws_cloneVec(SwsVector *a);
-
-#if LIBSWSCALE_VERSION_MAJOR < 1
-/**
- * @deprecated Use sws_printVec2() instead.
- */
-attribute_deprecated void sws_printVec(SwsVector *a);
-#endif
-
-/**
- * Prints with av_log() a textual representation of the vector a
- * if log_level <= av_log_level.
- */
-void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
-
-void sws_freeVec(SwsVector *a);
-
-SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
-                                float lumaSharpen, float chromaSharpen,
-                                float chromaHShift, float chromaVShift,
-                                int verbose);
-void sws_freeFilter(SwsFilter *filter);
-
-/**
- * Checks if context can be reused, otherwise reallocates a new
- * one.
- *
- * If context is NULL, just calls sws_getContext() to get a new
- * context. Otherwise, checks if the parameters are the ones already
- * saved in context. If that is the case, returns the current
- * context. Otherwise, frees context and gets a new context with
- * the new parameters.
- *
- * Be warned that srcFilter and dstFilter are not checked, they
- * are assumed to remain the same.
- */
-struct SwsContext *sws_getCachedContext(struct SwsContext *context,
-                                        int srcW, int srcH, enum PixelFormat srcFormat,
-                                        int dstW, int dstH, enum PixelFormat dstFormat,
-                                        int flags, SwsFilter *srcFilter,
-                                        SwsFilter *dstFilter, const double *param);
-
-/**
- * Converts an 8bit paletted frame into a frame with a color depth of 32-bits.
- *
- * The output frame will have the same packed format as the palette.
- *
- * @param src        source frame buffer
- * @param dst        destination frame buffer
- * @param num_pixels number of pixels to convert
- * @param palette    array with [256] entries, which must match color arrangement (RGB or BGR) of src
- */
-void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-
-/**
- * Converts an 8bit paletted frame into a frame with a color depth of 24 bits.
- *
- * With the palette format "ABCD", the destination frame ends up with the format "ABC".
- *
- * @param src        source frame buffer
- * @param dst        destination frame buffer
- * @param num_pixels number of pixels to convert
- * @param palette    array with [256] entries, which must match color arrangement (RGB or BGR) of src
- */
-void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
-
-
-#endif /* SWSCALE_SWSCALE_H */
diff --git a/ffmpeg 0.6/include/stdint.h b/ffmpeg 0.6/include/stdint.h
deleted file mode 100644 (file)
index 59d0673..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-// ISO C9x  compliant stdint.h for Microsoft Visual Studio\r
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \r
-// \r
-//  Copyright (c) 2006-2008 Alexander Chemeris\r
-// \r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are met:\r
-// \r
-//   1. Redistributions of source code must retain the above copyright notice,\r
-//      this list of conditions and the following disclaimer.\r
-// \r
-//   2. Redistributions in binary form must reproduce the above copyright\r
-//      notice, this list of conditions and the following disclaimer in the\r
-//      documentation and/or other materials provided with the distribution.\r
-// \r
-//   3. The name of the author may be used to endorse or promote products\r
-//      derived from this software without specific prior written permission.\r
-// \r
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-// \r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifndef _MSC_VER // [\r
-#error "Use this header only with Microsoft Visual C++ compilers!"\r
-#endif // _MSC_VER ]\r
-\r
-#ifndef _MSC_STDINT_H_ // [\r
-#define _MSC_STDINT_H_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif\r
-\r
-#include <limits.h>\r
-\r
-// For Visual Studio 6 in C++ mode and for many Visual Studio versions when\r
-// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'\r
-// or compiler give many errors like this:\r
-//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-#  include <wchar.h>\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-// Define _W64 macros to mark types changing their size, like intptr_t.\r
-#ifndef _W64\r
-#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300\r
-#     define _W64 __w64\r
-#  else\r
-#     define _W64\r
-#  endif\r
-#endif\r
-\r
-\r
-// 7.18.1 Integer types\r
-\r
-// 7.18.1.1 Exact-width integer types\r
-\r
-// Visual Studio 6 and Embedded Visual C++ 4 doesn't\r
-// realize that, e.g. char has the same size as __int8\r
-// so we give up on __intX for them.\r
-#if (_MSC_VER < 1300)\r
-   typedef signed char       int8_t;\r
-   typedef signed short      int16_t;\r
-   typedef signed int        int32_t;\r
-   typedef unsigned char     uint8_t;\r
-   typedef unsigned short    uint16_t;\r
-   typedef unsigned int      uint32_t;\r
-#else\r
-   typedef signed __int8     int8_t;\r
-   typedef signed __int16    int16_t;\r
-   typedef signed __int32    int32_t;\r
-   typedef unsigned __int8   uint8_t;\r
-   typedef unsigned __int16  uint16_t;\r
-   typedef unsigned __int32  uint32_t;\r
-#endif\r
-typedef signed __int64       int64_t;\r
-typedef unsigned __int64     uint64_t;\r
-\r
-\r
-// 7.18.1.2 Minimum-width integer types\r
-typedef int8_t    int_least8_t;\r
-typedef int16_t   int_least16_t;\r
-typedef int32_t   int_least32_t;\r
-typedef int64_t   int_least64_t;\r
-typedef uint8_t   uint_least8_t;\r
-typedef uint16_t  uint_least16_t;\r
-typedef uint32_t  uint_least32_t;\r
-typedef uint64_t  uint_least64_t;\r
-\r
-// 7.18.1.3 Fastest minimum-width integer types\r
-typedef int8_t    int_fast8_t;\r
-typedef int16_t   int_fast16_t;\r
-typedef int32_t   int_fast32_t;\r
-typedef int64_t   int_fast64_t;\r
-typedef uint8_t   uint_fast8_t;\r
-typedef uint16_t  uint_fast16_t;\r
-typedef uint32_t  uint_fast32_t;\r
-typedef uint64_t  uint_fast64_t;\r
-\r
-// 7.18.1.4 Integer types capable of holding object pointers\r
-#ifdef _WIN64 // [\r
-   typedef signed __int64    intptr_t;\r
-   typedef unsigned __int64  uintptr_t;\r
-#else // _WIN64 ][\r
-   typedef _W64 signed int   intptr_t;\r
-   typedef _W64 unsigned int uintptr_t;\r
-#endif // _WIN64 ]\r
-\r
-// 7.18.1.5 Greatest-width integer types\r
-typedef int64_t   intmax_t;\r
-typedef uint64_t  uintmax_t;\r
-\r
-\r
-// 7.18.2 Limits of specified-width integer types\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259\r
-\r
-// 7.18.2.1 Limits of exact-width integer types\r
-#define INT8_MIN     ((int8_t)_I8_MIN)\r
-#define INT8_MAX     _I8_MAX\r
-#define INT16_MIN    ((int16_t)_I16_MIN)\r
-#define INT16_MAX    _I16_MAX\r
-#define INT32_MIN    ((int32_t)_I32_MIN)\r
-#define INT32_MAX    _I32_MAX\r
-#define INT64_MIN    ((int64_t)_I64_MIN)\r
-#define INT64_MAX    _I64_MAX\r
-#define UINT8_MAX    _UI8_MAX\r
-#define UINT16_MAX   _UI16_MAX\r
-#define UINT32_MAX   _UI32_MAX\r
-#define UINT64_MAX   _UI64_MAX\r
-\r
-// 7.18.2.2 Limits of minimum-width integer types\r
-#define INT_LEAST8_MIN    INT8_MIN\r
-#define INT_LEAST8_MAX    INT8_MAX\r
-#define INT_LEAST16_MIN   INT16_MIN\r
-#define INT_LEAST16_MAX   INT16_MAX\r
-#define INT_LEAST32_MIN   INT32_MIN\r
-#define INT_LEAST32_MAX   INT32_MAX\r
-#define INT_LEAST64_MIN   INT64_MIN\r
-#define INT_LEAST64_MAX   INT64_MAX\r
-#define UINT_LEAST8_MAX   UINT8_MAX\r
-#define UINT_LEAST16_MAX  UINT16_MAX\r
-#define UINT_LEAST32_MAX  UINT32_MAX\r
-#define UINT_LEAST64_MAX  UINT64_MAX\r
-\r
-// 7.18.2.3 Limits of fastest minimum-width integer types\r
-#define INT_FAST8_MIN    INT8_MIN\r
-#define INT_FAST8_MAX    INT8_MAX\r
-#define INT_FAST16_MIN   INT16_MIN\r
-#define INT_FAST16_MAX   INT16_MAX\r
-#define INT_FAST32_MIN   INT32_MIN\r
-#define INT_FAST32_MAX   INT32_MAX\r
-#define INT_FAST64_MIN   INT64_MIN\r
-#define INT_FAST64_MAX   INT64_MAX\r
-#define UINT_FAST8_MAX   UINT8_MAX\r
-#define UINT_FAST16_MAX  UINT16_MAX\r
-#define UINT_FAST32_MAX  UINT32_MAX\r
-#define UINT_FAST64_MAX  UINT64_MAX\r
-\r
-// 7.18.2.4 Limits of integer types capable of holding object pointers\r
-#ifdef _WIN64 // [\r
-#  define INTPTR_MIN   INT64_MIN\r
-#  define INTPTR_MAX   INT64_MAX\r
-#  define UINTPTR_MAX  UINT64_MAX\r
-#else // _WIN64 ][\r
-#  define INTPTR_MIN   INT32_MIN\r
-#  define INTPTR_MAX   INT32_MAX\r
-#  define UINTPTR_MAX  UINT32_MAX\r
-#endif // _WIN64 ]\r
-\r
-// 7.18.2.5 Limits of greatest-width integer types\r
-#define INTMAX_MIN   INT64_MIN\r
-#define INTMAX_MAX   INT64_MAX\r
-#define UINTMAX_MAX  UINT64_MAX\r
-\r
-// 7.18.3 Limits of other integer types\r
-\r
-#ifdef _WIN64 // [\r
-#  define PTRDIFF_MIN  _I64_MIN\r
-#  define PTRDIFF_MAX  _I64_MAX\r
-#else  // _WIN64 ][\r
-#  define PTRDIFF_MIN  _I32_MIN\r
-#  define PTRDIFF_MAX  _I32_MAX\r
-#endif  // _WIN64 ]\r
-\r
-#define SIG_ATOMIC_MIN  INT_MIN\r
-#define SIG_ATOMIC_MAX  INT_MAX\r
-\r
-#ifndef SIZE_MAX // [\r
-#  ifdef _WIN64 // [\r
-#     define SIZE_MAX  _UI64_MAX\r
-#  else // _WIN64 ][\r
-#     define SIZE_MAX  _UI32_MAX\r
-#  endif // _WIN64 ]\r
-#endif // SIZE_MAX ]\r
-\r
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>\r
-#ifndef WCHAR_MIN // [\r
-#  define WCHAR_MIN  0\r
-#endif  // WCHAR_MIN ]\r
-#ifndef WCHAR_MAX // [\r
-#  define WCHAR_MAX  _UI16_MAX\r
-#endif  // WCHAR_MAX ]\r
-\r
-#define WINT_MIN  0\r
-#define WINT_MAX  _UI16_MAX\r
-\r
-#endif // __STDC_LIMIT_MACROS ]\r
-\r
-\r
-// 7.18.4 Limits of other integer types\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260\r
-\r
-// 7.18.4.1 Macros for minimum-width integer constants\r
-\r
-#define INT8_C(val)  val##i8\r
-#define INT16_C(val) val##i16\r
-#define INT32_C(val) val##i32\r
-#define INT64_C(val) val##i64\r
-\r
-#define UINT8_C(val)  val##ui8\r
-#define UINT16_C(val) val##ui16\r
-#define UINT32_C(val) val##ui32\r
-#define UINT64_C(val) val##ui64\r
-\r
-// 7.18.4.2 Macros for greatest-width integer constants\r
-#define INTMAX_C   INT64_C\r
-#define UINTMAX_C  UINT64_C\r
-\r
-#endif // __STDC_CONSTANT_MACROS ]\r
-\r
-\r
-#endif // _MSC_STDINT_H_ ]\r
diff --git a/ffmpeg 0.6/lib/avcodec-52.def b/ffmpeg 0.6/lib/avcodec-52.def
deleted file mode 100644 (file)
index 7f239de..0000000
+++ /dev/null
@@ -1,1476 +0,0 @@
-LIBRARY avcodec-52.dll\r
-\r
-EXPORTS\r
-MPV_common_defaults\r
-MPV_common_end\r
-MPV_common_init\r
-MPV_common_init_mmx\r
-MPV_decode_defaults\r
-MPV_decode_mb\r
-MPV_encode_end\r
-MPV_encode_init\r
-MPV_encode_picture\r
-MPV_frame_end\r
-MPV_frame_start\r
-_get_output_format\r
-aac_adtstoasc_bsf\r
-aac_decoder\r
-aac_encoder\r
-aac_parser\r
-aasc_decoder\r
-ac3_common_init\r
-ac3_decoder\r
-ac3_encoder\r
-ac3_parametric_bit_allocation\r
-ac3_parser\r
-add_pixels_clamped_mmx\r
-adpcm_4xm_decoder\r
-adpcm_adx_decoder\r
-adpcm_adx_encoder\r
-adpcm_ct_decoder\r
-adpcm_ea_decoder\r
-adpcm_ea_maxis_xa_decoder\r
-adpcm_ea_r1_decoder\r
-adpcm_ea_r2_decoder\r
-adpcm_ea_r3_decoder\r
-adpcm_ea_xas_decoder\r
-adpcm_g726_decoder\r
-adpcm_g726_encoder\r
-adpcm_ima_amv_decoder\r
-adpcm_ima_dk3_decoder\r
-adpcm_ima_dk4_decoder\r
-adpcm_ima_ea_eacs_decoder\r
-adpcm_ima_ea_sead_decoder\r
-adpcm_ima_iss_decoder\r
-adpcm_ima_qt_decoder\r
-adpcm_ima_qt_encoder\r
-adpcm_ima_smjpeg_decoder\r
-adpcm_ima_wav_decoder\r
-adpcm_ima_wav_encoder\r
-adpcm_ima_ws_decoder\r
-adpcm_ms_decoder\r
-adpcm_ms_encoder\r
-adpcm_sbpro_2_decoder\r
-adpcm_sbpro_3_decoder\r
-adpcm_sbpro_4_decoder\r
-adpcm_swf_decoder\r
-adpcm_swf_encoder\r
-adpcm_thp_decoder\r
-adpcm_xa_decoder\r
-adpcm_yamaha_decoder\r
-adpcm_yamaha_encoder\r
-alac_decoder\r
-alac_encoder\r
-align_put_bits\r
-als_decoder\r
-amrnb_decoder\r
-amv_decoder\r
-anm_decoder\r
-ape_decoder\r
-asv1_decoder\r
-asv1_encoder\r
-asv2_decoder\r
-asv2_encoder\r
-atrac1_decoder\r
-atrac3_decoder\r
-atrac_generate_tables\r
-atrac_iqmf\r
-audio_resample\r
-audio_resample_close\r
-audio_resample_init\r
-aura2_decoder\r
-aura_decoder\r
-av_audio_convert\r
-av_audio_convert_alloc\r
-av_audio_convert_free\r
-av_audio_resample_init\r
-av_bitstream_filter_close\r
-av_bitstream_filter_filter\r
-av_bitstream_filter_init\r
-av_bitstream_filter_next\r
-av_codec_next\r
-av_dct_calc\r
-av_dct_end\r
-av_dct_init\r
-av_destruct_packet\r
-av_destruct_packet_nofree\r
-av_dup_packet\r
-av_fast_malloc\r
-av_fast_realloc\r
-av_fft_calc\r
-av_fft_end\r
-av_fft_init\r
-av_fft_permute\r
-av_find_opt\r
-av_free_packet\r
-av_get_bits_per_sample\r
-av_get_bits_per_sample_format\r
-av_get_double\r
-av_get_int\r
-av_get_pict_type_char\r
-av_get_q\r
-av_get_string\r
-av_hwaccel_next\r
-av_imdct_calc\r
-av_imdct_half\r
-av_init_packet\r
-av_lockmgr_register\r
-av_log_ask_for_sample\r
-av_log_missing_feature\r
-av_mdct_calc\r
-av_mdct_end\r
-av_mdct_init\r
-av_new_packet\r
-av_next_option\r
-av_opt_set_defaults\r
-av_opt_set_defaults2\r
-av_opt_show\r
-av_parse_video_frame_rate\r
-av_parse_video_frame_size\r
-av_parser_change\r
-av_parser_close\r
-av_parser_init\r
-av_parser_next\r
-av_parser_parse\r
-av_parser_parse2\r
-av_picture_copy\r
-av_picture_crop\r
-av_picture_pad\r
-av_rdft_calc\r
-av_rdft_end\r
-av_rdft_init\r
-av_register_bitstream_filter\r
-av_register_codec_parser\r
-av_register_hwaccel\r
-av_resample\r
-av_resample_close\r
-av_resample_compensate\r
-av_resample_init\r
-av_set_double\r
-av_set_int\r
-av_set_q\r
-av_set_string\r
-av_set_string2\r
-av_set_string3\r
-av_shrink_packet\r
-av_strtod\r
-av_tempfile\r
-av_xiphlacing\r
-avcodec_align_dimensions\r
-avcodec_align_dimensions2\r
-avcodec_alloc_context\r
-avcodec_alloc_context2\r
-avcodec_alloc_frame\r
-avcodec_channel_layout_num_channels\r
-avcodec_check_dimensions\r
-avcodec_close\r
-avcodec_configuration\r
-avcodec_copy_context\r
-avcodec_decode_audio2\r
-avcodec_decode_audio3\r
-avcodec_decode_subtitle\r
-avcodec_decode_subtitle2\r
-avcodec_decode_video\r
-avcodec_decode_video2\r
-avcodec_default_execute\r
-avcodec_default_execute2\r
-avcodec_default_free_buffers\r
-avcodec_default_get_buffer\r
-avcodec_default_get_format\r
-avcodec_default_reget_buffer\r
-avcodec_default_release_buffer\r
-avcodec_encode_audio\r
-avcodec_encode_subtitle\r
-avcodec_encode_video\r
-avcodec_find_best_pix_fmt\r
-avcodec_find_decoder\r
-avcodec_find_decoder_by_name\r
-avcodec_find_encoder\r
-avcodec_find_encoder_by_name\r
-avcodec_flush_buffers\r
-avcodec_get_channel_layout_string\r
-avcodec_get_chroma_sub_sample\r
-avcodec_get_context_defaults\r
-avcodec_get_context_defaults2\r
-avcodec_get_edge_width\r
-avcodec_get_frame_defaults\r
-avcodec_get_pix_fmt\r
-avcodec_get_pix_fmt_loss\r
-avcodec_get_pix_fmt_name\r
-avcodec_get_sample_fmt\r
-avcodec_get_sample_fmt_name\r
-avcodec_guess_channel_layout\r
-avcodec_init\r
-avcodec_license\r
-avcodec_open\r
-avcodec_pix_fmt_string\r
-avcodec_pix_fmt_to_codec_tag\r
-avcodec_register\r
-avcodec_register_all\r
-avcodec_sample_fmt_string\r
-avcodec_set_dimensions\r
-avcodec_string\r
-avcodec_thread_init\r
-avcodec_version\r
-avpicture_alloc\r
-avpicture_deinterlace\r
-avpicture_fill\r
-avpicture_free\r
-avpicture_get_size\r
-avpicture_layout\r
-avs_decoder\r
-bethsoftvid_decoder\r
-bfi_decoder\r
-bink_decoder\r
-bink_rlelens\r
-binkaudio_dct_decoder\r
-binkaudio_rdft_decoder\r
-bmp_decoder\r
-bmp_encoder\r
-c93_decoder\r
-cavs_decoder\r
-cavsvideo_parser\r
-cbpc_b_tab\r
-cdgraphics_decoder\r
-cinepak_decoder\r
-cljr_decoder\r
-cook_decoder\r
-cscd_decoder\r
-cyuv_decoder\r
-dca_decoder\r
-dca_parser\r
-dct_quantize_c\r
-dct_quantize_trellis_c\r
-denoise_dct_c\r
-dirac_parser\r
-dnxhd_decoder\r
-dnxhd_encoder\r
-dnxhd_parser\r
-dpx_decoder\r
-dsicinaudio_decoder\r
-dsicinvideo_decoder\r
-dsputil_init\r
-dsputil_init_mmx\r
-dsputil_init_pix_mmx\r
-dsputil_static_init\r
-dsputilenc_init_mmx\r
-dump_extradata_bsf\r
-dvbsub_decoder\r
-dvbsub_encoder\r
-dvbsub_parser\r
-dvdsub_decoder\r
-dvdsub_encoder\r
-dvdsub_parser\r
-dvvideo_decoder\r
-dvvideo_encoder\r
-eac3_decoder\r
-eacmv_decoder\r
-eamad_decoder\r
-eatgq_decoder\r
-eatgv_decoder\r
-eatqi_decoder\r
-eightbps_decoder\r
-eightsvx_exp_decoder\r
-eightsvx_fib_decoder\r
-escape124_decoder\r
-fdct_ifast\r
-fdct_ifast248\r
-ff_aac_ac3_parse\r
-ff_aac_codebook_vector_idx\r
-ff_aac_codebook_vector_vals\r
-ff_aac_codebook_vectors\r
-ff_aac_coders\r
-ff_aac_kbd_long_1024\r
-ff_aac_kbd_short_128\r
-ff_aac_num_swb_1024\r
-ff_aac_num_swb_128\r
-ff_aac_parse_header\r
-ff_aac_pow2sf_tab\r
-ff_aac_pred_sfb_max\r
-ff_aac_psy_model\r
-ff_aac_sbr_ctx_close\r
-ff_aac_sbr_ctx_init\r
-ff_aac_sbr_init\r
-ff_aac_scalefactor_bits\r
-ff_aac_scalefactor_code\r
-ff_aac_spectral_bits\r
-ff_aac_spectral_codes\r
-ff_aac_spectral_sizes\r
-ff_aanscales\r
-ff_ac3_bap_tab\r
-ff_ac3_bit_alloc_calc_bap\r
-ff_ac3_bit_alloc_calc_mask\r
-ff_ac3_bit_alloc_calc_psd\r
-ff_ac3_bitrate_tab\r
-ff_ac3_channel_layout_tab\r
-ff_ac3_channels_tab\r
-ff_ac3_critical_band_size_tab\r
-ff_ac3_db_per_bit_tab\r
-ff_ac3_dec_channel_map\r
-ff_ac3_downmix_c\r
-ff_ac3_enc_channel_map\r
-ff_ac3_fast_decay_tab\r
-ff_ac3_fast_gain_tab\r
-ff_ac3_floor_tab\r
-ff_ac3_frame_size_tab\r
-ff_ac3_hearing_threshold_tab\r
-ff_ac3_log_add_tab\r
-ff_ac3_parse_header\r
-ff_ac3_parse_header_full\r
-ff_ac3_rematrix_band_tab\r
-ff_ac3_sample_rate_tab\r
-ff_ac3_slow_decay_tab\r
-ff_ac3_slow_gain_tab\r
-ff_ac3_ungroup_3_in_5_bits_tab\r
-ff_ac3_window\r
-ff_acelp_apply_order_2_transfer_function\r
-ff_acelp_decode_4bit_to_2nd_delay3\r
-ff_acelp_decode_5_6_bit_to_2nd_delay3\r
-ff_acelp_decode_6bit_to_2nd_delay6\r
-ff_acelp_decode_8bit_to_1st_delay3\r
-ff_acelp_decode_9bit_to_1st_delay6\r
-ff_acelp_decode_gain_code\r
-ff_acelp_fc_pulse_per_track\r
-ff_acelp_high_pass_filter\r
-ff_acelp_interp_filter\r
-ff_acelp_interpolate\r
-ff_acelp_interpolatef\r
-ff_acelp_lp_decode\r
-ff_acelp_lsf2lsp\r
-ff_acelp_lsp2lpc\r
-ff_acelp_lspd2lpc\r
-ff_acelp_reorder_lsf\r
-ff_acelp_update_past_gain\r
-ff_acelp_weighted_vector_sum\r
-ff_adaptive_gain_control\r
-ff_aic_dc_scale_table\r
-ff_alloc_picture\r
-ff_alternate_horizontal_scan\r
-ff_alternate_vertical_scan\r
-ff_amr_set_fixed_gain\r
-ff_apply_motion_4x4\r
-ff_apply_motion_8x8\r
-ff_apply_vector_2x2\r
-ff_apply_vector_4x4\r
-ff_avg_cavs_qpel16_mc00_c\r
-ff_avg_cavs_qpel16_mc00_mmx2\r
-ff_avg_cavs_qpel8_mc00_c\r
-ff_avg_cavs_qpel8_mc00_mmx2\r
-ff_avg_qpel16_mc11_old_c\r
-ff_avg_qpel16_mc12_old_c\r
-ff_avg_qpel16_mc13_old_c\r
-ff_avg_qpel16_mc31_old_c\r
-ff_avg_qpel16_mc32_old_c\r
-ff_avg_qpel16_mc33_old_c\r
-ff_avg_qpel8_mc11_old_c\r
-ff_avg_qpel8_mc12_old_c\r
-ff_avg_qpel8_mc13_old_c\r
-ff_avg_qpel8_mc31_old_c\r
-ff_avg_qpel8_mc32_old_c\r
-ff_avg_qpel8_mc33_old_c\r
-ff_avg_vc1_mspel_mc00_c\r
-ff_avg_vc1_mspel_mc00_mmx2\r
-ff_b60_sinc\r
-ff_bgmc_decode\r
-ff_bgmc_decode_end\r
-ff_bgmc_decode_init\r
-ff_bgmc_end\r
-ff_bgmc_init\r
-ff_bink_idct_add_c\r
-ff_bink_idct_c\r
-ff_bink_idct_put_c\r
-ff_block_permute\r
-ff_bone\r
-ff_build_rac_states\r
-ff_cavs_chroma_dec\r
-ff_cavs_chroma_qp\r
-ff_cavs_dequant_mul\r
-ff_cavs_dequant_shift\r
-ff_cavs_dir_mv\r
-ff_cavs_end\r
-ff_cavs_filter\r
-ff_cavs_init\r
-ff_cavs_init_mb\r
-ff_cavs_init_pic\r
-ff_cavs_init_top_lines\r
-ff_cavs_inter\r
-ff_cavs_inter_dec\r
-ff_cavs_intra_dec\r
-ff_cavs_intra_mv\r
-ff_cavs_load_intra_pred_chroma\r
-ff_cavs_load_intra_pred_luma\r
-ff_cavs_modify_mb_i\r
-ff_cavs_mv\r
-ff_cavs_next_mb\r
-ff_cavs_partition_flags\r
-ff_cavs_scan3x3\r
-ff_cavs_un_mv\r
-ff_cavsdsp_init\r
-ff_cavsdsp_init_3dnow\r
-ff_cavsdsp_init_mmx2\r
-ff_ccitt_unpack\r
-ff_ccitt_unpack_init\r
-ff_celp_circ_addf\r
-ff_celp_convolve_circ\r
-ff_celp_lp_synthesis_filter\r
-ff_celp_lp_synthesis_filterf\r
-ff_celp_lp_zero_synthesis_filterf\r
-ff_cga_font\r
-ff_cga_palette\r
-ff_check_alignment\r
-ff_clean_h263_qscales\r
-ff_clean_intra_table_entries\r
-ff_clean_mpeg4_qscales\r
-ff_clear_fixed_vector\r
-ff_cmap_read_palette\r
-ff_combine_frame\r
-ff_convert_matrix\r
-ff_copy_bits\r
-ff_copy_pce_data\r
-ff_copy_picture\r
-ff_cos\r
-ff_cos_1024\r
-ff_cos_128\r
-ff_cos_16\r
-ff_cos_16384\r
-ff_cos_2048\r
-ff_cos_256\r
-ff_cos_32\r
-ff_cos_32768\r
-ff_cos_4096\r
-ff_cos_512\r
-ff_cos_64\r
-ff_cos_65536\r
-ff_cos_8192\r
-ff_cos_tabs\r
-ff_cropTbl\r
-ff_dcadsp_init\r
-ff_dct_calc\r
-ff_dct_common_init\r
-ff_dct_end\r
-ff_dct_init\r
-ff_decode_10_pulses_35bits\r
-ff_decode_dxt1\r
-ff_decode_dxt3\r
-ff_decode_pitch_lag\r
-ff_decode_sbr_extension\r
-ff_dirac_parse_sequence_header\r
-ff_dnxhd_cid_table\r
-ff_dnxhd_find_cid\r
-ff_dnxhd_get_cid_table\r
-ff_dnxhd_init_mmx\r
-ff_do_elbg\r
-ff_dot_productf\r
-ff_draw_horiz_band\r
-ff_dsputil_init_dwt\r
-ff_dv_codec_profile\r
-ff_dv_frame_profile\r
-ff_dwt_init\r
-ff_dwt_init_x86\r
-ff_ea_idct_put_c\r
-ff_eac3_apply_spectral_extension\r
-ff_eac3_bits_vs_hebap\r
-ff_eac3_decode_transform_coeffs_aht_ch\r
-ff_eac3_default_chmap\r
-ff_eac3_default_cpl_band_struct\r
-ff_eac3_default_spx_band_struct\r
-ff_eac3_frm_expstr\r
-ff_eac3_gaq_remap_1\r
-ff_eac3_gaq_remap_2_4_a\r
-ff_eac3_gaq_remap_2_4_b\r
-ff_eac3_hebap_tab\r
-ff_eac3_mantissa_vq\r
-ff_eac3_parse_header\r
-ff_eac3_spx_atten_tab\r
-ff_emulated_edge_mc\r
-ff_epzs_motion_search\r
-ff_er_add_slice\r
-ff_er_frame_end\r
-ff_er_frame_start\r
-ff_estimate_b_frame_motion\r
-ff_estimate_p_frame_motion\r
-ff_eval_expr\r
-ff_exp2\r
-ff_faandct\r
-ff_faandct248\r
-ff_faanidct\r
-ff_faanidct_add\r
-ff_faanidct_put\r
-ff_fc_2pulses_9bits_track1\r
-ff_fc_2pulses_9bits_track1_gray\r
-ff_fc_2pulses_9bits_track2_gray\r
-ff_fc_4pulses_8bits_track_4\r
-ff_fc_4pulses_8bits_tracks_13\r
-ff_fdct248_islow\r
-ff_fdct_mmx\r
-ff_fdct_mmx2\r
-ff_fdct_sse2\r
-ff_fetch_timestamp\r
-ff_fft_calc_c\r
-ff_fft_end\r
-ff_fft_init\r
-ff_fft_init_mmx\r
-ff_fft_permute_c\r
-ff_fill_linesize\r
-ff_fill_pointer\r
-ff_find_hwaccel\r
-ff_find_start_code\r
-ff_find_unused_picture\r
-ff_fix_long_mvs\r
-ff_fix_long_p_mvs\r
-ff_flac_blocksize_table\r
-ff_flac_get_max_frame_size\r
-ff_flac_is_extradata_valid\r
-ff_flac_parse_block_header\r
-ff_flac_parse_streaminfo\r
-ff_flac_sample_rate_table\r
-ff_float_to_int16_c\r
-ff_float_to_int16_interleave_c\r
-ff_flv2_decode_ac_esc\r
-ff_flv2_encode_ac_esc\r
-ff_flv_decode_picture_header\r
-ff_flv_encode_picture_header\r
-ff_frame_rate_tab\r
-ff_free_expr\r
-ff_get_2pass_fcode\r
-ff_get_best_fcode\r
-ff_get_mb_score\r
-ff_get_plane_bytewidth\r
-ff_gmc_c\r
-ff_golomb_vlc_len\r
-ff_h261_encode_init\r
-ff_h261_encode_mb\r
-ff_h261_encode_picture_header\r
-ff_h261_get_picture_format\r
-ff_h261_loop_filter\r
-ff_h261_reorder_mb_index\r
-ff_h261_rl_table_store\r
-ff_h263_aspect_to_info\r
-ff_h263_cbpy_tab\r
-ff_h263_cbpy_vlc\r
-ff_h263_chroma_qscale_table\r
-ff_h263_decode_end\r
-ff_h263_decode_frame\r
-ff_h263_decode_init\r
-ff_h263_decode_mb\r
-ff_h263_decode_mba\r
-ff_h263_encode_mba\r
-ff_h263_encode_motion\r
-ff_h263_find_frame_end\r
-ff_h263_find_resync_marker\r
-ff_h263_get_gob_height\r
-ff_h263_inter_MCBPC_bits\r
-ff_h263_inter_MCBPC_code\r
-ff_h263_inter_MCBPC_vlc\r
-ff_h263_intra_MCBPC_bits\r
-ff_h263_intra_MCBPC_code\r
-ff_h263_intra_MCBPC_vlc\r
-ff_h263_loop_filter\r
-ff_h263_loop_filter_strength\r
-ff_h263_pixel_aspect\r
-ff_h263_resync\r
-ff_h263_rl_inter\r
-ff_h263_show_pict_info\r
-ff_h263_static_rl_table_store\r
-ff_h263_update_motion_val\r
-ff_h264_alloc_tables\r
-ff_h264_check_intra4x4_pred_mode\r
-ff_h264_check_intra_pred_mode\r
-ff_h264_chroma_qp\r
-ff_h264_decode_end\r
-ff_h264_decode_init\r
-ff_h264_decode_init_vlc\r
-ff_h264_decode_mb_cabac\r
-ff_h264_decode_mb_cavlc\r
-ff_h264_decode_nal\r
-ff_h264_decode_picture_parameter_set\r
-ff_h264_decode_rbsp_trailing\r
-ff_h264_decode_ref_pic_list_reordering\r
-ff_h264_decode_ref_pic_marking\r
-ff_h264_decode_sei\r
-ff_h264_decode_seq_parameter_set\r
-ff_h264_direct_dist_scale_factor\r
-ff_h264_direct_ref_list_init\r
-ff_h264_execute_ref_pic_marking\r
-ff_h264_fill_default_ref_list\r
-ff_h264_fill_mbaff_ref_list\r
-ff_h264_filter_mb\r
-ff_h264_filter_mb_fast\r
-ff_h264_find_frame_end\r
-ff_h264_frame_start\r
-ff_h264_free_context\r
-ff_h264_get_slice_type\r
-ff_h264_hl_decode_mb\r
-ff_h264_idct8_add4_c\r
-ff_h264_idct8_add_c\r
-ff_h264_idct8_dc_add_c\r
-ff_h264_idct_add16_c\r
-ff_h264_idct_add16intra_c\r
-ff_h264_idct_add8_c\r
-ff_h264_idct_add_c\r
-ff_h264_idct_dc_add_c\r
-ff_h264_init_cabac_states\r
-ff_h264_lowres_idct_add_c\r
-ff_h264_lowres_idct_put_c\r
-ff_h264_lps_range\r
-ff_h264_lps_state\r
-ff_h264_mlps_state\r
-ff_h264_mps_state\r
-ff_h264_norm_shift\r
-ff_h264_pred_direct_motion\r
-ff_h264_pred_init\r
-ff_h264_remove_all_refs\r
-ff_h264_reset_sei\r
-ff_h264_write_back_intra_pred_mode\r
-ff_h264dsp_init\r
-ff_h264dsp_init_x86\r
-ff_huff_build_tree\r
-ff_hwaccel_pixfmt_list_420\r
-ff_idct_xvid_mmx\r
-ff_idct_xvid_mmx2\r
-ff_idct_xvid_sse2\r
-ff_idct_xvid_sse2_add\r
-ff_idct_xvid_sse2_put\r
-ff_iir_filter\r
-ff_iir_filter_free_coeffs\r
-ff_iir_filter_free_state\r
-ff_iir_filter_init_coeffs\r
-ff_iir_filter_init_state\r
-ff_imdct_calc_c\r
-ff_imdct_half_c\r
-ff_img_copy_plane\r
-ff_init_block_index\r
-ff_init_cabac_decoder\r
-ff_init_cabac_encoder\r
-ff_init_cabac_states\r
-ff_init_elbg\r
-ff_init_ff_cos_tabs\r
-ff_init_ff_sine_windows\r
-ff_init_me\r
-ff_init_qscale_tab\r
-ff_init_range_decoder\r
-ff_init_range_encoder\r
-ff_init_scantable\r
-ff_intel_h263_decode_picture_header\r
-ff_inter_intra_vlc\r
-ff_interleaved_dirac_golomb_vlc_code\r
-ff_interleaved_golomb_vlc_len\r
-ff_interleaved_se_golomb_vlc_code\r
-ff_interleaved_ue_golomb_vlc_code\r
-ff_intrax8_common_end\r
-ff_intrax8_common_init\r
-ff_intrax8_decode_picture\r
-ff_intrax8dsp_init\r
-ff_inv_aanscales\r
-ff_inverse\r
-ff_is_hwaccel_pix_fmt\r
-ff_ivi_blk_huff_desc\r
-ff_ivi_blk_vlc_tabs\r
-ff_ivi_col_slant8\r
-ff_ivi_create_huff_from_desc\r
-ff_ivi_dc_col_slant\r
-ff_ivi_dc_row_slant\r
-ff_ivi_dc_slant_2d\r
-ff_ivi_dec_huff_desc\r
-ff_ivi_dec_tile_data_size\r
-ff_ivi_decode_blocks\r
-ff_ivi_free_buffers\r
-ff_ivi_huff_desc_cmp\r
-ff_ivi_huff_desc_copy\r
-ff_ivi_init_planes\r
-ff_ivi_init_static_vlc\r
-ff_ivi_init_tiles\r
-ff_ivi_inverse_slant_4x4\r
-ff_ivi_inverse_slant_8x8\r
-ff_ivi_mb_huff_desc\r
-ff_ivi_mb_vlc_tabs\r
-ff_ivi_mc_4x4_delta\r
-ff_ivi_mc_4x4_no_delta\r
-ff_ivi_mc_8x8_delta\r
-ff_ivi_mc_8x8_no_delta\r
-ff_ivi_output_plane\r
-ff_ivi_process_empty_tile\r
-ff_ivi_put_dc_pixel_8x8\r
-ff_ivi_put_pixels_8x8\r
-ff_ivi_recompose53\r
-ff_ivi_row_slant8\r
-ff_ivi_rvmap_tabs\r
-ff_jpeg_fdct_islow\r
-ff_jpegls_decode_lse\r
-ff_jpegls_decode_picture\r
-ff_jpegls_init_state\r
-ff_jpegls_reset_coding_parameters\r
-ff_kbd_window_init\r
-ff_left_modifier_c\r
-ff_left_modifier_l\r
-ff_lockmgr_cb\r
-ff_log2\r
-ff_log2_run\r
-ff_lpc_calc_coefs\r
-ff_lpc_compute_autocorr\r
-ff_lpc_compute_autocorr_sse2\r
-ff_lsp2polyf\r
-ff_lzw_cur_ptr\r
-ff_lzw_decode\r
-ff_lzw_decode_close\r
-ff_lzw_decode_init\r
-ff_lzw_decode_open\r
-ff_lzw_decode_tail\r
-ff_lzw_encode\r
-ff_lzw_encode_flush\r
-ff_lzw_encode_init\r
-ff_lzw_encode_state_size\r
-ff_match_2uint16\r
-ff_mb_non_intra_vlc\r
-ff_mba_length\r
-ff_mba_max\r
-ff_mdct_calc_c\r
-ff_mdct_end\r
-ff_mdct_init\r
-ff_mjpeg_bits_ac_chrominance\r
-ff_mjpeg_bits_ac_luminance\r
-ff_mjpeg_bits_dc_chrominance\r
-ff_mjpeg_bits_dc_luminance\r
-ff_mjpeg_build_huffman_codes\r
-ff_mjpeg_decode_dht\r
-ff_mjpeg_decode_dqt\r
-ff_mjpeg_decode_end\r
-ff_mjpeg_decode_frame\r
-ff_mjpeg_decode_init\r
-ff_mjpeg_decode_sof\r
-ff_mjpeg_decode_sos\r
-ff_mjpeg_encode_close\r
-ff_mjpeg_encode_dc\r
-ff_mjpeg_encode_init\r
-ff_mjpeg_encode_mb\r
-ff_mjpeg_encode_picture_header\r
-ff_mjpeg_encode_picture_trailer\r
-ff_mjpeg_encode_stuffing\r
-ff_mjpeg_val_ac_chrominance\r
-ff_mjpeg_val_ac_luminance\r
-ff_mjpeg_val_dc\r
-ff_mlp_calculate_parity\r
-ff_mlp_checksum16\r
-ff_mlp_checksum8\r
-ff_mlp_huffman_tables\r
-ff_mlp_init\r
-ff_mlp_init_crc\r
-ff_mlp_init_x86\r
-ff_mlp_read_major_sync\r
-ff_mlp_restart_checksum\r
-ff_mmx_idct\r
-ff_mmxext_idct\r
-ff_mpa_alloc_tables\r
-ff_mpa_bitrate_tab\r
-ff_mpa_decode_header\r
-ff_mpa_enwindow\r
-ff_mpa_freq_tab\r
-ff_mpa_l2_select_table\r
-ff_mpa_quant_bits\r
-ff_mpa_quant_steps\r
-ff_mpa_sblimit_table\r
-ff_mpa_synth_filter\r
-ff_mpa_synth_init\r
-ff_mpa_synth_window\r
-ff_mpc_dequantize_and_synth\r
-ff_mpc_init\r
-ff_mpeg12_common_init\r
-ff_mpeg12_init_vlcs\r
-ff_mpeg12_mbAddrIncrTable\r
-ff_mpeg12_mbMotionVectorTable\r
-ff_mpeg12_mbPatTable\r
-ff_mpeg12_static_rl_table_store\r
-ff_mpeg12_vlc_dc_chroma_bits\r
-ff_mpeg12_vlc_dc_chroma_code\r
-ff_mpeg12_vlc_dc_lum_bits\r
-ff_mpeg12_vlc_dc_lum_code\r
-ff_mpeg1_aspect\r
-ff_mpeg1_clean_buffers\r
-ff_mpeg1_dc_scale_table\r
-ff_mpeg1_decode_block_intra\r
-ff_mpeg1_default_intra_matrix\r
-ff_mpeg1_default_non_intra_matrix\r
-ff_mpeg1_encode_init\r
-ff_mpeg1_encode_slice_header\r
-ff_mpeg1_find_frame_end\r
-ff_mpeg2_aspect\r
-ff_mpeg2_dc_scale_table\r
-ff_mpeg4_DCtab_chrom\r
-ff_mpeg4_DCtab_lum\r
-ff_mpeg4_c_dc_scale_table\r
-ff_mpeg4_clean_buffers\r
-ff_mpeg4_decode_partitions\r
-ff_mpeg4_decode_picture_header\r
-ff_mpeg4_default_intra_matrix\r
-ff_mpeg4_default_non_intra_matrix\r
-ff_mpeg4_encode_video_packet_header\r
-ff_mpeg4_find_frame_end\r
-ff_mpeg4_get_video_packet_prefix_length\r
-ff_mpeg4_init_direct_mv\r
-ff_mpeg4_init_partitions\r
-ff_mpeg4_intra_level\r
-ff_mpeg4_intra_run\r
-ff_mpeg4_intra_vlc\r
-ff_mpeg4_merge_partitions\r
-ff_mpeg4_resync_prefix\r
-ff_mpeg4_rl_intra\r
-ff_mpeg4_set_direct_mv\r
-ff_mpeg4_static_rl_table_store\r
-ff_mpeg4_stuffing\r
-ff_mpeg4_y_dc_scale_table\r
-ff_mpeg4audio_channels\r
-ff_mpeg4audio_get_config\r
-ff_mpeg4audio_sample_rates\r
-ff_mpeg4video_split\r
-ff_mpeg_flush\r
-ff_mpegaudio_decode_header\r
-ff_msmp4_dc_chroma_vlc\r
-ff_msmp4_dc_luma_vlc\r
-ff_msmp4_mb_i_table\r
-ff_msmp4_mb_i_vlc\r
-ff_msmpeg4_code012\r
-ff_msmpeg4_coded_block_pred\r
-ff_msmpeg4_decode_block\r
-ff_msmpeg4_decode_init\r
-ff_msmpeg4_decode_motion\r
-ff_msmpeg4_encode_block\r
-ff_msmpeg4_encode_init\r
-ff_msmpeg4_encode_motion\r
-ff_msmpeg4_handle_slices\r
-ff_mspel_motion\r
-ff_msrle_decode\r
-ff_nelly_band_sizes_table\r
-ff_nelly_delta_table\r
-ff_nelly_dequantization_table\r
-ff_nelly_get_sample_bits\r
-ff_nelly_init_table\r
-ff_parse1_close\r
-ff_parse_and_eval_expr\r
-ff_parse_close\r
-ff_parse_expr\r
-ff_pb_1\r
-ff_pb_1F\r
-ff_pb_3\r
-ff_pb_3F\r
-ff_pb_7\r
-ff_pb_81\r
-ff_pb_A1\r
-ff_pb_FC\r
-ff_pd_1\r
-ff_pd_2\r
-ff_pdw_80000000\r
-ff_pixfmt_list_420\r
-ff_pnm_decode_header\r
-ff_pnm_end\r
-ff_pnm_init\r
-ff_pow_0_5\r
-ff_pow_0_55\r
-ff_pow_0_7\r
-ff_pow_0_75\r
-ff_pre_estimate_p_frame_motion\r
-ff_print_debug_info\r
-ff_psy_end\r
-ff_psy_init\r
-ff_psy_preprocess\r
-ff_psy_preprocess_end\r
-ff_psy_preprocess_init\r
-ff_psy_set_band_info\r
-ff_psy_suggest_window\r
-ff_put_cavs_qpel16_mc00_c\r
-ff_put_cavs_qpel16_mc00_mmx2\r
-ff_put_cavs_qpel8_mc00_c\r
-ff_put_cavs_qpel8_mc00_mmx2\r
-ff_put_no_rnd_qpel16_mc11_old_c\r
-ff_put_no_rnd_qpel16_mc12_old_c\r
-ff_put_no_rnd_qpel16_mc13_old_c\r
-ff_put_no_rnd_qpel16_mc31_old_c\r
-ff_put_no_rnd_qpel16_mc32_old_c\r
-ff_put_no_rnd_qpel16_mc33_old_c\r
-ff_put_no_rnd_qpel8_mc11_old_c\r
-ff_put_no_rnd_qpel8_mc12_old_c\r
-ff_put_no_rnd_qpel8_mc13_old_c\r
-ff_put_no_rnd_qpel8_mc31_old_c\r
-ff_put_no_rnd_qpel8_mc32_old_c\r
-ff_put_no_rnd_qpel8_mc33_old_c\r
-ff_put_qpel16_mc11_old_c\r
-ff_put_qpel16_mc12_old_c\r
-ff_put_qpel16_mc13_old_c\r
-ff_put_qpel16_mc31_old_c\r
-ff_put_qpel16_mc32_old_c\r
-ff_put_qpel16_mc33_old_c\r
-ff_put_qpel8_mc11_old_c\r
-ff_put_qpel8_mc12_old_c\r
-ff_put_qpel8_mc13_old_c\r
-ff_put_qpel8_mc31_old_c\r
-ff_put_qpel8_mc32_old_c\r
-ff_put_qpel8_mc33_old_c\r
-ff_put_string\r
-ff_put_vc1_mspel_mc00_c\r
-ff_put_vc1_mspel_mc00_mmx\r
-ff_pw_128\r
-ff_pw_15\r
-ff_pw_16\r
-ff_pw_20\r
-ff_pw_255\r
-ff_pw_28\r
-ff_pw_3\r
-ff_pw_32\r
-ff_pw_4\r
-ff_pw_42\r
-ff_pw_5\r
-ff_pw_64\r
-ff_pw_8\r
-ff_pw_9\r
-ff_pw_96\r
-ff_rac_terminate\r
-ff_rate_control_init\r
-ff_rate_control_uninit\r
-ff_rate_estimate_qscale\r
-ff_raw_pixelFormatTags\r
-ff_rdft_end\r
-ff_rdft_init\r
-ff_rl_mpeg1\r
-ff_rl_mpeg2\r
-ff_rle_encode\r
-ff_rv30dsp_init\r
-ff_rv34_decode_end\r
-ff_rv34_decode_frame\r
-ff_rv34_decode_init\r
-ff_rv34_get_start_offset\r
-ff_rv40dsp_init\r
-ff_sbr_apply\r
-ff_scale_vector_to_given_sum_of_squares\r
-ff_se_golomb_vlc_code\r
-ff_set_cmp\r
-ff_set_fixed_vector\r
-ff_set_min_dist_lsf\r
-ff_set_mpeg4_time\r
-ff_set_qscale\r
-ff_set_systematic_pal\r
-ff_shrink22\r
-ff_shrink44\r
-ff_shrink88\r
-ff_simple_idct\r
-ff_simple_idct248_put\r
-ff_simple_idct44_add\r
-ff_simple_idct48_add\r
-ff_simple_idct84_add\r
-ff_simple_idct_add\r
-ff_simple_idct_add_mmx\r
-ff_simple_idct_mmx\r
-ff_simple_idct_put\r
-ff_simple_idct_put_mmx\r
-ff_sin_1024\r
-ff_sin_128\r
-ff_sin_16\r
-ff_sin_16384\r
-ff_sin_2048\r
-ff_sin_256\r
-ff_sin_32\r
-ff_sin_32768\r
-ff_sin_4096\r
-ff_sin_512\r
-ff_sin_64\r
-ff_sin_65536\r
-ff_sin_8192\r
-ff_sin_tabs\r
-ff_sine_1024\r
-ff_sine_128\r
-ff_sine_2048\r
-ff_sine_256\r
-ff_sine_32\r
-ff_sine_4096\r
-ff_sine_512\r
-ff_sine_64\r
-ff_sine_window_init\r
-ff_sine_windows\r
-ff_sipr_decode_frame_16k\r
-ff_sipr_init_16k\r
-ff_slice_buffer_destroy\r
-ff_slice_buffer_flush\r
-ff_slice_buffer_init\r
-ff_slice_buffer_load_line\r
-ff_slice_buffer_release\r
-ff_snow_horizontal_compose97i\r
-ff_snow_inner_add_yblock\r
-ff_snow_vertical_compose97i\r
-ff_sort_nearly_sorted_floats\r
-ff_spatial_dwt\r
-ff_spatial_idwt\r
-ff_spatial_idwt_buffered_init\r
-ff_spatial_idwt_buffered_slice\r
-ff_spatial_idwt_init\r
-ff_spatial_idwt_slice\r
-ff_split_xiph_headers\r
-ff_squareTbl\r
-ff_svq1_block_type_vlc\r
-ff_svq1_frame_size_table\r
-ff_svq1_inter_codebooks\r
-ff_svq1_inter_mean_vlc\r
-ff_svq1_inter_multistage_vlc\r
-ff_svq1_intra_codebooks\r
-ff_svq1_intra_mean_vlc\r
-ff_svq1_intra_multistage_vlc\r
-ff_svq1_packet_checksum\r
-ff_svq3_add_idct_c\r
-ff_svq3_luma_dc_dequant_idct_c\r
-ff_swb_offset_1024\r
-ff_swb_offset_128\r
-ff_synth_filter_init\r
-ff_table0_dc_chroma\r
-ff_table0_dc_lum\r
-ff_table1_dc_chroma\r
-ff_table1_dc_lum\r
-ff_tilt_compensation\r
-ff_tns_max_bands_1024\r
-ff_tns_max_bands_128\r
-ff_top_modifier_c\r
-ff_top_modifier_l\r
-ff_ue_golomb_len\r
-ff_ue_golomb_vlc_code\r
-ff_update_duplicate_context\r
-ff_vbv_update\r
-ff_vc1_4mv_block_pattern_bits\r
-ff_vc1_4mv_block_pattern_codes\r
-ff_vc1_4mv_block_pattern_vlc\r
-ff_vc1_ac_coeff_table\r
-ff_vc1_adv_interlaced_4x4_zz\r
-ff_vc1_adv_interlaced_4x8_zz\r
-ff_vc1_adv_interlaced_8x4_zz\r
-ff_vc1_adv_interlaced_8x8_zz\r
-ff_vc1_adv_progressive_4x8_zz\r
-ff_vc1_adv_progressive_8x4_zz\r
-ff_vc1_bfraction_bits\r
-ff_vc1_bfraction_codes\r
-ff_vc1_bfraction_lut\r
-ff_vc1_bfraction_vlc\r
-ff_vc1_cbpcy_p_bits\r
-ff_vc1_cbpcy_p_codes\r
-ff_vc1_cbpcy_p_vlc\r
-ff_vc1_dqscale\r
-ff_vc1_fps_dr\r
-ff_vc1_fps_nr\r
-ff_vc1_imode_bits\r
-ff_vc1_imode_codes\r
-ff_vc1_imode_vlc\r
-ff_vc1_mv_diff_bits\r
-ff_vc1_mv_diff_codes\r
-ff_vc1_mv_diff_vlc\r
-ff_vc1_mv_pmode_table\r
-ff_vc1_mv_pmode_table2\r
-ff_vc1_norm2_bits\r
-ff_vc1_norm2_codes\r
-ff_vc1_norm2_vlc\r
-ff_vc1_norm6_bits\r
-ff_vc1_norm6_codes\r
-ff_vc1_norm6_vlc\r
-ff_vc1_pixel_aspect\r
-ff_vc1_pquant_table\r
-ff_vc1_simple_progressive_4x4_zz\r
-ff_vc1_subblkpat_bits\r
-ff_vc1_subblkpat_codes\r
-ff_vc1_subblkpat_vlc\r
-ff_vc1_ttblk_bits\r
-ff_vc1_ttblk_codes\r
-ff_vc1_ttblk_to_tt\r
-ff_vc1_ttblk_vlc\r
-ff_vc1_ttfrm_to_tt\r
-ff_vc1_ttmb_bits\r
-ff_vc1_ttmb_codes\r
-ff_vc1_ttmb_vlc\r
-ff_vc1dsp_init\r
-ff_vc1dsp_init_mmx\r
-ff_vector_fmul_window_c\r
-ff_vorbis_channel_layout_offsets\r
-ff_vorbis_channel_layouts\r
-ff_vorbis_floor1_inverse_db_table\r
-ff_vorbis_floor1_render_list\r
-ff_vorbis_len2vlc\r
-ff_vorbis_nth_root\r
-ff_vorbis_ready_floor1_list\r
-ff_vorbis_vwin\r
-ff_vp3_h_loop_filter_c\r
-ff_vp3_h_loop_filter_mmx2\r
-ff_vp3_idct_add_c\r
-ff_vp3_idct_add_mmx\r
-ff_vp3_idct_add_sse2\r
-ff_vp3_idct_c\r
-ff_vp3_idct_data\r
-ff_vp3_idct_dc_add_c\r
-ff_vp3_idct_dc_add_mmx2\r
-ff_vp3_idct_mmx\r
-ff_vp3_idct_put_c\r
-ff_vp3_idct_put_mmx\r
-ff_vp3_idct_put_sse2\r
-ff_vp3_idct_sse2\r
-ff_vp3_v_loop_filter_c\r
-ff_vp3_v_loop_filter_mmx2\r
-ff_vp56dsp_init\r
-ff_vp6_filter_diag4_c\r
-ff_vp6_filter_diag4_mmx\r
-ff_vp6_filter_diag4_sse2\r
-ff_w53_32_c\r
-ff_w97_32_c\r
-ff_weighted_vector_sumf\r
-ff_wma_critical_freqs\r
-ff_wma_end\r
-ff_wma_get_frame_len_bits\r
-ff_wma_get_large_val\r
-ff_wma_hgain_huffbits\r
-ff_wma_hgain_huffcodes\r
-ff_wma_init\r
-ff_wma_lsp_codebook\r
-ff_wma_run_level_decode\r
-ff_wma_total_gain_to_bits\r
-ff_wmv2_add_mb\r
-ff_wmv2_common_init\r
-ff_wmv2_decode_mb\r
-ff_wmv2_decode_picture_header\r
-ff_wmv2_decode_secondary_picture_header\r
-ff_wmv2_encode_mb\r
-ff_wmv2_encode_picture_header\r
-ff_wmv2_idct_c\r
-ff_write_pass1_stats\r
-ff_write_quant_matrix\r
-ff_wtwo\r
-ff_zigzag248_direct\r
-ff_zigzag_direct\r
-ffv1_decoder\r
-ffv1_encoder\r
-ffvhuff_decoder\r
-ffvhuff_encoder\r
-flac_decoder\r
-flac_encoder\r
-flic_decoder\r
-flv_decoder\r
-flv_encoder\r
-fourxm_decoder\r
-fraps_decoder\r
-free_vlc\r
-frwu_decoder\r
-gif_decoder\r
-gif_encoder\r
-h261_decoder\r
-h261_encoder\r
-h261_parser\r
-h263_decode_init_vlc\r
-h263_decode_motion\r
-h263_decode_picture_header\r
-h263_decoder\r
-h263_encode_gob_header\r
-h263_encode_init\r
-h263_encode_mb\r
-h263_encode_picture_header\r
-h263_encoder\r
-h263_format\r
-h263_mbtype_b_tab\r
-h263_parser\r
-h263_pred_acdc\r
-h263_pred_dc\r
-h263_pred_motion\r
-h263i_decoder\r
-h263p_encoder\r
-h264_decoder\r
-h264_mp4toannexb_bsf\r
-h264_parser\r
-huffyuv_decoder\r
-huffyuv_encoder\r
-idcin_decoder\r
-iff_byterun1_decoder\r
-iff_ilbm_decoder\r
-imc_decoder\r
-img_get_alpha_info\r
-imx_dump_header_bsf\r
-indeo2_decoder\r
-indeo3_decoder\r
-indeo5_decoder\r
-init_rl\r
-init_vlc_rl\r
-init_vlc_sparse\r
-inter_level\r
-inter_run\r
-inter_rvlc\r
-inter_vlc\r
-interplay_dpcm_decoder\r
-interplay_video_decoder\r
-intra_rvlc\r
-inv_zigzag_direct16\r
-j_rev_dct\r
-j_rev_dct1\r
-j_rev_dct2\r
-j_rev_dct4\r
-jpegls_decoder\r
-jpegls_encoder\r
-kgv1_decoder\r
-kmvc_decoder\r
-ljpeg_encoder\r
-loco_decoder\r
-mace3_decoder\r
-mace6_decoder\r
-mb_type_b_tab\r
-mdec_decoder\r
-mimic_decoder\r
-mjpeg_decoder\r
-mjpeg_encoder\r
-mjpeg_parser\r
-mjpega_dump_header_bsf\r
-mjpegb_decoder\r
-mlp_decoder\r
-mlp_parser\r
-mm_flags\r
-mm_support\r
-mmvideo_decoder\r
-modified_quant_tab\r
-motionpixels_decoder\r
-mov2textsub_bsf\r
-mp1_decoder\r
-mp2_decoder\r
-mp2_encoder\r
-mp3_decoder\r
-mp3_header_compress_bsf\r
-mp3_header_decompress_bsf\r
-mp3adu_decoder\r
-mp3on4_decoder\r
-mpc7_decoder\r
-mpc8_decoder\r
-mpeg1_encode_mb\r
-mpeg1_encode_picture_header\r
-mpeg1video_decoder\r
-mpeg1video_encoder\r
-mpeg2video_decoder\r
-mpeg2video_encoder\r
-mpeg4_dc_threshold\r
-mpeg4_decode_video_packet_header\r
-mpeg4_decoder\r
-mpeg4_encode_mb\r
-mpeg4_encode_picture_header\r
-mpeg4_encoder\r
-mpeg4_pred_ac\r
-mpeg4video_parser\r
-mpegaudio_parser\r
-mpegvideo_decoder\r
-mpegvideo_parser\r
-msmpeg4_decode_ext_header\r
-msmpeg4_decode_picture_header\r
-msmpeg4_encode_ext_header\r
-msmpeg4_encode_mb\r
-msmpeg4_encode_picture_header\r
-msmpeg4v1_decoder\r
-msmpeg4v1_encoder\r
-msmpeg4v2_decoder\r
-msmpeg4v2_encoder\r
-msmpeg4v3_decoder\r
-msmpeg4v3_encoder\r
-msrle_decoder\r
-msvideo1_decoder\r
-mszh_decoder\r
-mv_tables\r
-mvtab\r
-nellymoser_decoder\r
-nellymoser_encoder\r
-noise_bsf\r
-nuv_decoder\r
-old_ff_y_dc_scale_table\r
-pam_decoder\r
-pam_encoder\r
-pbm_decoder\r
-pbm_encoder\r
-pcm_alaw_decoder\r
-pcm_alaw_encoder\r
-pcm_bluray_decoder\r
-pcm_dvd_decoder\r
-pcm_dvd_encoder\r
-pcm_f32be_decoder\r
-pcm_f32be_encoder\r
-pcm_f32le_decoder\r
-pcm_f32le_encoder\r
-pcm_f64be_decoder\r
-pcm_f64be_encoder\r
-pcm_f64le_decoder\r
-pcm_f64le_encoder\r
-pcm_mulaw_decoder\r
-pcm_mulaw_encoder\r
-pcm_s16be_decoder\r
-pcm_s16be_encoder\r
-pcm_s16le_decoder\r
-pcm_s16le_encoder\r
-pcm_s16le_planar_decoder\r
-pcm_s24be_decoder\r
-pcm_s24be_encoder\r
-pcm_s24daud_decoder\r
-pcm_s24daud_encoder\r
-pcm_s24le_decoder\r
-pcm_s24le_encoder\r
-pcm_s32be_decoder\r
-pcm_s32be_encoder\r
-pcm_s32le_decoder\r
-pcm_s32le_encoder\r
-pcm_s8_decoder\r
-pcm_s8_encoder\r
-pcm_u16be_decoder\r
-pcm_u16be_encoder\r
-pcm_u16le_decoder\r
-pcm_u16le_encoder\r
-pcm_u24be_decoder\r
-pcm_u24be_encoder\r
-pcm_u24le_decoder\r
-pcm_u24le_encoder\r
-pcm_u32be_decoder\r
-pcm_u32be_encoder\r
-pcm_u32le_decoder\r
-pcm_u32le_encoder\r
-pcm_u8_decoder\r
-pcm_u8_encoder\r
-pcm_zork_decoder\r
-pcm_zork_encoder\r
-pcx_decoder\r
-pcx_encoder\r
-pgm_decoder\r
-pgm_encoder\r
-pgmyuv_decoder\r
-pgmyuv_encoder\r
-pgssub_decoder\r
-pnm_parser\r
-ppm_decoder\r
-ppm_encoder\r
-ptx_decoder\r
-put_pixels_clamped_mmx\r
-put_signed_pixels_clamped_mmx\r
-qcelp_decoder\r
-qdm2_decoder\r
-qdraw_decoder\r
-qmf_window\r
-qpeg_decoder\r
-qtrle_decoder\r
-qtrle_encoder\r
-r210_decoder\r
-ra_144_decoder\r
-ra_288_decoder\r
-rawvideo_decoder\r
-rawvideo_encoder\r
-register_avcodec\r
-remove_extradata_bsf\r
-rl2_decoder\r
-rl_intra_aic\r
-rl_table\r
-roq_decoder\r
-roq_dpcm_decoder\r
-roq_dpcm_encoder\r
-roq_encoder\r
-rpza_decoder\r
-rtjpeg_decode_frame_yuv420\r
-rtjpeg_decode_init\r
-rv10_decoder\r
-rv10_encode_picture_header\r
-rv10_encoder\r
-rv20_decoder\r
-rv20_encode_picture_header\r
-rv20_encoder\r
-rv30_decoder\r
-rv40_decoder\r
-rv_decode_dc\r
-rvlc_rl_inter\r
-rvlc_rl_intra\r
-sf_table\r
-sgi_decoder\r
-sgi_encoder\r
-shorten_decoder\r
-sipr_decoder\r
-smackaud_decoder\r
-smacker_decoder\r
-smc_decoder\r
-snow_decoder\r
-snow_encoder\r
-sol_dpcm_decoder\r
-sonic_decoder\r
-sonic_encoder\r
-sonic_ls_encoder\r
-sp5x_decoder\r
-sprite_trajectory_tab\r
-sunrast_decoder\r
-svq1_decoder\r
-svq1_encoder\r
-svq3_decoder\r
-table_inter_intra\r
-table_mb_non_intra\r
-targa_decoder\r
-targa_encoder\r
-text2movsub_bsf\r
-theora_decoder\r
-thp_decoder\r
-tiertexseqvideo_decoder\r
-tiff_decoder\r
-tiff_encoder\r
-tmv_decoder\r
-truehd_decoder\r
-truemotion1_decoder\r
-truemotion2_decoder\r
-truespeech_decoder\r
-tta_decoder\r
-twinvq_decoder\r
-txd_decoder\r
-ulti_decoder\r
-v210_decoder\r
-v210_encoder\r
-v210x_decoder\r
-v2_intra_cbpc\r
-v2_mb_type\r
-vb_decoder\r
-vc1_decode_entry_point\r
-vc1_decode_sequence_header\r
-vc1_decoder\r
-vc1_parse_frame_header\r
-vc1_parse_frame_header_adv\r
-vc1_parser\r
-vcr1_decoder\r
-vmdaudio_decoder\r
-vmdvideo_decoder\r
-vmnc_decoder\r
-vorbis_decoder\r
-vorbis_inverse_coupling\r
-vp3_decoder\r
-vp3_parser\r
-vp56_b2p\r
-vp56_b6to4\r
-vp56_coeff_bias\r
-vp56_coeff_bit_length\r
-vp56_coeff_parse_table\r
-vp56_decode_frame\r
-vp56_def_mb_types_stats\r
-vp56_free\r
-vp56_init\r
-vp56_init_dequant\r
-vp56_pc_tree\r
-vp56_pva_tree\r
-vp5_decoder\r
-vp6_decoder\r
-vp6a_decoder\r
-vp6f_decoder\r
-vqa_decoder\r
-wavpack_decoder\r
-wmapro_decoder\r
-wmav1_decoder\r
-wmav1_encoder\r
-wmav2_decoder\r
-wmav2_encoder\r
-wmavoice_decoder\r
-wmv1_c_dc_scale_table\r
-wmv1_decoder\r
-wmv1_encoder\r
-wmv1_scantable\r
-wmv1_y_dc_scale_table\r
-wmv2_decoder\r
-wmv2_encoder\r
-wmv2_inter_table\r
-wmv2_scantableA\r
-wmv2_scantableB\r
-wmv3_dc_scale_table\r
-wmv3_decoder\r
-wnv1_decoder\r
-ws_snd1_decoder\r
-xan_dpcm_decoder\r
-xan_wc3_decoder\r
-xl_decoder\r
-xsub_decoder\r
-xsub_encoder\r
-yop_decoder\r
diff --git a/ffmpeg 0.6/lib/avcodec-52.dll b/ffmpeg 0.6/lib/avcodec-52.dll
deleted file mode 100644 (file)
index 6cda466..0000000
Binary files a/ffmpeg 0.6/lib/avcodec-52.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avcodec-52.exp b/ffmpeg 0.6/lib/avcodec-52.exp
deleted file mode 100644 (file)
index af4c4c8..0000000
Binary files a/ffmpeg 0.6/lib/avcodec-52.exp and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avcodec-52.lib b/ffmpeg 0.6/lib/avcodec-52.lib
deleted file mode 100644 (file)
index 60d7e3f..0000000
Binary files a/ffmpeg 0.6/lib/avcodec-52.lib and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avcore-0.dll b/ffmpeg 0.6/lib/avcore-0.dll
deleted file mode 100644 (file)
index be04b90..0000000
Binary files a/ffmpeg 0.6/lib/avcore-0.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avdevice-52.def b/ffmpeg 0.6/lib/avdevice-52.def
deleted file mode 100644 (file)
index aec18e7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-LIBRARY avdevice-52.dll\r
-\r
-EXPORTS\r
-avdevice_configuration\r
-avdevice_license\r
-avdevice_register_all\r
-avdevice_version\r
diff --git a/ffmpeg 0.6/lib/avdevice-52.dll b/ffmpeg 0.6/lib/avdevice-52.dll
deleted file mode 100644 (file)
index 6c99478..0000000
Binary files a/ffmpeg 0.6/lib/avdevice-52.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avdevice-52.exp b/ffmpeg 0.6/lib/avdevice-52.exp
deleted file mode 100644 (file)
index 1549be9..0000000
Binary files a/ffmpeg 0.6/lib/avdevice-52.exp and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avdevice-52.lib b/ffmpeg 0.6/lib/avdevice-52.lib
deleted file mode 100644 (file)
index c702969..0000000
Binary files a/ffmpeg 0.6/lib/avdevice-52.lib and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avformat-52.def b/ffmpeg 0.6/lib/avformat-52.def
deleted file mode 100644 (file)
index 1130829..0000000
+++ /dev/null
@@ -1,619 +0,0 @@
-LIBRARY avformat-52.dll\r
-\r
-EXPORTS\r
-RTPFirstDynamicPayloadHandler\r
-_get_output_format\r
-aac_demuxer\r
-ac3_demuxer\r
-ac3_muxer\r
-adts_muxer\r
-aea_demuxer\r
-aiff_demuxer\r
-aiff_muxer\r
-amr_demuxer\r
-amr_muxer\r
-anm_demuxer\r
-apc_demuxer\r
-ape_demuxer\r
-asf_demuxer\r
-asf_muxer\r
-asf_stream_muxer\r
-ass_demuxer\r
-ass_muxer\r
-au_demuxer\r
-au_muxer\r
-av_add_index_entry\r
-av_alloc_format_context\r
-av_alloc_put_byte\r
-av_close_input_file\r
-av_close_input_stream\r
-av_codec_get_id\r
-av_codec_get_tag\r
-av_convert_lang_to\r
-av_destruct_packet@LIBAVFORMAT_52\r
-av_destruct_packet_nofree@LIBAVFORMAT_52\r
-av_dup_packet@LIBAVFORMAT_52\r
-av_filename_number_test\r
-av_find_default_stream_index\r
-av_find_input_format\r
-av_find_stream_info\r
-av_free_packet@LIBAVFORMAT_52\r
-av_gen_search\r
-av_get_frame_filename\r
-av_get_packet\r
-av_gettime\r
-av_guess_codec\r
-av_guess_format\r
-av_guess_image2_codec\r
-av_hex_dump\r
-av_hex_dump_log\r
-av_iformat_next\r
-av_index_search_timestamp\r
-av_init_packet@LIBAVFORMAT_52\r
-av_interleave_packet_per_dts\r
-av_interleaved_write_frame\r
-av_match_ext\r
-av_metadata_conv\r
-av_metadata_free\r
-av_metadata_get\r
-av_metadata_set\r
-av_metadata_set2\r
-av_new_packet@LIBAVFORMAT_52\r
-av_new_program\r
-av_new_stream\r
-av_oformat_next\r
-av_open_input_file\r
-av_open_input_stream\r
-av_pkt_dump\r
-av_pkt_dump_log\r
-av_probe_input_format\r
-av_probe_input_format2\r
-av_protocol_next\r
-av_read_frame\r
-av_read_packet\r
-av_read_pause\r
-av_read_play\r
-av_register_all\r
-av_register_input_format\r
-av_register_output_format\r
-av_register_protocol\r
-av_register_rdt_dynamic_payload_handlers\r
-av_register_rtp_dynamic_payload_handlers\r
-av_seek_frame\r
-av_seek_frame_binary\r
-av_set_parameters\r
-av_set_pts_info\r
-av_update_cur_dts\r
-av_url_read_fpause\r
-av_url_read_fseek\r
-av_url_read_pause\r
-av_url_read_seek\r
-av_write_frame\r
-av_write_header\r
-av_write_trailer\r
-avf_sdp_create\r
-avformat_alloc_context\r
-avformat_configuration\r
-avformat_license\r
-avformat_seek_file\r
-avformat_version\r
-avi_demuxer\r
-avi_muxer\r
-avm2_muxer\r
-avs_demuxer\r
-bethsoftvid_demuxer\r
-bfi_demuxer\r
-bink_demuxer\r
-brktimegm\r
-c93_demuxer\r
-caf_demuxer\r
-cavsvideo_demuxer\r
-cdg_demuxer\r
-codec_movaudio_tags\r
-codec_movvideo_tags\r
-concat_protocol\r
-crc_muxer\r
-daud_demuxer\r
-daud_muxer\r
-dirac_demuxer\r
-dirac_muxer\r
-dnxhd_demuxer\r
-dnxhd_muxer\r
-dsicin_demuxer\r
-dts_demuxer\r
-dts_muxer\r
-dump_format\r
-dv_assemble_frame\r
-dv_delete_mux\r
-dv_demuxer\r
-dv_get_packet\r
-dv_init_demux\r
-dv_init_mux\r
-dv_muxer\r
-dv_offset_reset\r
-dv_produce_packet\r
-dxa_demuxer\r
-ea_cdata_demuxer\r
-ea_demuxer\r
-eac3_demuxer\r
-eac3_muxer\r
-ff_adts_decode_extradata\r
-ff_adts_write_frame_header\r
-ff_amf_get_field_value\r
-ff_amf_tag_size\r
-ff_amf_write_bool\r
-ff_amf_write_field_name\r
-ff_amf_write_null\r
-ff_amf_write_number\r
-ff_amf_write_object_end\r
-ff_amf_write_object_start\r
-ff_amf_write_string\r
-ff_amr_nb_dynamic_handler\r
-ff_amr_wb_dynamic_handler\r
-ff_ape_parse_tag\r
-ff_asf_audio_conceal_none\r
-ff_asf_audio_conceal_spread\r
-ff_asf_audio_stream\r
-ff_asf_codec_comment1_header\r
-ff_asf_codec_comment_header\r
-ff_asf_command_stream\r
-ff_asf_comment_header\r
-ff_asf_content_encryption\r
-ff_asf_data_header\r
-ff_asf_digital_signature\r
-ff_asf_ext_content_encryption\r
-ff_asf_ext_stream_audio_stream\r
-ff_asf_ext_stream_embed_stream_header\r
-ff_asf_ext_stream_header\r
-ff_asf_extended_content_header\r
-ff_asf_file_header\r
-ff_asf_head1_guid\r
-ff_asf_head2_guid\r
-ff_asf_header\r
-ff_asf_language_guid\r
-ff_asf_marker_header\r
-ff_asf_metadata_conv\r
-ff_asf_metadata_header\r
-ff_asf_my_guid\r
-ff_asf_simple_index_header\r
-ff_asf_stream_header\r
-ff_asf_video_conceal_none\r
-ff_asf_video_stream\r
-ff_asfcrypt_dec\r
-ff_audio_interleave_close\r
-ff_audio_interleave_init\r
-ff_audio_rechunk_interleave\r
-ff_avc_find_startcode\r
-ff_avc_parse_nal_units\r
-ff_avc_parse_nal_units_buf\r
-ff_avi_metadata_conv\r
-ff_avi_tags\r
-ff_codec_bmp_tags\r
-ff_codec_caf_tags\r
-ff_codec_get_id\r
-ff_codec_get_tag\r
-ff_codec_movsubtitle_tags\r
-ff_codec_wav_tags\r
-ff_crc04C11DB7_update\r
-ff_data_to_hex\r
-ff_dirac_codec\r
-ff_dynarray_add\r
-ff_end_tag\r
-ff_flac_codec\r
-ff_flac_write_header\r
-ff_free_parser_state\r
-ff_freeaddrinfo\r
-ff_gai_strerror\r
-ff_gen_syncpoint_search\r
-ff_get_v\r
-ff_get_wav_header\r
-ff_getaddrinfo\r
-ff_getnameinfo\r
-ff_h263_1998_dynamic_handler\r
-ff_h263_2000_dynamic_handler\r
-ff_h264_dynamic_handler\r
-ff_http_auth_create_response\r
-ff_http_auth_handle_header\r
-ff_id3v1_genre_str\r
-ff_id3v1_read\r
-ff_id3v2_match\r
-ff_id3v2_metadata_conv\r
-ff_id3v2_parse\r
-ff_id3v2_read\r
-ff_id3v2_tag_len\r
-ff_id3v2_tags\r
-ff_inet_aton\r
-ff_interleave_add_packet\r
-ff_interleave_compare_dts\r
-ff_isom_write_avcc\r
-ff_lsb2full\r
-ff_metadata_demux_compat\r
-ff_metadata_mux_compat\r
-ff_mkv_codec_tags\r
-ff_mkv_metadata_conv\r
-ff_mkv_mime_tags\r
-ff_mov_add_hinted_packet\r
-ff_mov_close_hinting\r
-ff_mov_get_lpcm_codec_id\r
-ff_mov_init_hinting\r
-ff_mov_iso639_to_lang\r
-ff_mov_lang_to_iso639\r
-ff_mov_read_esds\r
-ff_mov_write_packet\r
-ff_mp4_obj_type\r
-ff_mp4_read_descr_len\r
-ff_mpegts_parse_close\r
-ff_mpegts_parse_open\r
-ff_mpegts_parse_packet\r
-ff_ms_rtp_asf_pfa_handler\r
-ff_ms_rtp_asf_pfv_handler\r
-ff_mxf_codec_uls\r
-ff_mxf_data_definition_uls\r
-ff_new_chapter\r
-ff_ntp_time\r
-ff_nut_add_sp\r
-ff_nut_dispositions\r
-ff_nut_free_sp\r
-ff_nut_metadata_conv\r
-ff_nut_reset_ts\r
-ff_nut_sp_pos_cmp\r
-ff_nut_sp_pts_cmp\r
-ff_nut_subtitle_tags\r
-ff_ogm_audio_codec\r
-ff_ogm_old_codec\r
-ff_ogm_text_codec\r
-ff_ogm_video_codec\r
-ff_old_dirac_codec\r
-ff_old_flac_codec\r
-ff_parse_specific_params\r
-ff_probe_input_buffer\r
-ff_program_add_stream_index\r
-ff_put_bmp_header\r
-ff_put_str16_nolen\r
-ff_put_wav_header\r
-ff_raw_read_partial_packet\r
-ff_rdt_calc_response_and_checksum\r
-ff_rdt_parse_close\r
-ff_rdt_parse_header\r
-ff_rdt_parse_open\r
-ff_rdt_parse_packet\r
-ff_rdt_subscribe_rule\r
-ff_read_frame_flush\r
-ff_real_parse_sdp_a_line\r
-ff_reduce_index\r
-ff_register_dynamic_payload_handler\r
-ff_restore_parser_state\r
-ff_rewind_with_probe_data\r
-ff_rm_alloc_rmstream\r
-ff_rm_free_rmstream\r
-ff_rm_metadata\r
-ff_rm_parse_packet\r
-ff_rm_read_mdpr_codecdata\r
-ff_rm_reorder_sipr_data\r
-ff_rm_retrieve_cache\r
-ff_rtmp_packet_create\r
-ff_rtmp_packet_destroy\r
-ff_rtmp_packet_dump\r
-ff_rtmp_packet_read\r
-ff_rtmp_packet_write\r
-ff_rtp_codec_id\r
-ff_rtp_enc_name\r
-ff_rtp_get_codec_info\r
-ff_rtp_get_payload_type\r
-ff_rtp_send_aac\r
-ff_rtp_send_amr\r
-ff_rtp_send_data\r
-ff_rtp_send_h263\r
-ff_rtp_send_h264\r
-ff_rtp_send_mpegvideo\r
-ff_rtsp_close_streams\r
-ff_rtsp_connect\r
-ff_rtsp_next_attr_and_value\r
-ff_rtsp_parse_line\r
-ff_rtsp_read_reply\r
-ff_rtsp_send_cmd\r
-ff_rtsp_send_cmd_async\r
-ff_rtsp_send_cmd_with_content\r
-ff_rtsp_send_cmd_with_content_async\r
-ff_rtsp_skip_packet\r
-ff_sdp_write_media\r
-ff_sipr_subpk_size\r
-ff_skeleton_codec\r
-ff_socket_nonblock\r
-ff_speex_codec\r
-ff_start_tag\r
-ff_store_parser_state\r
-ff_theora_codec\r
-ff_theora_dynamic_handler\r
-ff_url_join\r
-ff_url_split\r
-ff_voc_codec_tags\r
-ff_voc_magic\r
-ff_vorbis_codec\r
-ff_vorbis_comment\r
-ff_vorbis_dynamic_handler\r
-ff_vorbiscomment_length\r
-ff_vorbiscomment_metadata_conv\r
-ff_vorbiscomment_write\r
-ff_wav_codec_get_id\r
-ff_wms_parse_sdp_a_line\r
-ffm_demuxer\r
-ffm_muxer\r
-file_protocol\r
-filmstrip_demuxer\r
-filmstrip_muxer\r
-find_info_tag\r
-first_iformat\r
-first_oformat\r
-first_protocol\r
-flac_demuxer\r
-flac_muxer\r
-flic_demuxer\r
-flv_demuxer\r
-flv_muxer\r
-fourxm_demuxer\r
-framecrc_muxer\r
-get_be16\r
-get_be24\r
-get_be32\r
-get_be64\r
-get_buffer\r
-get_byte\r
-get_checksum\r
-get_le16\r
-get_le24\r
-get_le32\r
-get_le64\r
-get_partial_buffer\r
-get_strz\r
-gif_muxer\r
-gopher_protocol\r
-gsm_demuxer\r
-guess_format\r
-guess_stream_format\r
-gxf_demuxer\r
-gxf_muxer\r
-h261_demuxer\r
-h261_muxer\r
-h263_demuxer\r
-h263_muxer\r
-h264_demuxer\r
-h264_muxer\r
-http_protocol\r
-idcin_demuxer\r
-iff_demuxer\r
-image2_demuxer\r
-image2_muxer\r
-image2pipe_demuxer\r
-image2pipe_muxer\r
-ingenient_demuxer\r
-init_checksum\r
-init_put_byte\r
-ipmovie_demuxer\r
-ipod_muxer\r
-iss_demuxer\r
-iv8_demuxer\r
-lmlm4_demuxer\r
-m4v_demuxer\r
-m4v_muxer\r
-matroska_audio_muxer\r
-matroska_demuxer\r
-matroska_muxer\r
-metadata_conv\r
-mjpeg_demuxer\r
-mjpeg_muxer\r
-mktimegm\r
-mlp_demuxer\r
-mlp_muxer\r
-mm_demuxer\r
-mmf_demuxer\r
-mmf_muxer\r
-mov_demuxer\r
-mov_muxer\r
-mp2_muxer\r
-mp3_demuxer\r
-mp3_muxer\r
-mp4_muxer\r
-mpc8_demuxer\r
-mpc_demuxer\r
-mpeg1system_muxer\r
-mpeg1vcd_muxer\r
-mpeg1video_muxer\r
-mpeg2dvd_muxer\r
-mpeg2svcd_muxer\r
-mpeg2video_muxer\r
-mpeg2vob_muxer\r
-mpegps_demuxer\r
-mpegts_demuxer\r
-mpegts_muxer\r
-mpegtsraw_demuxer\r
-mpegvideo_demuxer\r
-mpjpeg_muxer\r
-msnwc_tcp_demuxer\r
-mtv_demuxer\r
-mvi_demuxer\r
-mxf_d10_muxer\r
-mxf_demuxer\r
-mxf_muxer\r
-nc_demuxer\r
-nsv_demuxer\r
-null_muxer\r
-nut_demuxer\r
-nut_muxer\r
-nuv_demuxer\r
-ogg_demuxer\r
-ogg_muxer\r
-oma_demuxer\r
-parse_date\r
-parse_frame_rate\r
-parse_image_size\r
-pcm_alaw_demuxer\r
-pcm_alaw_muxer\r
-pcm_f32be_demuxer\r
-pcm_f32be_muxer\r
-pcm_f32le_demuxer\r
-pcm_f32le_muxer\r
-pcm_f64be_demuxer\r
-pcm_f64be_muxer\r
-pcm_f64le_demuxer\r
-pcm_f64le_muxer\r
-pcm_mulaw_demuxer\r
-pcm_mulaw_muxer\r
-pcm_read_seek\r
-pcm_s16be_demuxer\r
-pcm_s16be_muxer\r
-pcm_s16le_demuxer\r
-pcm_s16le_muxer\r
-pcm_s24be_demuxer\r
-pcm_s24be_muxer\r
-pcm_s24le_demuxer\r
-pcm_s24le_muxer\r
-pcm_s32be_demuxer\r
-pcm_s32be_muxer\r
-pcm_s32le_demuxer\r
-pcm_s32le_muxer\r
-pcm_s8_demuxer\r
-pcm_s8_muxer\r
-pcm_u16be_demuxer\r
-pcm_u16be_muxer\r
-pcm_u16le_demuxer\r
-pcm_u16le_muxer\r
-pcm_u24be_demuxer\r
-pcm_u24be_muxer\r
-pcm_u24le_demuxer\r
-pcm_u24le_muxer\r
-pcm_u32be_demuxer\r
-pcm_u32be_muxer\r
-pcm_u32le_demuxer\r
-pcm_u32le_muxer\r
-pcm_u8_demuxer\r
-pcm_u8_muxer\r
-pipe_protocol\r
-psp_muxer\r
-put_be16\r
-put_be24\r
-put_be32\r
-put_be64\r
-put_buffer\r
-put_byte\r
-put_flush_packet\r
-put_le16\r
-put_le24\r
-put_le32\r
-put_le64\r
-put_strz\r
-put_tag\r
-pva_demuxer\r
-qcp_demuxer\r
-r3d_demuxer\r
-rawvideo_demuxer\r
-rawvideo_muxer\r
-rdt_demuxer\r
-register_protocol\r
-rl2_demuxer\r
-rm_demuxer\r
-rm_muxer\r
-roq_demuxer\r
-roq_muxer\r
-rpl_demuxer\r
-rtmp_protocol\r
-rtp_check_and_send_back_rr\r
-rtp_get_file_handles\r
-rtp_get_local_port\r
-rtp_get_local_rtcp_port\r
-rtp_get_local_rtp_port\r
-rtp_muxer\r
-rtp_parse_close\r
-rtp_parse_open\r
-rtp_parse_packet\r
-rtp_parse_set_dynamic_protocol\r
-rtp_protocol\r
-rtp_send_punch_packets\r
-rtp_set_remote_url\r
-rtsp_default_protocols\r
-rtsp_demuxer\r
-rtsp_muxer\r
-sdp_demuxer\r
-segafilm_demuxer\r
-shorten_demuxer\r
-siff_demuxer\r
-smacker_demuxer\r
-small_strptime\r
-sol_demuxer\r
-sox_demuxer\r
-sox_muxer\r
-spdif_muxer\r
-str_demuxer\r
-strcasecmp\r
-strncasecmp\r
-swf_demuxer\r
-swf_muxer\r
-tcp_protocol\r
-tg2_muxer\r
-tgp_muxer\r
-thp_demuxer\r
-tiertexseq_demuxer\r
-tmv_demuxer\r
-truehd_demuxer\r
-truehd_muxer\r
-tta_demuxer\r
-txd_demuxer\r
-udp_get_file_handle\r
-udp_get_local_port\r
-udp_protocol\r
-udp_set_remote_url\r
-url_close\r
-url_close_buf\r
-url_close_dyn_buf\r
-url_exist\r
-url_fclose\r
-url_fdopen\r
-url_feof\r
-url_ferror\r
-url_fget_max_packet_size\r
-url_fgetc\r
-url_fgets\r
-url_fileno\r
-url_filesize\r
-url_fopen\r
-url_fprintf\r
-url_fseek\r
-url_fsize\r
-url_fskip\r
-url_ftell\r
-url_get_file_handle\r
-url_get_filename\r
-url_get_max_packet_size\r
-url_interrupt_cb\r
-url_open\r
-url_open_buf\r
-url_open_dyn_buf\r
-url_open_dyn_packet_buf\r
-url_open_protocol\r
-url_read\r
-url_read_complete\r
-url_resetbuf\r
-url_seek\r
-url_set_interrupt_cb\r
-url_setbufsize\r
-url_write\r
-vc1_demuxer\r
-vc1t_demuxer\r
-vc1t_muxer\r
-vmd_demuxer\r
-voc_demuxer\r
-voc_get_packet\r
-voc_muxer\r
-vqf_demuxer\r
-w64_demuxer\r
-wav_demuxer\r
-wav_muxer\r
-wc3_demuxer\r
-webm_muxer\r
-wsaud_demuxer\r
-wsvqa_demuxer\r
-wv_demuxer\r
-xa_demuxer\r
-yop_demuxer\r
-yuv4mpegpipe_demuxer\r
-yuv4mpegpipe_muxer\r
diff --git a/ffmpeg 0.6/lib/avformat-52.dll b/ffmpeg 0.6/lib/avformat-52.dll
deleted file mode 100644 (file)
index bbff2a8..0000000
Binary files a/ffmpeg 0.6/lib/avformat-52.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avformat-52.exp b/ffmpeg 0.6/lib/avformat-52.exp
deleted file mode 100644 (file)
index 15131dc..0000000
Binary files a/ffmpeg 0.6/lib/avformat-52.exp and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avformat-52.lib b/ffmpeg 0.6/lib/avformat-52.lib
deleted file mode 100644 (file)
index 833a9a3..0000000
Binary files a/ffmpeg 0.6/lib/avformat-52.lib and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avutil-50.def b/ffmpeg 0.6/lib/avutil-50.def
deleted file mode 100644 (file)
index d01123a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-LIBRARY avutil-50.dll\r
-\r
-EXPORTS\r
-av_add_q\r
-av_adler32_update\r
-av_aes_crypt\r
-av_aes_init\r
-av_aes_size\r
-av_base64_decode\r
-av_base64_encode\r
-av_bmg_get\r
-av_compare_ts\r
-av_crc\r
-av_crc_get_table\r
-av_crc_init\r
-av_d2q\r
-av_d2str\r
-av_dbl2ext\r
-av_dbl2int\r
-av_des_crypt\r
-av_des_init\r
-av_div_q\r
-av_evaluate_lls\r
-av_ext2dbl\r
-av_fifo_alloc\r
-av_fifo_drain\r
-av_fifo_free\r
-av_fifo_generic_read\r
-av_fifo_generic_write\r
-av_fifo_realloc2\r
-av_fifo_reset\r
-av_fifo_size\r
-av_fifo_space\r
-av_find_nearest_q_idx\r
-av_flt2int\r
-av_free\r
-av_freep\r
-av_gcd\r
-av_get_bits_per_pixel\r
-av_get_pix_fmt\r
-av_init_lls\r
-av_int2dbl\r
-av_int2flt\r
-av_lfg_init\r
-av_log\r
-av_log_default_callback\r
-av_log_get_level\r
-av_log_level\r
-av_log_set_callback\r
-av_log_set_level\r
-av_lzo1x_decode\r
-av_malloc\r
-av_mallocz\r
-av_md5_final\r
-av_md5_init\r
-av_md5_size\r
-av_md5_sum\r
-av_md5_update\r
-av_memcpy_backptr\r
-av_mul_q\r
-av_nearer_q\r
-av_pix_fmt_descriptors\r
-av_rc4_crypt\r
-av_rc4_init\r
-av_realloc\r
-av_reduce\r
-av_rescale\r
-av_rescale_q\r
-av_rescale_rnd\r
-av_reverse\r
-av_sha1_final\r
-av_sha1_init\r
-av_sha1_size\r
-av_sha1_update\r
-av_sha_final\r
-av_sha_init\r
-av_sha_size\r
-av_sha_update\r
-av_solve_lls\r
-av_strdup\r
-av_strerror\r
-av_stristart\r
-av_stristr\r
-av_strlcat\r
-av_strlcatf\r
-av_strlcpy\r
-av_strstart\r
-av_sub_q\r
-av_tree_destroy\r
-av_tree_enumerate\r
-av_tree_find\r
-av_tree_insert\r
-av_tree_node_size\r
-av_update_lls\r
-av_vlog\r
-avutil_configuration\r
-avutil_license\r
-avutil_version\r
-ff_log2_tab\r
-ff_random_get_seed\r
-ff_sqrt_tab\r
diff --git a/ffmpeg 0.6/lib/avutil-50.dll b/ffmpeg 0.6/lib/avutil-50.dll
deleted file mode 100644 (file)
index 37111cb..0000000
Binary files a/ffmpeg 0.6/lib/avutil-50.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avutil-50.exp b/ffmpeg 0.6/lib/avutil-50.exp
deleted file mode 100644 (file)
index 49db6c7..0000000
Binary files a/ffmpeg 0.6/lib/avutil-50.exp and /dev/null differ
diff --git a/ffmpeg 0.6/lib/avutil-50.lib b/ffmpeg 0.6/lib/avutil-50.lib
deleted file mode 100644 (file)
index cb34818..0000000
Binary files a/ffmpeg 0.6/lib/avutil-50.lib and /dev/null differ
diff --git a/ffmpeg 0.6/lib/postproc-51.def b/ffmpeg 0.6/lib/postproc-51.def
deleted file mode 100644 (file)
index b418950..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-LIBRARY postproc-51.dll\r
-\r
-EXPORTS\r
-postproc_configuration\r
-postproc_license\r
-postproc_version\r
-pp_free_context\r
-pp_free_mode\r
-pp_get_context\r
-pp_get_mode_by_name_and_quality\r
-pp_help\r
-pp_postprocess\r
diff --git a/ffmpeg 0.6/lib/postproc-51.dll b/ffmpeg 0.6/lib/postproc-51.dll
deleted file mode 100644 (file)
index f609005..0000000
Binary files a/ffmpeg 0.6/lib/postproc-51.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/postproc-51.exp b/ffmpeg 0.6/lib/postproc-51.exp
deleted file mode 100644 (file)
index d428675..0000000
Binary files a/ffmpeg 0.6/lib/postproc-51.exp and /dev/null differ
diff --git a/ffmpeg 0.6/lib/postproc-51.lib b/ffmpeg 0.6/lib/postproc-51.lib
deleted file mode 100644 (file)
index 10b4211..0000000
Binary files a/ffmpeg 0.6/lib/postproc-51.lib and /dev/null differ
diff --git a/ffmpeg 0.6/lib/swscale-0.def b/ffmpeg 0.6/lib/swscale-0.def
deleted file mode 100644 (file)
index 192633c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-LIBRARY swscale-0.dll\r
-\r
-EXPORTS\r
-ff_M24A\r
-ff_M24B\r
-ff_M24C\r
-ff_bgr2UCoeff\r
-ff_bgr2UVOffset\r
-ff_bgr2VCoeff\r
-ff_bgr2YCoeff\r
-ff_bgr2YOffset\r
-ff_dither4\r
-ff_dither8\r
-ff_getSwsFunc\r
-ff_get_unscaled_swscale\r
-ff_hardcodedcpuflags\r
-ff_w1111\r
-ff_yuv2rgb_c_init_tables\r
-ff_yuv2rgb_coeffs\r
-ff_yuv2rgb_get_func_ptr\r
-ff_yuv2rgb_init_mmx\r
-sws_addVec\r
-sws_allocVec\r
-sws_cloneVec\r
-sws_context_class\r
-sws_convVec\r
-sws_convertPalette8ToPacked24\r
-sws_convertPalette8ToPacked32\r
-sws_format_name\r
-sws_freeContext\r
-sws_freeFilter\r
-sws_freeVec\r
-sws_getCachedContext\r
-sws_getCoefficients\r
-sws_getColorspaceDetails\r
-sws_getConstVec\r
-sws_getContext\r
-sws_getDefaultFilter\r
-sws_getGaussianVec\r
-sws_getIdentityVec\r
-sws_isSupportedInput\r
-sws_isSupportedOutput\r
-sws_normalizeVec\r
-sws_printVec\r
-sws_printVec2\r
-sws_rgb2rgb_init\r
-sws_scale\r
-sws_scaleVec\r
-sws_scale_ordered\r
-sws_setColorspaceDetails\r
-sws_shiftVec\r
-sws_subVec\r
-swscale_configuration\r
-swscale_license\r
-swscale_version\r
diff --git a/ffmpeg 0.6/lib/swscale-0.dll b/ffmpeg 0.6/lib/swscale-0.dll
deleted file mode 100644 (file)
index 6c28186..0000000
Binary files a/ffmpeg 0.6/lib/swscale-0.dll and /dev/null differ
diff --git a/ffmpeg 0.6/lib/swscale-0.exp b/ffmpeg 0.6/lib/swscale-0.exp
deleted file mode 100644 (file)
index 94df88e..0000000
Binary files a/ffmpeg 0.6/lib/swscale-0.exp and /dev/null differ
diff --git a/ffmpeg 0.6/lib/swscale-0.lib b/ffmpeg 0.6/lib/swscale-0.lib
deleted file mode 100644 (file)
index a4b360d..0000000
Binary files a/ffmpeg 0.6/lib/swscale-0.lib and /dev/null differ
diff --git a/ffmpeg 0.6/samples/libavfilter_sample.txt b/ffmpeg 0.6/samples/libavfilter_sample.txt
deleted file mode 100644 (file)
index 05d091e..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-#define _XOPEN_SOURCE 600 /* for usleep */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <libavformat/avformat.h>
-#include <libavcodec/avcodec.h>
-#include <libavfilter/avfiltergraph.h>
-#include <libavfilter/vsrc_buffer.h>
-
-const char *filter_descr = "scale=78:24,format=gray";
-
-static AVFormatContext *avf;
-static AVCodecContext *video_dec;
-AVFilterContext *video_in_filter;
-AVFilterContext *video_out_filter;
-AVFilterGraph *filter_graph;
-static int video_stream = -1;
-static int64_t last_pts = AV_NOPTS_VALUE;
-
-static void fatal_libav_error(const char *tag, int r)
-{
-    char buf[1024];
-
-    av_strerror(r, buf, sizeof(buf));
-    fprintf(stderr, "%s: %s\n", tag, buf);
-    exit(1);
-}
-
-static void open_input_file(const char *filename)
-{
-    int r, i;
-    AVCodec *codec;
-    AVCodecContext *avc;
-
-    avcodec_register_all();
-    av_register_all();
-    r = av_open_input_file(&avf, filename, NULL, 0, NULL);
-    if (r < 0)
-        fatal_libav_error("av_open_input_file", r);
-    r = av_find_stream_info(avf);
-    if (r < 0)
-        fatal_libav_error("av_find_stream_info", r);
-
-    /* Find a video stream */
-    for (i = 0; i < (int)avf->nb_streams; i) {
-        avc = avf->streams[i]->codec;
-        if (!video_dec && avc->codec_type == CODEC_TYPE_VIDEO) {
-            video_dec = avc;
-            video_stream = i;
-        }
-    }
-    /* Init the video decoder */
-    if (video_dec) {
-        codec = avcodec_find_decoder(video_dec->codec_id);
-        if (!codec) {
-            fprintf(stderr, "Unable to find video decoder\n");
-            exit(1);
-        }
-        r = avcodec_open(video_dec, codec);
-        if (r < 0)
-            fatal_libav_error("avcodec_open", r);
-    }
-}
-
-static void init_filters(const char *filters)
-{
-    char args[256];
-    int r;
-    AVFilter *vf_buffer = avfilter_get_by_name("buffer");
-    AVFilter *vf_nullsink = avfilter_get_by_name("nullsink");
-    AVFilterInOut *outputs = av_malloc(sizeof(AVFilterInOut));
-    AVFilterInOut *inputs  = av_malloc(sizeof(AVFilterInOut));
-
-
-    filter_graph = avfilter_graph_alloc();
-
-    /* Buffer video source: the decoded frames from the codec will be
-     * inserted here. */
-    snprintf(args, sizeof(args), "%d:%d:%d:%d:%d", video_dec->width,
-             video_dec->height, video_dec->pix_fmt,
-             video_dec->time_base.num, video_dec->time_base.den);
-    r = avfilter_graph_create_filter(&video_in_filter, vf_buffer, "src", args,
-                                     NULL, filter_graph);
-    if (r < 0)
-        fatal_libav_error("avfilter_graph_create_filter: buffer", r);
-
-    /* Null video sink: to terminate the filter chain. */
-    r = avfilter_graph_create_filter(&video_out_filter, vf_nullsink, "out",
-                                     NULL, NULL, filter_graph);
-    if (r < 0)
-        fatal_libav_error("avfilter_graph_create_filter: nullsink", r);
-
-    /* Endpoints for the filter graph. */
-    outputs->name       = av_strdup("in");
-    outputs->filter_ctx = video_in_filter;
-    outputs->pad_idx    = 0;
-    outputs->next       = NULL;
-    inputs->name       = av_strdup("out");
-    inputs->filter_ctx = video_out_filter;
-    inputs->pad_idx    = 0;
-    inputs->next       = NULL;
-    r = avfilter_graph_parse(filter_graph, filters, inputs, outputs, NULL);
-    if (r < 0)
-        fatal_libav_error("avfilter_graph_parse", r);
-
-    r = avfilter_graph_config(filter_graph, NULL);
-    if (r < 0)
-        fatal_libav_error("avfilter_graph_config", r);
-}
-
-static void display_frame(AVFilterLink *link)
-{
-    AVFilterBufferRef *ob;
-    int x, y;
-    uint8_t *p0, *p;
-    int64_t delay;
-
-    ob = link->cur_buf;
-    if (ob->pts != AV_NOPTS_VALUE) {
-        if (last_pts != AV_NOPTS_VALUE) {
-            /* sleep roughly the right amount of time;
-             * usleep is in microseconds, just like AV_TIME_BASE. */
-            delay = av_rescale_q(ob->pts - last_pts,
-                                 link->time_base,
-                                 AV_TIME_BASE_Q);
-            if (delay > 0 && delay < 1000000)
-                usleep(delay);
-        }
-        last_pts = ob->pts;
-    }
-    /* ob->data, ob->linesize and ob->pts could be copied to an AVFrame
-     * structure. */
-    /* Trivial ASCII grayscale display. */
-    p0 = ob->data[0];
-    puts("\033c");
-    for (y = 0; y < link->h; y) {
-        p = p0;
-        for (x = 0; x < link->w; x)
-            putchar(" .-#"[*(p) / 52]);
-        putchar('\n');
-        p0 = ob->linesize[0];
-    }
-    fflush(stdout);
-}
-
-static void got_video_frame(AVFrame *frame)
-{
-    int r;
-    AVFilterLink *out = video_out_filter->inputs[0];
-
-    av_vsrc_buffer_add_frame(video_in_filter, frame, frame->pts,
-                             video_dec->sample_aspect_ratio);
-    while (avfilter_poll_frame(out)) {
-        r = avfilter_request_frame(out);
-        if (r < 0)
-            fatal_libav_error("avfilter_request_frame", r);
-        if (!out->cur_buf)
-            fatal_libav_error("avfilter_request_frame", AVERROR(ENOENT));
-        display_frame(out);
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int r;
-    AVPacket packet;
-    AVFrame frame;
-    int got_frame;
-
-    if (argc != 2) {
-        fprintf(stderr, "Usage: api_example file\n");
-        exit(1);
-    }
-    avcodec_register_all();
-    avfilter_register_all();
-    av_register_all();
-    open_input_file(argv[1]);
-    init_filters(filter_descr);
-    /* Read all packets. */
-    while (1) {
-        r = av_read_frame(avf, &packet);
-        if (r < 0)
-            break;
-        if (packet.stream_index == video_stream) {
-            avcodec_get_frame_defaults(&frame);
-            got_frame = 0;
-            if (packet.pts != AV_NOPTS_VALUE)
-                video_dec->reordered_opaque =
-                    av_rescale_q(packet.pts,
-                                 avf->streams[video_stream]->time_base,
-                                 video_dec->time_base);
-            r = avcodec_decode_video2(video_dec, &frame, &got_frame, &packet);
-            if (r < 0)
-                fatal_libav_error("avcodec_decode_video2", r);
-            if (got_frame) {
-                if (frame.pts == AV_NOPTS_VALUE)
-                    frame.pts = frame.reordered_opaque;
-                got_video_frame(&frame);
-            }
-        }
-        av_free_packet(&packet);
-    }
-
-    return 0;
-}
diff --git a/ffmpeg 0.7/README.txt b/ffmpeg 0.7/README.txt
deleted file mode 100644 (file)
index ef04c42..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-This is a FFmpeg Win32 shared build by Kyle Schwarz.\r
-\r
-Zeranoe's FFmpeg Builds Home Page: http://ffmpeg.zeranoe.com/builds/\r
-\r
-Built on Jun 10 2011 22:11:19\r
-\r
-FFmpeg version git-39dbe9b\r
-       libavutil    51.  8. 0 / 51.  8. 0\r
-       libavcodec   53.  7. 0 / 53.  7. 0\r
-       libavformat  53.  3. 0 / 53.  3. 0\r
-       libavdevice  53.  1. 1 / 53.  1. 1\r
-       libavfilter   2. 15. 0 /  2. 15. 0\r
-       libswscale    0. 14. 1 /  0. 14. 1\r
-       libpostproc  51.  2. 0 / 51.  2. 0\r
-\r
-FFmpeg configured with:\r
-       --disable-static\r
-       --enable-shared\r
-       --enable-gpl\r
-       --enable-version3\r
-       --enable-memalign-hack\r
-       --enable-runtime-cpudetect\r
-       --enable-avisynth\r
-       --enable-bzlib\r
-       --enable-frei0r\r
-       --enable-libopencore-amrnb\r
-       --enable-libopencore-amrwb\r
-       --enable-libfreetype\r
-       --enable-libgsm\r
-       --enable-libmp3lame\r
-       --enable-libopenjpeg\r
-       --enable-librtmp\r
-       --enable-libschroedinger\r
-       --enable-libspeex\r
-       --enable-libtheora\r
-       --enable-libvorbis\r
-       --enable-libvpx\r
-       --enable-libx264\r
-       --enable-libxavs\r
-       --enable-libxvid\r
-       --enable-zlib\r
-       --pkg-config=pkg-config\r
-\r
-The source code for this FFmpeg build can be found at:\r
-       http://hawkeye.arrozcru.org/source/\r
-       \r
-This version of FFmpeg was built on:\r
-       Ubuntu Desktop 11.04: http://www.ubuntu.com/desktop\r
-       \r
-The cross-compile toolchain used to compile this FFmpeg was:\r
-       MinGW-w64 r4186: http://mingw-w64.sourceforge.net/\r
-       winpthreads (part of MinGW-w64)\r
-\r
-The GCC version used to compile this FFmpeg was:\r
-       GCC 4.5.3: http://gcc.gnu.org/\r
-       \r
-The external libaries compiled into this FFmpeg are:\r
-       bzip2 1.0.6 http://www.bzip.org\r
-       Frei0r 1.3 http://frei0r.dyne.org/\r
-       opencore-amr 0.1.2 http://sourceforge.net/projects/opencore-amr/\r
-       FreeType 2.4.4 http://www.freetype.org/\r
-       gsm 1.0.13-3 http://libgsm.sourcearchive.com/\r
-       LAME 3.98.4 http://lame.sourceforge.net/\r
-       OpenJPEG 1.4 http://www.openjpeg.org/\r
-       RTMP git-6155179b http://rtmpdump.mplayerhq.hu/\r
-       Schroedinger 1.0.10 http://diracvideo.org/\r
-       Speex 1.2rc1 http://www.speex.org/\r
-       Theora 1.1.1 http://www.theora.org/\r
-       Vorbis 1.3.2 http://www.vorbis.com/\r
-       libvpx 0.9.6 http://www.webmproject.org/code/\r
-       x264 git-c1e60b90 http://www.videolan.org/developers/x264.html\r
-       XAVS r51 http://xavs.sourceforge.net/\r
-       Xvid 1.3.2 http://www.xvid.org/\r
-       zlib 1.2.5 http://zlib.net/\r
-\r
-License for each library can be found in the licenses folder.\r
diff --git a/ffmpeg 0.7/doc/developer.html b/ffmpeg 0.7/doc/developer.html
deleted file mode 100644 (file)
index 3576cc4..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>Developer Documentation</title>
-
-<meta name="description" content="Developer Documentation">
-<meta name="keywords" content="Developer Documentation">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">Developer Documentation</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-Developers-Guide" href="#Developers-Guide">1. Developers Guide</a>
-  <ul class="toc">
-    <li><a name="toc-API" href="#API">1.1 API</a></li>
-    <li><a name="toc-Integrating-libavcodec-or-libavformat-in-your-program" href="#Integrating-libavcodec-or-libavformat-in-your-program">1.2 Integrating libavcodec or libavformat in your program</a></li>
-    <li><a name="toc-Coding-Rules-1" href="#Coding-Rules-1">1.3 Coding Rules</a></li>
-    <li><a name="toc-Development-Policy" href="#Development-Policy">1.4 Development Policy</a></li>
-    <li><a name="toc-Submitting-patches" href="#Submitting-patches">1.5 Submitting patches</a></li>
-    <li><a name="toc-New-codecs-or-formats-checklist" href="#New-codecs-or-formats-checklist">1.6 New codecs or formats checklist</a></li>
-    <li><a name="toc-patch-submission-checklist" href="#patch-submission-checklist">1.7 patch submission checklist</a></li>
-    <li><a name="toc-Patch-review-process" href="#Patch-review-process">1.8 Patch review process</a></li>
-    <li><a name="toc-Regression-tests" href="#Regression-tests">1.9 Regression tests</a></li>
-  </ul>
-</li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="Developers-Guide"></a>
-<h1 class="chapter"><a href="developer.html#toc-Developers-Guide">1. Developers Guide</a></h1>
-
-<a name="API"></a>
-<h2 class="section"><a href="developer.html#toc-API">1.1 API</a></h2>
-<ul>
-<li> libavcodec is the library containing the codecs (both encoding and
-decoding). Look at &lsquo;<tt>libavcodec/apiexample.c</tt>&rsquo; to see how to use it.
-
-</li><li> libavformat is the library containing the file format handling (mux and
-demux code for several formats). Look at &lsquo;<tt>ffplay.c</tt>&rsquo; to use it in a
-player. See &lsquo;<tt>libavformat/output-example.c</tt>&rsquo; to use it to generate
-audio or video streams.
-
-</li></ul>
-
-<a name="Integrating-libavcodec-or-libavformat-in-your-program"></a>
-<h2 class="section"><a href="developer.html#toc-Integrating-libavcodec-or-libavformat-in-your-program">1.2 Integrating libavcodec or libavformat in your program</a></h2>
-
-<p>You can integrate all the source code of the libraries to link them
-statically to avoid any version problem. All you need is to provide a
-&rsquo;config.mak&rsquo; and a &rsquo;config.h&rsquo; in the parent directory. See the defines
-generated by ./configure to understand what is needed.
-</p>
-<p>You can use libavcodec or libavformat in your commercial program, but
-<em>any patch you make must be published</em>. The best way to proceed is
-to send your patches to the FFmpeg mailing list.
-</p>
-<p><a name="Coding-Rules"></a>
-</p><a name="Coding-Rules-1"></a>
-<h2 class="section"><a href="developer.html#toc-Coding-Rules-1">1.3 Coding Rules</a></h2>
-
-<p>FFmpeg is programmed in the ISO C90 language with a few additional
-features from ISO C99, namely:
-</p><ul>
-<li>
-the &lsquo;<samp>inline</samp>&rsquo; keyword;
-</li><li>
-&lsquo;<samp>//</samp>&rsquo; comments;
-</li><li>
-designated struct initializers (&lsquo;<samp>struct s x = { .i = 17 };</samp>&rsquo;)
-</li><li>
-compound literals (&lsquo;<samp>x = (struct s) { 17, 23 };</samp>&rsquo;)
-</li></ul>
-
-<p>These features are supported by all compilers we care about, so we will not
-accept patches to remove their use unless they absolutely do not impair
-clarity and performance.
-</p>
-<p>All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also
-compiles with several other compilers, such as the Compaq ccc compiler
-or Sun Studio 9, and we would like to keep it that way unless it would
-be exceedingly involved. To ensure compatibility, please do not use any
-additional C99 features or GCC extensions. Especially watch out for:
-</p><ul>
-<li>
-mixing statements and declarations;
-</li><li>
-&lsquo;<samp>long long</samp>&rsquo; (use &lsquo;<samp>int64_t</samp>&rsquo; instead);
-</li><li>
-&lsquo;<samp>__attribute__</samp>&rsquo; not protected by &lsquo;<samp>#ifdef __GNUC__</samp>&rsquo; or similar;
-</li><li>
-GCC statement expressions (&lsquo;<samp>(x = ({ int y = 4; y; })</samp>&rsquo;).
-</li></ul>
-
-<p>Indent size is 4.
-The presentation is one inspired by &rsquo;indent -i4 -kr -nut&rsquo;.
-The TAB character is forbidden outside of Makefiles as is any
-form of trailing whitespace. Commits containing either will be
-rejected by the git repository.
-</p>
-<p>The main priority in FFmpeg is simplicity and small code size in order to
-minimize the bug count.
-</p>
-<p>Comments: Use the JavaDoc/Doxygen
-format (see examples below) so that code documentation
-can be generated automatically. All nontrivial functions should have a comment
-above them explaining what the function does, even if it is just one sentence.
-All structures and their member variables should be documented, too.
-</p><table><tr><td>&nbsp;</td><td><pre class="example">/**
- * @file mpeg.c
- * MPEG codec.
- * @author ...
- */
-
-/**
- * Summary sentence.
- * more text ...
- * ...
- */
-typedef struct Foobar{
-    int var1; /**&lt; var1 description */
-    int var2; ///&lt; var2 description
-    /** var3 description */
-    int var3;
-} Foobar;
-
-/**
- * Summary sentence.
- * more text ...
- * ...
- * @param my_parameter description of my_parameter
- * @return return value description
- */
-int myfunc(int my_parameter)
-...
-</pre></td></tr></table>
-
-<p>fprintf and printf are forbidden in libavformat and libavcodec,
-please use av_log() instead.
-</p>
-<p>Casts should be used only when necessary. Unneeded parentheses
-should also be avoided if they don&rsquo;t make the code easier to understand.
-</p>
-<a name="Development-Policy"></a>
-<h2 class="section"><a href="developer.html#toc-Development-Policy">1.4 Development Policy</a></h2>
-
-<ol>
-<li>
-   Contributions should be licensed under the LGPL 2.1, including an
-   &quot;or any later version&quot; clause, or the MIT license.  GPL 2 including
-   an &quot;or any later version&quot; clause is also acceptable, but LGPL is
-   preferred.
-</li><li>
-   You must not commit code which breaks FFmpeg! (Meaning unfinished but
-   enabled code which breaks compilation or compiles but does not work or
-   breaks the regression tests)
-   You can commit unfinished stuff (for testing etc), but it must be disabled
-   (#ifdef etc) by default so it does not interfere with other developers&rsquo;
-   work.
-</li><li>
-   You do not have to over-test things. If it works for you, and you think it
-   should work for others, then commit. If your code has problems
-   (portability, triggers compiler bugs, unusual environment etc) they will be
-   reported and eventually fixed.
-</li><li>
-   Do not commit unrelated changes together, split them into self-contained
-   pieces. Also do not forget that if part B depends on part A, but A does not
-   depend on B, then A can and should be committed first and separate from B.
-   Keeping changes well split into self-contained parts makes reviewing and
-   understanding them on the commit log mailing list easier. This also helps
-   in case of debugging later on.
-   Also if you have doubts about splitting or not splitting, do not hesitate to
-   ask/discuss it on the developer mailing list.
-</li><li>
-   Do not change behavior of the programs (renaming options etc) or public
-   API or ABI without first discussing it on the ffmpeg-devel mailing list.
-   Do not remove functionality from the code. Just improve!
-
-<p>   Note: Redundant code can be removed.
-</p></li><li>
-   Do not commit changes to the build system (Makefiles, configure script)
-   which change behavior, defaults etc, without asking first. The same
-   applies to compiler warning fixes, trivial looking fixes and to code
-   maintained by other developers. We usually have a reason for doing things
-   the way we do. Send your changes as patches to the ffmpeg-devel mailing
-   list, and if the code maintainers say OK, you may commit. This does not
-   apply to files you wrote and/or maintain.
-</li><li>
-   We refuse source indentation and other cosmetic changes if they are mixed
-   with functional changes, such commits will be rejected and removed. Every
-   developer has his own indentation style, you should not change it. Of course
-   if you (re)write something, you can use your own style, even though we would
-   prefer if the indentation throughout FFmpeg was consistent (Many projects
-   force a given indentation style - we do not.). If you really need to make
-   indentation changes (try to avoid this), separate them strictly from real
-   changes.
-
-<p>   NOTE: If you had to put if(){ .. } over a large (&gt; 5 lines) chunk of code,
-   then either do NOT change the indentation of the inner part within (do not
-   move it to the right)! or do so in a separate commit
-</p></li><li>
-   Always fill out the commit log message. Describe in a few lines what you
-   changed and why. You can refer to mailing list postings if you fix a
-   particular bug. Comments such as &quot;fixed!&quot; or &quot;Changed it.&quot; are unacceptable.
-   Recommanded format:
-   area changed: Short 1 line description
-
-<p>   details describing what and why and giving references.
-</p></li><li>
-   Make sure the author of the commit is set correctly. (see git commit &ndash;author)
-   If you apply a patch, send an
-   answer to ffmpeg-devel (or wherever you got the patch from) saying that
-   you applied the patch.
-</li><li>
-   When applying patches that have been discussed (at length) on the mailing
-   list, reference the thread in the log message.
-</li><li>
-    Do NOT commit to code actively maintained by others without permission.
-    Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
-    timeframe (12h for build failures and security fixes, 3 days small changes,
-    1 week for big patches) then commit your patch if you think it is OK.
-    Also note, the maintainer can simply ask for more time to review!
-</li><li>
-    Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
-    are sent there and reviewed by all the other developers. Bugs and possible
-    improvements or general questions regarding commits are discussed there. We
-    expect you to react if problems with your code are uncovered.
-</li><li>
-    Update the documentation if you change behavior or add features. If you are
-    unsure how best to do this, send a patch to ffmpeg-devel, the documentation
-    maintainer(s) will review and commit your stuff.
-</li><li>
-    Try to keep important discussions and requests (also) on the public
-    developer mailing list, so that all developers can benefit from them.
-</li><li>
-    Never write to unallocated memory, never write over the end of arrays,
-    always check values read from some untrusted source before using them
-    as array index or other risky things.
-</li><li>
-    Remember to check if you need to bump versions for the specific libav
-    parts (libavutil, libavcodec, libavformat) you are changing. You need
-    to change the version integer.
-    Incrementing the first component means no backward compatibility to
-    previous versions (e.g. removal of a function from the public API).
-    Incrementing the second component means backward compatible change
-    (e.g. addition of a function to the public API or extension of an
-    existing data structure).
-    Incrementing the third component means a noteworthy binary compatible
-    change (e.g. encoder bug fix that matters for the decoder).
-</li><li>
-    Compiler warnings indicate potential bugs or code with bad style. If a type of
-    warning always points to correct and clean code, that warning should
-    be disabled, not the code changed.
-    Thus the remaining warnings can either be bugs or correct code.
-    If it is a bug, the bug has to be fixed. If it is not, the code should
-    be changed to not generate a warning unless that causes a slowdown
-    or obfuscates the code.
-</li><li>
-    If you add a new file, give it a proper license header. Do not copy and
-    paste it from a random place, use an existing file as template.
-</li></ol>
-
-<p>We think our rules are not too hard. If you have comments, contact us.
-</p>
-<p>Note, these rules are mostly borrowed from the MPlayer project.
-</p>
-<a name="Submitting-patches"></a>
-<h2 class="section"><a href="developer.html#toc-Submitting-patches">1.5 Submitting patches</a></h2>
-
-<p>First, read the (see <a href="#Coding-Rules">Coding Rules</a>) above if you did not yet.
-</p>
-<p>When you submit your patch, please use <code>git format-patch</code> or
-<code>git send-email</code>. We cannot read other diffs :-)
-</p>
-<p>Also please do not submit a patch which contains several unrelated changes.
-Split it into separate, self-contained pieces. This does not mean splitting
-file by file. Instead, make the patch as small as possible while still
-keeping it as a logical unit that contains an individual change, even
-if it spans multiple files. This makes reviewing your patches much easier
-for us and greatly increases your chances of getting your patch applied.
-</p>
-<p>Use the patcheck tool of FFmpeg to check your patch.
-The tool is located in the tools directory.
-</p>
-<p>Run the regression tests before submitting a patch so that you can
-verify that there are no big problems.
-</p>
-<p>Patches should be posted as base64 encoded attachments (or any other
-encoding which ensures that the patch will not be trashed during
-transmission) to the ffmpeg-devel mailing list, see
-<a href="http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel">http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel</a>
-</p>
-<p>It also helps quite a bit if you tell us what the patch does (for example
-&rsquo;replaces lrint by lrintf&rsquo;), and why (for example &rsquo;*BSD isn&rsquo;t C99 compliant
-and has no lrint()&rsquo;)
-</p>
-<p>Also please if you send several patches, send each patch as a separate mail,
-do not attach several unrelated patches to the same mail.
-</p>
-<p>Your patch will be reviewed on the mailing list. You will likely be asked
-to make some changes and are expected to send in an improved version that
-incorporates the requests from the review. This process may go through
-several iterations. Once your patch is deemed good enough, some developer
-will pick it up and commit it to the official FFmpeg tree.
-</p>
-<p>Give us a few days to react. But if some time passes without reaction,
-send a reminder by email. Your patch should eventually be dealt with.
-</p>
-
-<a name="New-codecs-or-formats-checklist"></a>
-<h2 class="section"><a href="developer.html#toc-New-codecs-or-formats-checklist">1.6 New codecs or formats checklist</a></h2>
-
-<ol>
-<li>
-    Did you use av_cold for codec initialization and close functions?
-</li><li>
-    Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
-    AVInputFormat/AVOutputFormat struct?
-</li><li>
-    Did you bump the minor version number (and reset the micro version
-    number) in &lsquo;<tt>avcodec.h</tt>&rsquo; or &lsquo;<tt>avformat.h</tt>&rsquo;?
-</li><li>
-    Did you register it in &lsquo;<tt>allcodecs.c</tt>&rsquo; or &lsquo;<tt>allformats.c</tt>&rsquo;?
-</li><li>
-    Did you add the CodecID to &lsquo;<tt>avcodec.h</tt>&rsquo;?
-</li><li>
-    If it has a fourcc, did you add it to &lsquo;<tt>libavformat/riff.c</tt>&rsquo;,
-    even if it is only a decoder?
-</li><li>
-    Did you add a rule to compile the appropriate files in the Makefile?
-    Remember to do this even if you&rsquo;re just adding a format to a file that is
-    already being compiled by some other rule, like a raw demuxer.
-</li><li>
-    Did you add an entry to the table of supported formats or codecs in
-    &lsquo;<tt>doc/general.texi</tt>&rsquo;?
-</li><li>
-    Did you add an entry in the Changelog?
-</li><li>
-    If it depends on a parser or a library, did you add that dependency in
-    configure?
-</li><li>
-    Did you <code>git add</code> the appropriate files before committing?
-</li><li>
-    Did you make sure it compiles standalone, i.e. with
-    <code>configure --disable-everything --enable-decoder=foo</code>
-    (or <code>--enable-demuxer</code> or whatever your component is)?
-</li></ol>
-
-
-<a name="patch-submission-checklist"></a>
-<h2 class="section"><a href="developer.html#toc-patch-submission-checklist">1.7 patch submission checklist</a></h2>
-
-<ol>
-<li>
-    Does &rsquo;make fate&rsquo; pass with the patch applied?
-</li><li>
-    Was the patch generated with git format-patch or send-email?
-</li><li>
-    Did you sign off your patch? (git commit -s)
-    See <a href="http://kerneltrap.org/files/Jeremy/DCO.txt">http://kerneltrap.org/files/Jeremy/DCO.txt</a> for the meaning
-    of sign off.
-</li><li>
-    Did you provide a clear git commit log message?
-</li><li>
-    Is the patch against latest FFmpeg git master branch?
-</li><li>
-    Are you subscribed to ffmpeg-dev?
-    (the list is subscribers only due to spam)
-</li><li>
-    Have you checked that the changes are minimal, so that the same cannot be
-    achieved with a smaller patch and/or simpler final code?
-</li><li>
-    If the change is to speed critical code, did you benchmark it?
-</li><li>
-    If you did any benchmarks, did you provide them in the mail?
-</li><li>
-    Have you checked that the patch does not introduce buffer overflows or
-    other security issues?
-</li><li>
-    Did you test your decoder or demuxer against damaged data? If no, see
-    tools/trasher and the noise bitstream filter. Your decoder or demuxer
-    should not crash or end in a (near) infinite loop when fed damaged data.
-</li><li>
-    Does the patch not mix functional and cosmetic changes?
-</li><li>
-    Did you add tabs or trailing whitespace to the code? Both are forbidden.
-</li><li>
-    Is the patch attached to the email you send?
-</li><li>
-    Is the mime type of the patch correct? It should be text/x-diff or
-    text/x-patch or at least text/plain and not application/octet-stream.
-</li><li>
-    If the patch fixes a bug, did you provide a verbose analysis of the bug?
-</li><li>
-    If the patch fixes a bug, did you provide enough information, including
-    a sample, so the bug can be reproduced and the fix can be verified?
-    Note please do not attach samples &gt;100k to mails but rather provide a
-    URL, you can upload to ftp://upload.ffmpeg.org
-</li><li>
-    Did you provide a verbose summary about what the patch does change?
-</li><li>
-    Did you provide a verbose explanation why it changes things like it does?
-</li><li>
-    Did you provide a verbose summary of the user visible advantages and
-    disadvantages if the patch is applied?
-</li><li>
-    Did you provide an example so we can verify the new feature added by the
-    patch easily?
-</li><li>
-    If you added a new file, did you insert a license header? It should be
-    taken from FFmpeg, not randomly copied and pasted from somewhere else.
-</li><li>
-    You should maintain alphabetical order in alphabetically ordered lists as
-    long as doing so does not break API/ABI compatibility.
-</li><li>
-    Lines with similar content should be aligned vertically when doing so
-    improves readability.
-</li><li>
-    Consider to add a regression test for your code.
-</li><li>
-    If you added YASM code please check that things still work with &ndash;disable-yasm
-</li></ol>
-
-<a name="Patch-review-process"></a>
-<h2 class="section"><a href="developer.html#toc-Patch-review-process">1.8 Patch review process</a></h2>
-
-<p>All patches posted to ffmpeg-devel will be reviewed, unless they contain a
-clear note that the patch is not for the git master branch.
-Reviews and comments will be posted as replies to the patch on the
-mailing list. The patch submitter then has to take care of every comment,
-that can be by resubmitting a changed patch or by discussion. Resubmitted
-patches will themselves be reviewed like any other patch. If at some point
-a patch passes review with no comments then it is approved, that can for
-simple and small patches happen immediately while large patches will generally
-have to be changed and reviewed many times before they are approved.
-After a patch is approved it will be committed to the repository.
-</p>
-<p>We will review all submitted patches, but sometimes we are quite busy so
-especially for large patches this can take several weeks.
-</p>
-<p>When resubmitting patches, please do not make any significant changes
-not related to the comments received during review. Such patches will
-be rejected. Instead, submit  significant changes or new features as
-separate patches.
-</p>
-<a name="Regression-tests"></a>
-<h2 class="section"><a href="developer.html#toc-Regression-tests">1.9 Regression tests</a></h2>
-
-<p>Before submitting a patch (or committing to the repository), you should at least
-test that you did not break anything.
-</p>
-<p>The regression tests build a synthetic video stream and a synthetic
-audio stream. These are then encoded and decoded with all codecs or
-formats. The CRC (or MD5) of each generated file is recorded in a
-result file. A &rsquo;diff&rsquo; is launched to compare the reference results and
-the result file. The output is checked immediately after each test
-has run.
-</p>
-<p>The regression tests then go on to test the FFserver code with a
-limited set of streams. It is important that this step runs correctly
-as well.
-</p>
-<p>Run &rsquo;make test&rsquo; to test all the codecs and formats. Commands like
-&rsquo;make regtest-mpeg2&rsquo; can be used to run a single test. By default,
-make will abort if any test fails. To run all tests regardless,
-use make -k. To get a more verbose output, use &rsquo;make V=1 test&rsquo; or
-&rsquo;make V=2 test&rsquo;.
-</p>
-<p>Run &rsquo;make fulltest&rsquo; to test all the codecs, formats and FFserver.
-</p>
-<p>[Of course, some patches may change the results of the regression tests. In
-this case, the reference results of the regression tests shall be modified
-accordingly].
-</p>
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/doc/faq.html b/ffmpeg 0.7/doc/faq.html
deleted file mode 100644 (file)
index 92db016..0000000
+++ /dev/null
@@ -1,655 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>FFmpeg FAQ</title>
-
-<meta name="description" content="FFmpeg FAQ">
-<meta name="keywords" content="FFmpeg FAQ">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">FFmpeg FAQ</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-General-Questions" href="#General-Questions">1. General Questions</a>
-  <ul class="toc">
-    <li><a name="toc-When-will-the-next-FFmpeg-version-be-released_003f-_002f-Why-are-FFmpeg-releases-so-few-and-far-between_003f" href="#When-will-the-next-FFmpeg-version-be-released_003f-_002f-Why-are-FFmpeg-releases-so-few-and-far-between_003f">1.1 When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?</a></li>
-    <li><a name="toc-I-have-a-problem-with-an-old-version-of-FFmpeg_003b-where-should-I-report-it_003f" href="#I-have-a-problem-with-an-old-version-of-FFmpeg_003b-where-should-I-report-it_003f">1.2 I have a problem with an old version of FFmpeg; where should I report it?</a></li>
-    <li><a name="toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" href="#Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f">1.3 Why doesn&rsquo;t FFmpeg support feature [xyz]?</a></li>
-    <li><a name="toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" href="#FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.4 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?</a></li>
-    <li><a name="toc-My-bug-report_002fmail-to-ffmpeg_002ddevel_002fuser-has-not-received-any-replies_002e" href="#My-bug-report_002fmail-to-ffmpeg_002ddevel_002fuser-has-not-received-any-replies_002e">1.5 My bug report/mail to ffmpeg-devel/user has not received any replies.</a></li>
-    <li><a name="toc-Is-there-a-forum-for-FFmpeg_003f-I-do-not-like-mailing-lists_002e" href="#Is-there-a-forum-for-FFmpeg_003f-I-do-not-like-mailing-lists_002e">1.6 Is there a forum for FFmpeg? I do not like mailing lists.</a></li>
-    <li><a name="toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e">1.7 I cannot read this file although this format seems to be supported by ffmpeg.</a></li>
-    <li><a name="toc-Which-codecs-are-supported-by-Windows_003f" href="#Which-codecs-are-supported-by-Windows_003f">1.8 Which codecs are supported by Windows?</a></li>
-  </ul></li>
-  <li><a name="toc-Compilation" href="#Compilation">2. Compilation</a>
-  <ul class="toc">
-    <li><a name="toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" href="#error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027">2.1 <code>error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code></a></li>
-  </ul></li>
-  <li><a name="toc-Usage" href="#Usage">3. Usage</a>
-  <ul class="toc">
-    <li><a name="toc-ffmpeg-does-not-work_003b-what-is-wrong_003f" href="#ffmpeg-does-not-work_003b-what-is-wrong_003f">3.1 ffmpeg does not work; what is wrong?</a></li>
-    <li><a name="toc-How-do-I-encode-single-pictures-into-movies_003f" href="#How-do-I-encode-single-pictures-into-movies_003f">3.2 How do I encode single pictures into movies?</a></li>
-    <li><a name="toc-How-do-I-encode-movie-to-single-pictures_003f" href="#How-do-I-encode-movie-to-single-pictures_003f">3.3 How do I encode movie to single pictures?</a></li>
-    <li><a name="toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" href="#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></li>
-    <li><a name="toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" href="#How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.5 How can I read from the standard input or write to the standard output?</a></li>
-    <li><a name="toc-_002df-jpeg-doesn_0027t-work_002e" href="#g_t_002df-jpeg-doesn_0027t-work_002e">3.6 -f jpeg doesn&rsquo;t work.</a></li>
-    <li><a name="toc-Why-can-I-not-change-the-framerate_003f" href="#Why-can-I-not-change-the-framerate_003f">3.7 Why can I not change the framerate?</a></li>
-    <li><a name="toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" href="#How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f">3.8 How do I encode Xvid or DivX video with ffmpeg?</a></li>
-    <li><a name="toc-How-do-I-encode-videos-which-play-on-the-iPod_003f" href="#How-do-I-encode-videos-which-play-on-the-iPod_003f">3.9 How do I encode videos which play on the iPod?</a></li>
-    <li><a name="toc-How-do-I-encode-videos-which-play-on-the-PSP_003f" href="#How-do-I-encode-videos-which-play-on-the-PSP_003f">3.10 How do I encode videos which play on the PSP?</a></li>
-    <li><a name="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.11 Which are good parameters for encoding high quality MPEG-4?</a></li>
-    <li><a name="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.12 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></li>
-    <li><a name="toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" href="#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">3.13 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?</a></li>
-    <li><a name="toc-How-can-I-read-DirectShow-files_003f" href="#How-can-I-read-DirectShow-files_003f">3.14 How can I read DirectShow files?</a></li>
-    <li><a name="toc-How-can-I-join-video-files_003f" href="#How-can-I-join-video-files_003f">3.15 How can I join video files?</a></li>
-    <li><a name="toc-The-ffmpeg-program-does-not-respect-the-_002dmaxrate-setting_002c-some-frames-are-bigger-than-maxrate_002ffps_002e" href="#The-ffmpeg-program-does-not-respect-the-_002dmaxrate-setting_002c-some-frames-are-bigger-than-maxrate_002ffps_002e">3.16 The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.</a></li>
-    <li><a name="toc-I-want-CBR_002c-but-no-matter-what-I-do-frame-sizes-differ_002e" href="#I-want-CBR_002c-but-no-matter-what-I-do-frame-sizes-differ_002e">3.17 I want CBR, but no matter what I do frame sizes differ.</a></li>
-    <li><a name="toc-How-do-I-check-if-a-stream-is-CBR_003f" href="#How-do-I-check-if-a-stream-is-CBR_003f">3.18 How do I check if a stream is CBR?</a></li>
-  </ul></li>
-  <li><a name="toc-Development" href="#Development">4. Development</a>
-  <ul class="toc">
-    <li><a name="toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" href="#Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?</a></li>
-    <li><a name="toc-Can-you-support-my-C-compiler-XXX_003f" href="#Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></li>
-    <li><a name="toc-Is-Microsoft-Visual-C_002b_002b-supported_003f" href="#Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></li>
-    <li><a name="toc-Can-I-use-FFmpeg-or-libavcodec-under-Windows_003f" href="#Can-I-use-FFmpeg-or-libavcodec-under-Windows_003f">4.4 Can I use FFmpeg or libavcodec under Windows?</a></li>
-    <li><a name="toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f" href="#Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.5 Can you add automake, libtool or autoconf support?</a></li>
-    <li><a name="toc-Why-not-rewrite-ffmpeg-in-object_002doriented-C_002b_002b_003f" href="#Why-not-rewrite-ffmpeg-in-object_002doriented-C_002b_002b_003f">4.6 Why not rewrite ffmpeg in object-oriented C++?</a></li>
-    <li><a name="toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" href="#Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f">4.7 Why are the ffmpeg programs devoid of debugging symbols?</a></li>
-    <li><a name="toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" href="#I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.8 I do not like the LGPL, can I contribute code under the GPL instead?</a></li>
-    <li><a name="toc-I-want-to-compile-xyz_002ec-alone-but-my-compiler-produced-many-errors_002e" href="#I-want-to-compile-xyz_002ec-alone-but-my-compiler-produced-many-errors_002e">4.9 I want to compile xyz.c alone but my compiler produced many errors.</a></li>
-    <li><a name="toc-I_0027m-using-libavcodec-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" href="#I_0027m-using-libavcodec-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.10 I&rsquo;m using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.</a></li>
-    <li><a name="toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" href="#I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></li>
-    <li><a name="toc-I-get-_0022No-compatible-shell-script-interpreter-found_002e_0022-in-MSys_002e" href="#I-get-_0022No-compatible-shell-script-interpreter-found_002e_0022-in-MSys_002e">4.12 I get &quot;No compatible shell script interpreter found.&quot; in MSys.</a></li>
-    <li><a name="toc-I-get-_0022_002e_002fconfigure_003a-line-_003cxxx_003e_003a-pr_003a-command-not-found_0022-in-MSys_002e" href="#I-get-_0022_002e_002fconfigure_003a-line-_003cxxx_003e_003a-pr_003a-command-not-found_0022-in-MSys_002e">4.13 I get &quot;./configure: line &lt;xxx&gt;: pr: command not found&quot; in MSys.</a></li>
-    <li><a name="toc-Where-can-I-find-libav_002a-headers-for-Pascal_002fDelphi_003f" href="#Where-can-I-find-libav_002a-headers-for-Pascal_002fDelphi_003f">4.14 Where can I find libav* headers for Pascal/Delphi?</a></li>
-    <li><a name="toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" href="#Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f">4.15 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?</a></li>
-    <li><a name="toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" href="#How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f">4.16 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?</a></li>
-    <li><a name="toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-framerate_002e" href="#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-framerate_002e">4.17 AVStream.r_frame_rate is wrong, it is much larger than the framerate.</a></li>
-  </ul>
-</li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="General-Questions"></a>
-<h1 class="chapter"><a href="faq.html#toc-General-Questions">1. General Questions</a></h1>
-
-<a name="When-will-the-next-FFmpeg-version-be-released_003f-_002f-Why-are-FFmpeg-releases-so-few-and-far-between_003f"></a>
-<h2 class="section"><a href="faq.html#toc-When-will-the-next-FFmpeg-version-be-released_003f-_002f-Why-are-FFmpeg-releases-so-few-and-far-between_003f">1.1 When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?</a></h2>
-
-<p>Like most open source projects FFmpeg suffers from a certain lack of
-manpower. For this reason the developers have to prioritize the work
-they do and putting out releases is not at the top of the list, fixing
-bugs and reviewing patches takes precedence. Please don&rsquo;t complain or
-request more timely and/or frequent releases unless you are willing to
-help out creating them.
-</p>
-<a name="I-have-a-problem-with-an-old-version-of-FFmpeg_003b-where-should-I-report-it_003f"></a>
-<h2 class="section"><a href="faq.html#toc-I-have-a-problem-with-an-old-version-of-FFmpeg_003b-where-should-I-report-it_003f">1.2 I have a problem with an old version of FFmpeg; where should I report it?</a></h2>
-<p>Nowhere. We do not support old FFmpeg versions in any way, we simply lack
-the time, motivation and manpower to do so. If you have a problem with an
-old version of FFmpeg, upgrade to the latest git snapshot. If you
-still experience the problem, then you can report it according to the
-guidelines in <a href="http://ffmpeg.org/bugreports.html">http://ffmpeg.org/bugreports.html</a>.
-</p>
-<a name="Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f">1.3 Why doesn&rsquo;t FFmpeg support feature [xyz]?</a></h2>
-
-<p>Because no one has taken on that task yet. FFmpeg development is
-driven by the tasks that are important to the individual developers.
-If there is a feature that is important to you, the best way to get
-it implemented is to undertake the task yourself or sponsor a developer.
-</p>
-<a name="FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f"></a>
-<h2 class="section"><a href="faq.html#toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.4 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?</a></h2>
-
-<p>No. Windows DLLs are not portable, bloated and often slow.
-Moreover FFmpeg strives to support all codecs natively.
-A DLL loader is not conducive to that goal.
-</p>
-<a name="My-bug-report_002fmail-to-ffmpeg_002ddevel_002fuser-has-not-received-any-replies_002e"></a>
-<h2 class="section"><a href="faq.html#toc-My-bug-report_002fmail-to-ffmpeg_002ddevel_002fuser-has-not-received-any-replies_002e">1.5 My bug report/mail to ffmpeg-devel/user has not received any replies.</a></h2>
-
-<p>Likely reasons
-</p><ul>
-<li> We are busy and haven&rsquo;t had time yet to read your report or
-investigate the issue.
-</li><li> You didn&rsquo;t follow <a href="http://ffmpeg.org/bugreports.html">http://ffmpeg.org/bugreports.html</a>.
-</li><li> You didn&rsquo;t use git HEAD.
-</li><li> You reported a segmentation fault without gdb output.
-</li><li> You describe a problem but not how to reproduce it.
-</li><li> It&rsquo;s unclear if you use ffmpeg as command line tool or use
-libav* from another application.
-</li><li> You speak about a video having problems on playback but
-not what you use to play it.
-</li><li> We have no faint clue what you are talking about besides
-that it is related to FFmpeg.
-</li></ul>
-
-<a name="Is-there-a-forum-for-FFmpeg_003f-I-do-not-like-mailing-lists_002e"></a>
-<h2 class="section"><a href="faq.html#toc-Is-there-a-forum-for-FFmpeg_003f-I-do-not-like-mailing-lists_002e">1.6 Is there a forum for FFmpeg? I do not like mailing lists.</a></h2>
-
-<p>You may view our mailing lists with a more forum-alike look here:
-<a href="http://dir.gmane.org/gmane.comp.video.ffmpeg.user">http://dir.gmane.org/gmane.comp.video.ffmpeg.user</a>,
-but, if you post, please remember that our mailing list rules still apply there.
-</p>
-<a name="I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e"></a>
-<h2 class="section"><a href="faq.html#toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e">1.7 I cannot read this file although this format seems to be supported by ffmpeg.</a></h2>
-
-<p>Even if ffmpeg can read the container format, it may not support all its
-codecs. Please consult the supported codec list in the ffmpeg
-documentation.
-</p>
-<a name="Which-codecs-are-supported-by-Windows_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Which-codecs-are-supported-by-Windows_003f">1.8 Which codecs are supported by Windows?</a></h2>
-
-<p>Windows does not support standard formats like MPEG very well, unless you
-install some additional codecs.
-</p>
-<p>The following list of video codecs should work on most Windows systems:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>msmpeg4v2</samp>&rsquo;</dt>
-<dd><p>.avi/.asf
-</p></dd>
-<dt> &lsquo;<samp>msmpeg4</samp>&rsquo;</dt>
-<dd><p>.asf only
-</p></dd>
-<dt> &lsquo;<samp>wmv1</samp>&rsquo;</dt>
-<dd><p>.asf only
-</p></dd>
-<dt> &lsquo;<samp>wmv2</samp>&rsquo;</dt>
-<dd><p>.asf only
-</p></dd>
-<dt> &lsquo;<samp>mpeg4</samp>&rsquo;</dt>
-<dd><p>Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
-</p></dd>
-<dt> &lsquo;<samp>mpeg1video</samp>&rsquo;</dt>
-<dd><p>.mpg only
-</p></dd>
-</dl>
-<p>Note, ASF files often have .wmv or .wma extensions in Windows. It should also
-be mentioned that Microsoft claims a patent on the ASF format, and may sue
-or threaten users who create ASF files with non-Microsoft software. It is
-strongly advised to avoid ASF where possible.
-</p>
-<p>The following list of audio codecs should work on most Windows systems:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>adpcm_ima_wav</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>adpcm_ms</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>pcm_s16le</samp>&rsquo;</dt>
-<dd><p>always
-</p></dd>
-<dt> &lsquo;<samp>libmp3lame</samp>&rsquo;</dt>
-<dd><p>If some MP3 codec like LAME is installed.
-</p></dd>
-</dl>
-
-
-<a name="Compilation"></a>
-<h1 class="chapter"><a href="faq.html#toc-Compilation">2. Compilation</a></h1>
-
-<a name="error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027"></a>
-<h2 class="section"><a href="faq.html#toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027">2.1 <code>error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code></a></h2>
-
-<p>This is a bug in gcc. Do not report it to us. Instead, please report it to
-the gcc developers. Note that we will not add workarounds for gcc bugs.
-</p>
-<p>Also note that (some of) the gcc developers believe this is not a bug or
-not a bug they should fix:
-<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203</a>.
-Then again, some of them do not know the difference between an undecidable
-problem and an NP-hard problem...
-</p>
-<a name="Usage"></a>
-<h1 class="chapter"><a href="faq.html#toc-Usage">3. Usage</a></h1>
-
-<a name="ffmpeg-does-not-work_003b-what-is-wrong_003f"></a>
-<h2 class="section"><a href="faq.html#toc-ffmpeg-does-not-work_003b-what-is-wrong_003f">3.1 ffmpeg does not work; what is wrong?</a></h2>
-
-<p>Try a <code>make distclean</code> in the ffmpeg source directory before the build. If this does not help see
-(<a href="http://ffmpeg.org/bugreports.html">http://ffmpeg.org/bugreports.html</a>).
-</p>
-<a name="How-do-I-encode-single-pictures-into-movies_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-encode-single-pictures-into-movies_003f">3.2 How do I encode single pictures into movies?</a></h2>
-
-<p>First, rename your pictures to follow a numerical sequence.
-For example, img1.jpg, img2.jpg, img3.jpg,...
-Then you may run:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">  ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
-</pre></td></tr></table>
-
-<p>Notice that &lsquo;<samp>%d</samp>&rsquo; is replaced by the image number.
-</p>
-<p>&lsquo;<tt>img%03d.jpg</tt>&rsquo; means the sequence &lsquo;<tt>img001.jpg</tt>&rsquo;, &lsquo;<tt>img002.jpg</tt>&rsquo;, etc...
-</p>
-<p>If you have large number of pictures to rename, you can use the
-following command to ease the burden. The command, using the bourne
-shell syntax, symbolically links all files in the current directory
-that match <code>*jpg</code> to the &lsquo;<tt>/tmp</tt>&rsquo; directory in the sequence of
-&lsquo;<tt>img001.jpg</tt>&rsquo;, &lsquo;<tt>img002.jpg</tt>&rsquo; and so on.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">  x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s &quot;$i&quot; /tmp/img&quot;$counter&quot;.jpg; x=$(($x+1)); done
-</pre></td></tr></table>
-
-<p>If you want to sequence them by oldest modified first, substitute
-<code>$(ls -r -t *jpg)</code> in place of <code>*jpg</code>.
-</p>
-<p>Then run:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">  ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
-</pre></td></tr></table>
-
-<p>The same logic is used for any image format that ffmpeg reads.
-</p>
-<a name="How-do-I-encode-movie-to-single-pictures_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-encode-movie-to-single-pictures_003f">3.3 How do I encode movie to single pictures?</a></h2>
-
-<p>Use:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">  ffmpeg -i movie.mpg movie%d.jpg
-</pre></td></tr></table>
-
-<p>The &lsquo;<tt>movie.mpg</tt>&rsquo; used as input will be converted to
-&lsquo;<tt>movie1.jpg</tt>&rsquo;, &lsquo;<tt>movie2.jpg</tt>&rsquo;, etc...
-</p>
-<p>Instead of relying on file format self-recognition, you may also use
-</p><dl compact="compact">
-<dt> &lsquo;<samp>-vcodec ppm</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-vcodec png</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-vcodec mjpeg</samp>&rsquo;</dt>
-</dl>
-<p>to force the encoding.
-</p>
-<p>Applying that to the previous example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">  ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
-</pre></td></tr></table>
-
-<p>Beware that there is no &quot;jpeg&quot; codec. Use &quot;mjpeg&quot; instead.
-</p>
-<a name="Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></h2>
-
-<p>For multithreaded MPEG* encoding, the encoded slices must be independent,
-otherwise thread n would practically have to wait for n-1 to finish, so it&rsquo;s
-quite logical that there is a small reduction of quality. This is not a bug.
-</p>
-<a name="How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.5 How can I read from the standard input or write to the standard output?</a></h2>
-
-<p>Use &lsquo;<tt>-</tt>&rsquo; as file name.
-</p>
-<a name="g_t_002df-jpeg-doesn_0027t-work_002e"></a>
-<h2 class="section"><a href="faq.html#toc-_002df-jpeg-doesn_0027t-work_002e">3.6 -f jpeg doesn&rsquo;t work.</a></h2>
-
-<p>Try &rsquo;-f image2 test%d.jpg&rsquo;.
-</p>
-<a name="Why-can-I-not-change-the-framerate_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Why-can-I-not-change-the-framerate_003f">3.7 Why can I not change the framerate?</a></h2>
-
-<p>Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
-Choose a different codec with the -vcodec command line option.
-</p>
-<a name="How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f">3.8 How do I encode Xvid or DivX video with ffmpeg?</a></h2>
-
-<p>Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
-standard (note that there are many other coding formats that use this
-same standard). Thus, use &rsquo;-vcodec mpeg4&rsquo; to encode in these formats. The
-default fourcc stored in an MPEG-4-coded file will be &rsquo;FMP4&rsquo;. If you want
-a different fourcc, use the &rsquo;-vtag&rsquo; option. E.g., &rsquo;-vtag xvid&rsquo; will
-force the fourcc &rsquo;xvid&rsquo; to be stored as the video fourcc rather than the
-default.
-</p>
-<a name="How-do-I-encode-videos-which-play-on-the-iPod_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-encode-videos-which-play-on-the-iPod_003f">3.9 How do I encode videos which play on the iPod?</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>needed stuff</samp>&rsquo;</dt>
-<dd><p>-acodec libfaac -vcodec mpeg4 width&lt;=320 height&lt;=240
-</p></dd>
-<dt> &lsquo;<samp>working stuff</samp>&rsquo;</dt>
-<dd><p>mv4, title
-</p></dd>
-<dt> &lsquo;<samp>non-working stuff</samp>&rsquo;</dt>
-<dd><p>B-frames
-</p></dd>
-<dt> &lsquo;<samp>example command line</samp>&rsquo;</dt>
-<dd><p>ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4
-</p></dd>
-</dl>
-
-<a name="How-do-I-encode-videos-which-play-on-the-PSP_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-encode-videos-which-play-on-the-PSP_003f">3.10 How do I encode videos which play on the PSP?</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>needed stuff</samp>&rsquo;</dt>
-<dd><p>-acodec libfaac -vcodec mpeg4 width*height&lt;=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
-</p></dd>
-<dt> &lsquo;<samp>working stuff</samp>&rsquo;</dt>
-<dd><p>mv4, title
-</p></dd>
-<dt> &lsquo;<samp>non-working stuff</samp>&rsquo;</dt>
-<dd><p>B-frames
-</p></dd>
-<dt> &lsquo;<samp>example command line</samp>&rsquo;</dt>
-<dd><p>ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -ar 24000 -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4
-</p></dd>
-<dt> &lsquo;<samp>needed stuff for H.264</samp>&rsquo;</dt>
-<dd><p>-acodec libfaac -vcodec libx264 width*height&lt;=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
-</p></dd>
-<dt> &lsquo;<samp>working stuff for H.264</samp>&rsquo;</dt>
-<dd><p>title, loop filter
-</p></dd>
-<dt> &lsquo;<samp>non-working stuff for H.264</samp>&rsquo;</dt>
-<dd><p>CAVLC
-</p></dd>
-<dt> &lsquo;<samp>example command line</samp>&rsquo;</dt>
-<dd><p>ffmpeg -i input -acodec libfaac -ab 128k -vcodec libx264 -b 1200k -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
-</p></dd>
-<dt> &lsquo;<samp>higher resolution for newer PSP firmwares, width&lt;=480, height&lt;=272</samp>&rsquo;</dt>
-<dd><p>-vcodec libx264 -level 21 -coder 1 -f psp
-</p></dd>
-<dt> &lsquo;<samp>example command line</samp>&rsquo;</dt>
-<dd><p>ffmpeg -i input -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640k -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4
-</p></dd>
-</dl>
-
-<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.11 Which are good parameters for encoding high quality MPEG-4?</a></h2>
-
-<p>&rsquo;-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2&rsquo;,
-things to try: &rsquo;-bf 2&rsquo;, &rsquo;-flags qprd&rsquo;, &rsquo;-flags mv0&rsquo;, &rsquo;-flags skiprd&rsquo;.
-</p>
-<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.12 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></h2>
-
-<p>&rsquo;-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2&rsquo;
-but beware the &rsquo;-g 100&rsquo; might cause problems with some decoders.
-Things to try: &rsquo;-bf 2&rsquo;, &rsquo;-flags qprd&rsquo;, &rsquo;-flags mv0&rsquo;, &rsquo;-flags skiprd.
-</p>
-<a name="Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">3.13 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?</a></h2>
-
-<p>You should use &rsquo;-flags +ilme+ildct&rsquo; and maybe &rsquo;-flags +alt&rsquo; for interlaced
-material, and try &rsquo;-top 0/1&rsquo; if the result looks really messed-up.
-</p>
-<a name="How-can-I-read-DirectShow-files_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-can-I-read-DirectShow-files_003f">3.14 How can I read DirectShow files?</a></h2>
-
-<p>If you have built FFmpeg with <code>./configure --enable-avisynth</code>
-(only possible on MinGW/Cygwin platforms),
-then you may use any file that DirectShow can read as input.
-</p>
-<p>Just create an &quot;input.avs&quot; text file with this single line ...
-</p><table><tr><td>&nbsp;</td><td><pre class="example">  DirectShowSource(&quot;C:\path to your file\yourfile.asf&quot;)
-</pre></td></tr></table>
-<p>... and then feed that text file to ffmpeg:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">  ffmpeg -i input.avs
-</pre></td></tr></table>
-
-<p>For ANY other help on Avisynth, please visit <a href="http://www.avisynth.org/">http://www.avisynth.org/</a>.
-</p>
-<a name="How-can-I-join-video-files_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-can-I-join-video-files_003f">3.15 How can I join video files?</a></h2>
-
-<p>A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to join video files by
-merely concatenating them.
-</p>
-<p>Hence you may concatenate your multimedia files by first transcoding them to
-these privileged formats, then using the humble <code>cat</code> command (or the
-equally humble <code>copy</code> under Windows), and finally transcoding back to your
-format of choice.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input1.avi -sameq intermediate1.mpg
-ffmpeg -i input2.avi -sameq intermediate2.mpg
-cat intermediate1.mpg intermediate2.mpg &gt; intermediate_all.mpg
-ffmpeg -i intermediate_all.mpg -sameq output.avi
-</pre></td></tr></table>
-
-<p>Notice that you should either use <code>-sameq</code> or set a reasonably high
-bitrate for your intermediate and output files, if you want to preserve
-video quality.
-</p>
-<p>Also notice that you may avoid the huge intermediate files by taking advantage
-of named pipes, should your platform support it:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">mkfifo intermediate1.mpg
-mkfifo intermediate2.mpg
-ffmpeg -i input1.avi -sameq -y intermediate1.mpg &lt; /dev/null &amp;
-ffmpeg -i input2.avi -sameq -y intermediate2.mpg &lt; /dev/null &amp;
-cat intermediate1.mpg intermediate2.mpg |\
-ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
-</pre></td></tr></table>
-
-<p>Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
-allow concatenation, and the transcoding step is almost lossless.
-When using multiple yuv4mpegpipe(s), the first line needs to be discarded
-from all but the first stream. This can be accomplished by piping through
-<code>tail</code> as seen below. Note that when piping through <code>tail</code> you
-must use command grouping, <code>{  ;}</code>, to background properly.
-</p>
-<p>For example, let&rsquo;s say we want to join two FLV files into an output.flv file:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">mkfifo temp1.a
-mkfifo temp1.v
-mkfifo temp2.a
-mkfifo temp2.v
-mkfifo all.a
-mkfifo all.v
-ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - &gt; temp1.a &lt; /dev/null &amp;
-ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - &gt; temp2.a &lt; /dev/null &amp;
-ffmpeg -i input1.flv -an -f yuv4mpegpipe - &gt; temp1.v &lt; /dev/null &amp;
-{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - &lt; /dev/null | tail -n +2 &gt; temp2.v ; } &amp;
-cat temp1.a temp2.a &gt; all.a &amp;
-cat temp1.v temp2.v &gt; all.v &amp;
-ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-       -f yuv4mpegpipe -i all.v \
-       -sameq -y output.flv
-rm temp[12].[av] all.[av]
-</pre></td></tr></table>
-
-<a name="The-ffmpeg-program-does-not-respect-the-_002dmaxrate-setting_002c-some-frames-are-bigger-than-maxrate_002ffps_002e"></a>
-<h2 class="section"><a href="faq.html#toc-The-ffmpeg-program-does-not-respect-the-_002dmaxrate-setting_002c-some-frames-are-bigger-than-maxrate_002ffps_002e">3.16 The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.</a></h2>
-
-<p>Read the MPEG spec about video buffer verifier.
-</p>
-<a name="I-want-CBR_002c-but-no-matter-what-I-do-frame-sizes-differ_002e"></a>
-<h2 class="section"><a href="faq.html#toc-I-want-CBR_002c-but-no-matter-what-I-do-frame-sizes-differ_002e">3.17 I want CBR, but no matter what I do frame sizes differ.</a></h2>
-
-<p>You do not understand what CBR is, please read the MPEG spec.
-Read about video buffer verifier and constant bitrate.
-The one sentence summary is that there is a buffer and the input rate is
-constant, the output can vary as needed.
-</p>
-<a name="How-do-I-check-if-a-stream-is-CBR_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-check-if-a-stream-is-CBR_003f">3.18 How do I check if a stream is CBR?</a></h2>
-
-<p>To quote the MPEG-2 spec:
-&quot;There is no way to tell that a bitstream is constant bitrate without
-examining all of the vbv_delay values and making complicated computations.&quot;
-</p>
-
-<a name="Development"></a>
-<h1 class="chapter"><a href="faq.html#toc-Development">4. Development</a></h1>
-
-<a name="Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?</a></h2>
-
-<p>Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively,
-examine the source code for one of the many open source projects that
-already incorporate FFmpeg at (<a href="projects.html">projects.html</a>).
-</p>
-<a name="Can-you-support-my-C-compiler-XXX_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></h2>
-
-<p>It depends. If your compiler is C99-compliant, then patches to support
-it are likely to be welcome if they do not pollute the source code
-with <code>#ifdef</code>s related to the compiler.
-</p>
-<a name="Is-Microsoft-Visual-C_002b_002b-supported_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></h2>
-
-<p>No. Microsoft Visual C++ is not compliant to the C99 standard and does
-not - among other things - support the inline assembly used in FFmpeg.
-If you wish to use MSVC++ for your
-project then you can link the MSVC++ code with libav* as long as
-you compile the latter with a working C compiler. For more information, see
-the <em>Microsoft Visual C++ compatibility</em> section in the FFmpeg
-documentation.
-</p>
-<p>There have been efforts to make FFmpeg compatible with MSVC++ in the
-past. However, they have all been rejected as too intrusive, especially
-since MinGW does the job adequately. None of the core developers
-work with MSVC++ and thus this item is low priority. Should you find
-the silver bullet that solves this problem, feel free to shoot it at us.
-</p>
-<p>We strongly recommend you to move over from MSVC++ to MinGW tools.
-</p>
-<a name="Can-I-use-FFmpeg-or-libavcodec-under-Windows_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Can-I-use-FFmpeg-or-libavcodec-under-Windows_003f">4.4 Can I use FFmpeg or libavcodec under Windows?</a></h2>
-
-<p>Yes, but the Cygwin or MinGW tools <em>must</em> be used to compile FFmpeg.
-Read the <em>Windows</em> section in the FFmpeg documentation to find more
-information.
-</p>
-<p>To get help and instructions for building FFmpeg under Windows, check out
-the FFmpeg Windows Help Forum at
-<a href="http://ffmpeg.arrozcru.org/">http://ffmpeg.arrozcru.org/</a>.
-</p>
-<a name="Can-you-add-automake_002c-libtool-or-autoconf-support_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.5 Can you add automake, libtool or autoconf support?</a></h2>
-
-<p>No. These tools are too bloated and they complicate the build.
-</p>
-<a name="Why-not-rewrite-ffmpeg-in-object_002doriented-C_002b_002b_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Why-not-rewrite-ffmpeg-in-object_002doriented-C_002b_002b_003f">4.6 Why not rewrite ffmpeg in object-oriented C++?</a></h2>
-
-<p>FFmpeg is already organized in a highly modular manner and does not need to
-be rewritten in a formal object language. Further, many of the developers
-favor straight C; it works for them. For more arguments on this matter,
-read &quot;Programming Religion&quot; at (<a href="http://www.tux.org/lkml/#s15">http://www.tux.org/lkml/#s15</a>).
-</p>
-<a name="Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f">4.7 Why are the ffmpeg programs devoid of debugging symbols?</a></h2>
-
-<p>The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug
-information. Those binaries are stripped to create ffmpeg, ffplay, etc. If
-you need the debug information, use the *_g versions.
-</p>
-<a name="I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f"></a>
-<h2 class="section"><a href="faq.html#toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.8 I do not like the LGPL, can I contribute code under the GPL instead?</a></h2>
-
-<p>Yes, as long as the code is optional and can easily and cleanly be placed
-under #if CONFIG_GPL without breaking anything. So for example a new codec
-or filter would be OK under GPL while a bug fix to LGPL code would not.
-</p>
-<a name="I-want-to-compile-xyz_002ec-alone-but-my-compiler-produced-many-errors_002e"></a>
-<h2 class="section"><a href="faq.html#toc-I-want-to-compile-xyz_002ec-alone-but-my-compiler-produced-many-errors_002e">4.9 I want to compile xyz.c alone but my compiler produced many errors.</a></h2>
-
-<p>Common code is in its own files in libav* and is used by the individual
-codecs. They will not work without the common parts, you have to compile
-the whole libav*. If you wish, disable some parts with configure switches.
-You can also try to hack it and remove more, but if you had problems fixing
-the compilation failure then you are probably not qualified for this.
-</p>
-<a name="I_0027m-using-libavcodec-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e"></a>
-<h2 class="section"><a href="faq.html#toc-I_0027m-using-libavcodec-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.10 I&rsquo;m using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.</a></h2>
-
-<p>FFmpeg is a pure C project, so to use the libraries within your C++ application
-you need to explicitly state that you are using a C library. You can do this by
-encompassing your FFmpeg includes using <code>extern &quot;C&quot;</code>.
-</p>
-<p>See <a href="http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3">http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3</a>
-</p>
-<a name="I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f"></a>
-<h2 class="section"><a href="faq.html#toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></h2>
-
-<p>You have to implement a URLProtocol, see &lsquo;<tt>libavformat/file.c</tt>&rsquo; in
-FFmpeg and &lsquo;<tt>libmpdemux/demux_lavf.c</tt>&rsquo; in MPlayer sources.
-</p>
-<a name="I-get-_0022No-compatible-shell-script-interpreter-found_002e_0022-in-MSys_002e"></a>
-<h2 class="section"><a href="faq.html#toc-I-get-_0022No-compatible-shell-script-interpreter-found_002e_0022-in-MSys_002e">4.12 I get &quot;No compatible shell script interpreter found.&quot; in MSys.</a></h2>
-
-<p>The standard MSys bash (2.04) is broken. You need to install 2.05 or later.
-</p>
-<a name="I-get-_0022_002e_002fconfigure_003a-line-_003cxxx_003e_003a-pr_003a-command-not-found_0022-in-MSys_002e"></a>
-<h2 class="section"><a href="faq.html#toc-I-get-_0022_002e_002fconfigure_003a-line-_003cxxx_003e_003a-pr_003a-command-not-found_0022-in-MSys_002e">4.13 I get &quot;./configure: line &lt;xxx&gt;: pr: command not found&quot; in MSys.</a></h2>
-
-<p>The standard MSys install doesn&rsquo;t come with pr. You need to get it from the coreutils package.
-</p>
-<a name="Where-can-I-find-libav_002a-headers-for-Pascal_002fDelphi_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Where-can-I-find-libav_002a-headers-for-Pascal_002fDelphi_003f">4.14 Where can I find libav* headers for Pascal/Delphi?</a></h2>
-
-<p>see <a href="http://www.iversenit.dk/dev/ffmpeg-headers/">http://www.iversenit.dk/dev/ffmpeg-headers/</a>
-</p>
-<a name="Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f"></a>
-<h2 class="section"><a href="faq.html#toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f">4.15 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?</a></h2>
-
-<p>see <a href="http://www.ffmpeg.org/~michael/">http://www.ffmpeg.org/~michael/</a>
-</p>
-<a name="How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f"></a>
-<h2 class="section"><a href="faq.html#toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f">4.16 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?</a></h2>
-
-<p>Even if peculiar since it is network oriented, RTP is a container like any
-other. You have to <em>demux</em> RTP before feeding the payload to libavcodec.
-In this specific case please look at RFC 4629 to see how it should be done.
-</p>
-<a name="AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-framerate_002e"></a>
-<h2 class="section"><a href="faq.html#toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-framerate_002e">4.17 AVStream.r_frame_rate is wrong, it is much larger than the framerate.</a></h2>
-
-<p>r_frame_rate is NOT the average framerate, it is the smallest framerate
-that can accurately represent all timestamps. So no, it is not
-wrong if it is larger than the average!
-For example, if you have mixed 25 and 30 fps content, then r_frame_rate
-will be 150.
-</p>
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/doc/ffmpeg.html b/ffmpeg 0.7/doc/ffmpeg.html
deleted file mode 100644 (file)
index 9154280..0000000
+++ /dev/null
@@ -1,5856 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>ffmpeg Documentation</title>
-
-<meta name="description" content="ffmpeg Documentation">
-<meta name="keywords" content="ffmpeg Documentation">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">ffmpeg Documentation</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
-  <li><a name="toc-Description" href="#Description">2. Description</a></li>
-  <li><a name="toc-Options-4" href="#Options-4">3. Options</a>
-  <ul class="toc">
-    <li><a name="toc-Generic-options" href="#Generic-options">3.1 Generic options</a></li>
-    <li><a name="toc-Main-options" href="#Main-options">3.2 Main options</a></li>
-    <li><a name="toc-Video-Options" href="#Video-Options">3.3 Video Options</a></li>
-    <li><a name="toc-Advanced-Video-Options" href="#Advanced-Video-Options">3.4 Advanced Video Options</a></li>
-    <li><a name="toc-Audio-Options" href="#Audio-Options">3.5 Audio Options</a></li>
-    <li><a name="toc-Advanced-Audio-options_003a" href="#Advanced-Audio-options_003a">3.6 Advanced Audio options:</a></li>
-    <li><a name="toc-Subtitle-options_003a" href="#Subtitle-options_003a">3.7 Subtitle options:</a></li>
-    <li><a name="toc-Audio_002fVideo-grab-options" href="#Audio_002fVideo-grab-options">3.8 Audio/Video grab options</a></li>
-    <li><a name="toc-Advanced-options" href="#Advanced-options">3.9 Advanced options</a></li>
-    <li><a name="toc-Preset-files" href="#Preset-files">3.10 Preset files</a></li>
-  </ul></li>
-  <li><a name="toc-Tips" href="#Tips">4. Tips</a></li>
-  <li><a name="toc-Examples" href="#Examples">5. Examples</a>
-  <ul class="toc">
-    <li><a name="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">5.1 Video and Audio grabbing</a></li>
-    <li><a name="toc-X11-grabbing" href="#X11-grabbing">5.2 X11 grabbing</a></li>
-    <li><a name="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">5.3 Video and Audio file format conversion</a></li>
-  </ul></li>
-  <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">6. Expression Evaluation</a></li>
-  <li><a name="toc-Decoders" href="#Decoders">7. Decoders</a></li>
-  <li><a name="toc-Video-Decoders" href="#Video-Decoders">8. Video Decoders</a>
-  <ul class="toc">
-    <li><a name="toc-rawvideo" href="#rawvideo">8.1 rawvideo</a>
-    <ul class="toc">
-      <li><a name="toc-Options" href="#Options">8.1.1 Options</a></li>
-    </ul>
-</li>
-  </ul></li>
-  <li><a name="toc-Encoders" href="#Encoders">9. Encoders</a></li>
-  <li><a name="toc-Audio-Encoders" href="#Audio-Encoders">10. Audio Encoders</a>
-  <ul class="toc">
-    <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">10.1 ac3 and ac3_fixed</a>
-    <ul class="toc">
-      <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">10.1.1 AC-3 Metadata</a>
-      <ul class="toc">
-        <li><a name="toc-Metadata-Control-Options" href="#Metadata-Control-Options">10.1.1.1 Metadata Control Options</a></li>
-        <li><a name="toc-Downmix-Levels" href="#Downmix-Levels">10.1.1.2 Downmix Levels</a></li>
-        <li><a name="toc-Audio-Production-Information" href="#Audio-Production-Information">10.1.1.3 Audio Production Information</a></li>
-        <li><a name="toc-Other-Metadata-Options" href="#Other-Metadata-Options">10.1.1.4 Other Metadata Options</a></li>
-      </ul></li>
-      <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">10.1.2 Extended Bitstream Information</a>
-      <ul class="toc">
-        <li><a name="toc-Extended-Bitstream-Information-_002d-Part-1" href="#Extended-Bitstream-Information-_002d-Part-1">10.1.2.1 Extended Bitstream Information - Part 1</a></li>
-        <li><a name="toc-Extended-Bitstream-Information-_002d-Part-2" href="#Extended-Bitstream-Information-_002d-Part-2">10.1.2.2 Extended Bitstream Information - Part 2</a></li>
-      </ul></li>
-      <li><a name="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">10.1.3 Other AC-3 Encoding Options</a></li>
-      <li><a name="toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">10.1.4 Floating-Point-Only AC-3 Encoding Options</a></li>
-    </ul>
-</li>
-  </ul></li>
-  <li><a name="toc-Video-Encoders" href="#Video-Encoders">11. Video Encoders</a>
-  <ul class="toc">
-    <li><a name="toc-libvpx" href="#libvpx">11.1 libvpx</a>
-    <ul class="toc">
-      <li><a name="toc-Options-1" href="#Options-1">11.1.1 Options</a></li>
-    </ul></li>
-    <li><a name="toc-libx264" href="#libx264">11.2 libx264</a>
-    <ul class="toc">
-      <li><a name="toc-Options-2" href="#Options-2">11.2.1 Options</a></li>
-    </ul>
-</li>
-  </ul></li>
-  <li><a name="toc-Demuxers" href="#Demuxers">12. Demuxers</a>
-  <ul class="toc">
-    <li><a name="toc-image2" href="#image2">12.1 image2</a></li>
-    <li><a name="toc-applehttp" href="#applehttp">12.2 applehttp</a></li>
-  </ul></li>
-  <li><a name="toc-Muxers" href="#Muxers">13. Muxers</a>
-  <ul class="toc">
-    <li><a name="toc-crc-1" href="#crc-1">13.1 crc</a></li>
-    <li><a name="toc-framecrc-1" href="#framecrc-1">13.2 framecrc</a></li>
-    <li><a name="toc-image2-1" href="#image2-1">13.3 image2</a></li>
-    <li><a name="toc-mpegts" href="#mpegts">13.4 mpegts</a></li>
-    <li><a name="toc-null" href="#null">13.5 null</a></li>
-    <li><a name="toc-matroska" href="#matroska">13.6 matroska</a></li>
-  </ul></li>
-  <li><a name="toc-Input-Devices" href="#Input-Devices">14. Input Devices</a>
-  <ul class="toc">
-    <li><a name="toc-alsa-1" href="#alsa-1">14.1 alsa</a></li>
-    <li><a name="toc-bktr" href="#bktr">14.2 bktr</a></li>
-    <li><a name="toc-dv1394" href="#dv1394">14.3 dv1394</a></li>
-    <li><a name="toc-fbdev" href="#fbdev">14.4 fbdev</a></li>
-    <li><a name="toc-jack" href="#jack">14.5 jack</a></li>
-    <li><a name="toc-libdc1394" href="#libdc1394">14.6 libdc1394</a></li>
-    <li><a name="toc-oss-1" href="#oss-1">14.7 oss</a></li>
-    <li><a name="toc-sndio" href="#sndio">14.8 sndio</a></li>
-    <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">14.9 video4linux and video4linux2</a></li>
-    <li><a name="toc-vfwcap" href="#vfwcap">14.10 vfwcap</a></li>
-    <li><a name="toc-x11grab" href="#x11grab">14.11 x11grab</a></li>
-  </ul></li>
-  <li><a name="toc-Output-Devices" href="#Output-Devices">15. Output Devices</a>
-  <ul class="toc">
-    <li><a name="toc-alsa" href="#alsa">15.1 alsa</a></li>
-    <li><a name="toc-oss" href="#oss">15.2 oss</a></li>
-    <li><a name="toc-sdl" href="#sdl">15.3 sdl</a>
-    <ul class="toc">
-      <li><a name="toc-Options-3" href="#Options-3">15.3.1 Options</a></li>
-      <li><a name="toc-Examples-1" href="#Examples-1">15.3.2 Examples</a></li>
-    </ul></li>
-    <li><a name="toc-sndio-1" href="#sndio-1">15.4 sndio</a></li>
-  </ul></li>
-  <li><a name="toc-Protocols" href="#Protocols">16. Protocols</a>
-  <ul class="toc">
-    <li><a name="toc-applehttp-1" href="#applehttp-1">16.1 applehttp</a></li>
-    <li><a name="toc-concat" href="#concat">16.2 concat</a></li>
-    <li><a name="toc-file" href="#file">16.3 file</a></li>
-    <li><a name="toc-gopher" href="#gopher">16.4 gopher</a></li>
-    <li><a name="toc-http" href="#http">16.5 http</a></li>
-    <li><a name="toc-mmst" href="#mmst">16.6 mmst</a></li>
-    <li><a name="toc-mmsh" href="#mmsh">16.7 mmsh</a></li>
-    <li><a name="toc-md5" href="#md5">16.8 md5</a></li>
-    <li><a name="toc-pipe" href="#pipe">16.9 pipe</a></li>
-    <li><a name="toc-rtmp" href="#rtmp">16.10 rtmp</a></li>
-    <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">16.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
-    <li><a name="toc-rtp" href="#rtp">16.12 rtp</a></li>
-    <li><a name="toc-rtsp" href="#rtsp">16.13 rtsp</a></li>
-    <li><a name="toc-sap" href="#sap">16.14 sap</a>
-    <ul class="toc">
-      <li><a name="toc-Muxer" href="#Muxer">16.14.1 Muxer</a></li>
-      <li><a name="toc-Demuxer" href="#Demuxer">16.14.2 Demuxer</a></li>
-    </ul></li>
-    <li><a name="toc-tcp" href="#tcp">16.15 tcp</a></li>
-    <li><a name="toc-udp" href="#udp">16.16 udp</a></li>
-  </ul></li>
-  <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">17. Bitstream Filters</a>
-  <ul class="toc">
-    <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">17.1 aac_adtstoasc</a></li>
-    <li><a name="toc-chomp" href="#chomp">17.2 chomp</a></li>
-    <li><a name="toc-dump_005fextradata" href="#dump_005fextradata">17.3 dump_extradata</a></li>
-    <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">17.4 h264_mp4toannexb</a></li>
-    <li><a name="toc-imx_005fdump_005fheader" href="#imx_005fdump_005fheader">17.5 imx_dump_header</a></li>
-    <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">17.6 mjpeg2jpeg</a></li>
-    <li><a name="toc-mjpega_005fdump_005fheader" href="#mjpega_005fdump_005fheader">17.7 mjpega_dump_header</a></li>
-    <li><a name="toc-movsub" href="#movsub">17.8 movsub</a></li>
-    <li><a name="toc-mp3_005fheader_005fcompress" href="#mp3_005fheader_005fcompress">17.9 mp3_header_compress</a></li>
-    <li><a name="toc-mp3_005fheader_005fdecompress" href="#mp3_005fheader_005fdecompress">17.10 mp3_header_decompress</a></li>
-    <li><a name="toc-noise" href="#noise">17.11 noise</a></li>
-    <li><a name="toc-remove_005fextradata" href="#remove_005fextradata">17.12 remove_extradata</a></li>
-  </ul></li>
-  <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">18. Filtergraph description</a>
-  <ul class="toc">
-    <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">18.1 Filtergraph syntax</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Filters" href="#Audio-Filters">19. Audio Filters</a>
-  <ul class="toc">
-    <li><a name="toc-anull" href="#anull">19.1 anull</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Sources" href="#Audio-Sources">20. Audio Sources</a>
-  <ul class="toc">
-    <li><a name="toc-anullsrc" href="#anullsrc">20.1 anullsrc</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">21. Audio Sinks</a>
-  <ul class="toc">
-    <li><a name="toc-anullsink" href="#anullsink">21.1 anullsink</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Filters" href="#Video-Filters">22. Video Filters</a>
-  <ul class="toc">
-    <li><a name="toc-blackframe" href="#blackframe">22.1 blackframe</a></li>
-    <li><a name="toc-copy" href="#copy">22.2 copy</a></li>
-    <li><a name="toc-crop" href="#crop">22.3 crop</a></li>
-    <li><a name="toc-cropdetect" href="#cropdetect">22.4 cropdetect</a></li>
-    <li><a name="toc-drawbox" href="#drawbox">22.5 drawbox</a></li>
-    <li><a name="toc-drawtext" href="#drawtext">22.6 drawtext</a></li>
-    <li><a name="toc-fade" href="#fade">22.7 fade</a></li>
-    <li><a name="toc-fieldorder" href="#fieldorder">22.8 fieldorder</a></li>
-    <li><a name="toc-fifo" href="#fifo">22.9 fifo</a></li>
-    <li><a name="toc-format" href="#format">22.10 format</a></li>
-    <li><a name="toc-frei0r-1" href="#frei0r-1">22.11 frei0r</a></li>
-    <li><a name="toc-gradfun" href="#gradfun">22.12 gradfun</a></li>
-    <li><a name="toc-hflip" href="#hflip">22.13 hflip</a></li>
-    <li><a name="toc-hqdn3d" href="#hqdn3d">22.14 hqdn3d</a></li>
-    <li><a name="toc-mp" href="#mp">22.15 mp</a></li>
-    <li><a name="toc-noformat" href="#noformat">22.16 noformat</a></li>
-    <li><a name="toc-null-1" href="#null-1">22.17 null</a></li>
-    <li><a name="toc-ocv" href="#ocv">22.18 ocv</a>
-    <ul class="toc">
-      <li><a name="toc-dilate-1" href="#dilate-1">22.18.1 dilate</a></li>
-      <li><a name="toc-erode" href="#erode">22.18.2 erode</a></li>
-      <li><a name="toc-smooth" href="#smooth">22.18.3 smooth</a></li>
-    </ul></li>
-    <li><a name="toc-overlay" href="#overlay">22.19 overlay</a></li>
-    <li><a name="toc-pad" href="#pad">22.20 pad</a></li>
-    <li><a name="toc-pixdesctest" href="#pixdesctest">22.21 pixdesctest</a></li>
-    <li><a name="toc-scale" href="#scale">22.22 scale</a></li>
-    <li><a name="toc-select" href="#select">22.23 select</a></li>
-    <li><a name="toc-setdar-1" href="#setdar-1">22.24 setdar</a></li>
-    <li><a name="toc-setpts" href="#setpts">22.25 setpts</a></li>
-    <li><a name="toc-setsar-1" href="#setsar-1">22.26 setsar</a></li>
-    <li><a name="toc-settb" href="#settb">22.27 settb</a></li>
-    <li><a name="toc-showinfo" href="#showinfo">22.28 showinfo</a></li>
-    <li><a name="toc-slicify" href="#slicify">22.29 slicify</a></li>
-    <li><a name="toc-split" href="#split">22.30 split</a></li>
-    <li><a name="toc-transpose" href="#transpose">22.31 transpose</a></li>
-    <li><a name="toc-unsharp" href="#unsharp">22.32 unsharp</a></li>
-    <li><a name="toc-vflip" href="#vflip">22.33 vflip</a></li>
-    <li><a name="toc-yadif" href="#yadif">22.34 yadif</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Sources" href="#Video-Sources">23. Video Sources</a>
-  <ul class="toc">
-    <li><a name="toc-buffer" href="#buffer">23.1 buffer</a></li>
-    <li><a name="toc-color" href="#color">23.2 color</a></li>
-    <li><a name="toc-movie" href="#movie">23.3 movie</a></li>
-    <li><a name="toc-nullsrc" href="#nullsrc">23.4 nullsrc</a></li>
-    <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">23.5 frei0r_src</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Sinks" href="#Video-Sinks">24. Video Sinks</a>
-  <ul class="toc">
-    <li><a name="toc-nullsink" href="#nullsink">24.1 nullsink</a></li>
-  </ul></li>
-  <li><a name="toc-Metadata" href="#Metadata">25. Metadata</a></li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="Synopsis"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Synopsis">1. Synopsis</a></h1>
-
-<p>The generic syntax is:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg [[infile options][&lsquo;<samp>-i</samp>&rsquo; <var>infile</var>]]... {[outfile options] <var>outfile</var>}...
-</pre></td></tr></table>
-
-<a name="Description"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Description">2. Description</a></h1>
-
-<p>ffmpeg is a very fast video and audio converter that can also grab from
-a live audio/video source. It can also convert between arbitrary sample
-rates and resize video on the fly with a high quality polyphase filter.
-</p>
-<p>The command line interface is designed to be intuitive, in the sense
-that ffmpeg tries to figure out all parameters that can possibly be
-derived automatically. You usually only have to specify the target
-bitrate you want.
-</p>
-<p>As a general rule, options are applied to the next specified
-file. Therefore, order is important, and you can have the same
-option on the command line multiple times. Each occurrence is
-then applied to the next input or output file.
-</p>
-<ul>
-<li>
-To set the video bitrate of the output file to 64kbit/s:
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.avi -b 64k output.avi
-</pre></td></tr></table>
-
-</li><li>
-To force the frame rate of the output file to 24 fps:
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.avi -r 24 output.avi
-</pre></td></tr></table>
-
-</li><li>
-To force the frame rate of the input file (valid for raw formats only)
-to 1 fps and the frame rate of the output file to 24 fps:
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 1 -i input.m2v -r 24 output.avi
-</pre></td></tr></table>
-</li></ul>
-
-<p>The format option may be needed for raw input files.
-</p>
-<p>By default ffmpeg tries to convert as losslessly as possible: It
-uses the same audio and video parameters for the outputs as the one
-specified for the inputs.
-</p>
-
-<a name="Options-4"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Options-4">3. Options</a></h1>
-
-<p>All the numerical options, if not specified otherwise, accept in input
-a string representing a number, which may contain one of the
-International System number postfixes, for example &rsquo;K&rsquo;, &rsquo;M&rsquo;, &rsquo;G&rsquo;.
-If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used instead of
-powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8, and can be
-appended after another postfix or used alone. This allows using for
-example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
-</p>
-<p>Options which do not take arguments are boolean options, and set the
-corresponding value to true. They can be set to false by prefixing
-with &quot;no&quot; the option name, for example using &quot;-nofoo&quot; in the
-commandline will set to false the boolean option with name &quot;foo&quot;.
-</p>
-<a name="Generic-options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Generic-options">3.1 Generic options</a></h2>
-
-<p>These options are shared amongst the ff* tools.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
-<dd><p>Show license.
-</p>
-</dd>
-<dt> &lsquo;<samp>-h, -?, -help, --help</samp>&rsquo;</dt>
-<dd><p>Show help.
-</p>
-</dd>
-<dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
-<dd><p>Show version.
-</p>
-</dd>
-<dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
-<dd><p>Show available formats.
-</p>
-<p>The fields preceding the format names have the following meanings:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Decoding available
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Encoding available
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
-<dd><p>Show available codecs.
-</p>
-<p>The fields preceding the codec names have the following meanings:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Decoding available
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Encoding available
-</p></dd>
-<dt> &lsquo;<samp>V/A/S</samp>&rsquo;</dt>
-<dd><p>Video/audio/subtitle codec
-</p></dd>
-<dt> &lsquo;<samp>S</samp>&rsquo;</dt>
-<dd><p>Codec supports slices
-</p></dd>
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Codec supports direct rendering
-</p></dd>
-<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
-<dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
-<dd><p>Show available bitstream filters.
-</p>
-</dd>
-<dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
-<dd><p>Show available protocols.
-</p>
-</dd>
-<dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
-<dd><p>Show available libavfilter filters.
-</p>
-</dd>
-<dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
-<dd><p>Show available pixel formats.
-</p>
-</dd>
-<dt> &lsquo;<samp>-loglevel <var>loglevel</var></samp>&rsquo;</dt>
-<dd><p>Set the logging level used by the library.
-<var>loglevel</var> is a number or a string containing one of the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>error</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>info</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
-</dl>
-
-<p>By default the program logs to stderr, if coloring is supported by the
-terminal, colors are used to mark errors and warnings. Log coloring
-can be disabled setting the environment variable
-<code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
-the environment variable <code>FFMPEG_FORCE_COLOR</code>.
-The use of the environment variable <code>NO_COLOR</code> is deprecated and
-will be dropped in a following FFmpeg version.
-</p>
-</dd>
-</dl>
-
-<a name="Main-options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Main-options">3.2 Main options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-f <var>fmt</var></samp>&rsquo;</dt>
-<dd><p>Force format.
-</p>
-</dd>
-<dt> &lsquo;<samp>-i <var>filename</var></samp>&rsquo;</dt>
-<dd><p>input file name
-</p>
-</dd>
-<dt> &lsquo;<samp>-y</samp>&rsquo;</dt>
-<dd><p>Overwrite output files.
-</p>
-</dd>
-<dt> &lsquo;<samp>-t <var>duration</var></samp>&rsquo;</dt>
-<dd><p>Restrict the transcoded/captured video sequence
-to the duration specified in seconds.
-<code>hh:mm:ss[.xxx]</code> syntax is also supported.
-</p>
-</dd>
-<dt> &lsquo;<samp>-fs <var>limit_size</var></samp>&rsquo;</dt>
-<dd><p>Set the file size limit.
-</p>
-</dd>
-<dt> &lsquo;<samp>-ss <var>position</var></samp>&rsquo;</dt>
-<dd><p>Seek to given time position in seconds.
-<code>hh:mm:ss[.xxx]</code> syntax is also supported.
-</p>
-</dd>
-<dt> &lsquo;<samp>-itsoffset <var>offset</var></samp>&rsquo;</dt>
-<dd><p>Set the input time offset in seconds.
-<code>[-]hh:mm:ss[.xxx]</code> syntax is also supported.
-This option affects all the input files that follow it.
-The offset is added to the timestamps of the input files.
-Specifying a positive offset means that the corresponding
-streams are delayed by &rsquo;offset&rsquo; seconds.
-</p>
-</dd>
-<dt> &lsquo;<samp>-timestamp <var>time</var></samp>&rsquo;</dt>
-<dd><p>Set the recording timestamp in the container.
-The syntax for <var>time</var> is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
-</pre></td></tr></table>
-<p>If the value is &quot;now&quot; it takes the current time.
-Time is local time unless &rsquo;Z&rsquo; or &rsquo;z&rsquo; is appended, in which case it is
-interpreted as UTC.
-If the year-month-day part is not specified it takes the current
-year-month-day.
-</p>
-</dd>
-<dt> &lsquo;<samp>-metadata <var>key</var>=<var>value</var></samp>&rsquo;</dt>
-<dd><p>Set a metadata key/value pair.
-</p>
-<p>For example, for setting the title in the output file:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>-v <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the logging verbosity level.
-</p>
-</dd>
-<dt> &lsquo;<samp>-target <var>type</var></samp>&rsquo;</dt>
-<dd><p>Specify target file type (&quot;vcd&quot;, &quot;svcd&quot;, &quot;dvd&quot;, &quot;dv&quot;, &quot;dv50&quot;, &quot;pal-vcd&quot;,
-&quot;ntsc-svcd&quot;, ... ). All the format options (bitrate, codecs,
-buffer sizes) are then set automatically. You can just type:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
-</pre></td></tr></table>
-
-<p>Nevertheless you can specify additional options as long as you know
-they do not conflict with the standard, as in:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>-dframes <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the number of data frames to record.
-</p>
-</dd>
-<dt> &lsquo;<samp>-scodec <var>codec</var></samp>&rsquo;</dt>
-<dd><p>Force subtitle codec (&rsquo;copy&rsquo; to copy stream).
-</p>
-</dd>
-<dt> &lsquo;<samp>-newsubtitle</samp>&rsquo;</dt>
-<dd><p>Add a new subtitle stream to the current output stream.
-</p>
-</dd>
-<dt> &lsquo;<samp>-slang <var>code</var></samp>&rsquo;</dt>
-<dd><p>Set the ISO 639 language code (3 letters) of the current subtitle stream.
-</p>
-</dd>
-</dl>
-
-<a name="Video-Options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Video-Options">3.3 Video Options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-b <var>bitrate</var></samp>&rsquo;</dt>
-<dd><p>Set the video bitrate in bit/s (default = 200 kb/s).
-</p></dd>
-<dt> &lsquo;<samp>-vframes <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the number of video frames to record.
-</p></dd>
-<dt> &lsquo;<samp>-r <var>fps</var></samp>&rsquo;</dt>
-<dd><p>Set frame rate (Hz value, fraction or abbreviation), (default = 25).
-</p></dd>
-<dt> &lsquo;<samp>-s <var>size</var></samp>&rsquo;</dt>
-<dd><p>Set frame size. The format is &lsquo;<samp>wxh</samp>&rsquo; (ffserver default = 160x128).
-There is no default for input streams,
-for output streams it is set by default to the size of the source stream.
-If the input file has video streams with different resolutions, the behaviour is undefined.
-The following abbreviations are recognized:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>sqcif</samp>&rsquo;</dt>
-<dd><p>128x96
-</p></dd>
-<dt> &lsquo;<samp>qcif</samp>&rsquo;</dt>
-<dd><p>176x144
-</p></dd>
-<dt> &lsquo;<samp>cif</samp>&rsquo;</dt>
-<dd><p>352x288
-</p></dd>
-<dt> &lsquo;<samp>4cif</samp>&rsquo;</dt>
-<dd><p>704x576
-</p></dd>
-<dt> &lsquo;<samp>16cif</samp>&rsquo;</dt>
-<dd><p>1408x1152
-</p></dd>
-<dt> &lsquo;<samp>qqvga</samp>&rsquo;</dt>
-<dd><p>160x120
-</p></dd>
-<dt> &lsquo;<samp>qvga</samp>&rsquo;</dt>
-<dd><p>320x240
-</p></dd>
-<dt> &lsquo;<samp>vga</samp>&rsquo;</dt>
-<dd><p>640x480
-</p></dd>
-<dt> &lsquo;<samp>svga</samp>&rsquo;</dt>
-<dd><p>800x600
-</p></dd>
-<dt> &lsquo;<samp>xga</samp>&rsquo;</dt>
-<dd><p>1024x768
-</p></dd>
-<dt> &lsquo;<samp>uxga</samp>&rsquo;</dt>
-<dd><p>1600x1200
-</p></dd>
-<dt> &lsquo;<samp>qxga</samp>&rsquo;</dt>
-<dd><p>2048x1536
-</p></dd>
-<dt> &lsquo;<samp>sxga</samp>&rsquo;</dt>
-<dd><p>1280x1024
-</p></dd>
-<dt> &lsquo;<samp>qsxga</samp>&rsquo;</dt>
-<dd><p>2560x2048
-</p></dd>
-<dt> &lsquo;<samp>hsxga</samp>&rsquo;</dt>
-<dd><p>5120x4096
-</p></dd>
-<dt> &lsquo;<samp>wvga</samp>&rsquo;</dt>
-<dd><p>852x480
-</p></dd>
-<dt> &lsquo;<samp>wxga</samp>&rsquo;</dt>
-<dd><p>1366x768
-</p></dd>
-<dt> &lsquo;<samp>wsxga</samp>&rsquo;</dt>
-<dd><p>1600x1024
-</p></dd>
-<dt> &lsquo;<samp>wuxga</samp>&rsquo;</dt>
-<dd><p>1920x1200
-</p></dd>
-<dt> &lsquo;<samp>woxga</samp>&rsquo;</dt>
-<dd><p>2560x1600
-</p></dd>
-<dt> &lsquo;<samp>wqsxga</samp>&rsquo;</dt>
-<dd><p>3200x2048
-</p></dd>
-<dt> &lsquo;<samp>wquxga</samp>&rsquo;</dt>
-<dd><p>3840x2400
-</p></dd>
-<dt> &lsquo;<samp>whsxga</samp>&rsquo;</dt>
-<dd><p>6400x4096
-</p></dd>
-<dt> &lsquo;<samp>whuxga</samp>&rsquo;</dt>
-<dd><p>7680x4800
-</p></dd>
-<dt> &lsquo;<samp>cga</samp>&rsquo;</dt>
-<dd><p>320x200
-</p></dd>
-<dt> &lsquo;<samp>ega</samp>&rsquo;</dt>
-<dd><p>640x350
-</p></dd>
-<dt> &lsquo;<samp>hd480</samp>&rsquo;</dt>
-<dd><p>852x480
-</p></dd>
-<dt> &lsquo;<samp>hd720</samp>&rsquo;</dt>
-<dd><p>1280x720
-</p></dd>
-<dt> &lsquo;<samp>hd1080</samp>&rsquo;</dt>
-<dd><p>1920x1080
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-aspect <var>aspect</var></samp>&rsquo;</dt>
-<dd><p>Set the video display aspect ratio specified by <var>aspect</var>.
-</p>
-<p><var>aspect</var> can be a floating point number string, or a string of the
-form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
-&quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
-</p>
-</dd>
-<dt> &lsquo;<samp>-croptop <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-cropbottom <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-cropleft <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-cropright <var>size</var></samp>&rsquo;</dt>
-<dd><p>All the crop options have been removed. Use -vf
-crop=width:height:x:y instead.
-</p>
-</dd>
-<dt> &lsquo;<samp>-padtop <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-padbottom <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-padleft <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-padright <var>size</var></samp>&rsquo;</dt>
-<dt> &lsquo;<samp>-padcolor <var>hex_color</var></samp>&rsquo;</dt>
-<dd><p>All the pad options have been removed. Use -vf
-pad=width:height:x:y:color instead.
-</p></dd>
-<dt> &lsquo;<samp>-vn</samp>&rsquo;</dt>
-<dd><p>Disable video recording.
-</p></dd>
-<dt> &lsquo;<samp>-bt <var>tolerance</var></samp>&rsquo;</dt>
-<dd><p>Set video bitrate tolerance (in bits, default 4000k).
-Has a minimum value of: (target_bitrate/target_framerate).
-In 1-pass mode, bitrate tolerance specifies how far ratecontrol is
-willing to deviate from the target average bitrate value. This is
-not related to min/max bitrate. Lowering tolerance too much has
-an adverse effect on quality.
-</p></dd>
-<dt> &lsquo;<samp>-maxrate <var>bitrate</var></samp>&rsquo;</dt>
-<dd><p>Set max video bitrate (in bit/s).
-Requires -bufsize to be set.
-</p></dd>
-<dt> &lsquo;<samp>-minrate <var>bitrate</var></samp>&rsquo;</dt>
-<dd><p>Set min video bitrate (in bit/s).
-Most useful in setting up a CBR encode:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
-</pre></td></tr></table>
-<p>It is of little use elsewise.
-</p></dd>
-<dt> &lsquo;<samp>-bufsize <var>size</var></samp>&rsquo;</dt>
-<dd><p>Set video buffer verifier buffer size (in bits).
-</p></dd>
-<dt> &lsquo;<samp>-vcodec <var>codec</var></samp>&rsquo;</dt>
-<dd><p>Force video codec to <var>codec</var>. Use the <code>copy</code> special value to
-tell that the raw codec data must be copied as is.
-</p></dd>
-<dt> &lsquo;<samp>-sameq</samp>&rsquo;</dt>
-<dd><p>Use same quantizer as source (implies VBR).
-</p>
-</dd>
-<dt> &lsquo;<samp>-pass <var>n</var></samp>&rsquo;</dt>
-<dd><p>Select the pass number (1 or 2). It is used to do two-pass
-video encoding. The statistics of the video are recorded in the first
-pass into a log file (see also the option -passlogfile),
-and in the second pass that log file is used to generate the video
-at the exact requested bitrate.
-On pass 1, you may just deactivate audio and set output to null,
-examples for Windows and Unix:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
-ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>-passlogfile <var>prefix</var></samp>&rsquo;</dt>
-<dd><p>Set two-pass log file name prefix to <var>prefix</var>, the default file name
-prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
-&lsquo;<tt>PREFIX-N.log</tt>&rsquo;, where N is a number specific to the output
-stream.
-</p>
-</dd>
-<dt> &lsquo;<samp>-newvideo</samp>&rsquo;</dt>
-<dd><p>Add a new video stream to the current output stream.
-</p>
-</dd>
-<dt> &lsquo;<samp>-vlang <var>code</var></samp>&rsquo;</dt>
-<dd><p>Set the ISO 639 language code (3 letters) of the current video stream.
-</p>
-</dd>
-<dt> &lsquo;<samp>-vf <var>filter_graph</var></samp>&rsquo;</dt>
-<dd><p><var>filter_graph</var> is a description of the filter graph to apply to
-the input video.
-Use the option &quot;-filters&quot; to show all the available filters (including
-also sources and sinks).
-</p>
-</dd>
-</dl>
-
-<a name="Advanced-Video-Options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Advanced-Video-Options">3.4 Advanced Video Options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-pix_fmt <var>format</var></samp>&rsquo;</dt>
-<dd><p>Set pixel format. Use &rsquo;list&rsquo; as parameter to show all the supported
-pixel formats.
-</p></dd>
-<dt> &lsquo;<samp>-sws_flags <var>flags</var></samp>&rsquo;</dt>
-<dd><p>Set SwScaler flags.
-</p></dd>
-<dt> &lsquo;<samp>-g <var>gop_size</var></samp>&rsquo;</dt>
-<dd><p>Set the group of pictures size.
-</p></dd>
-<dt> &lsquo;<samp>-intra</samp>&rsquo;</dt>
-<dd><p>Use only intra frames.
-</p></dd>
-<dt> &lsquo;<samp>-vdt <var>n</var></samp>&rsquo;</dt>
-<dd><p>Discard threshold.
-</p></dd>
-<dt> &lsquo;<samp>-qscale <var>q</var></samp>&rsquo;</dt>
-<dd><p>Use fixed video quantizer scale (VBR).
-</p></dd>
-<dt> &lsquo;<samp>-qmin <var>q</var></samp>&rsquo;</dt>
-<dd><p>minimum video quantizer scale (VBR)
-</p></dd>
-<dt> &lsquo;<samp>-qmax <var>q</var></samp>&rsquo;</dt>
-<dd><p>maximum video quantizer scale (VBR)
-</p></dd>
-<dt> &lsquo;<samp>-qdiff <var>q</var></samp>&rsquo;</dt>
-<dd><p>maximum difference between the quantizer scales (VBR)
-</p></dd>
-<dt> &lsquo;<samp>-qblur <var>blur</var></samp>&rsquo;</dt>
-<dd><p>video quantizer scale blur (VBR) (range 0.0 - 1.0)
-</p></dd>
-<dt> &lsquo;<samp>-qcomp <var>compression</var></samp>&rsquo;</dt>
-<dd><p>video quantizer scale compression (VBR) (default 0.5).
-Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
-</p>
-</dd>
-<dt> &lsquo;<samp>-lmin <var>lambda</var></samp>&rsquo;</dt>
-<dd><p>minimum video lagrange factor (VBR)
-</p></dd>
-<dt> &lsquo;<samp>-lmax <var>lambda</var></samp>&rsquo;</dt>
-<dd><p>max video lagrange factor (VBR)
-</p></dd>
-<dt> &lsquo;<samp>-mblmin <var>lambda</var></samp>&rsquo;</dt>
-<dd><p>minimum macroblock quantizer scale (VBR)
-</p></dd>
-<dt> &lsquo;<samp>-mblmax <var>lambda</var></samp>&rsquo;</dt>
-<dd><p>maximum macroblock quantizer scale (VBR)
-</p>
-<p>These four options (lmin, lmax, mblmin, mblmax) use &rsquo;lambda&rsquo; units,
-but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>-rc_init_cplx <var>complexity</var></samp>&rsquo;</dt>
-<dd><p>initial complexity for single pass encoding
-</p></dd>
-<dt> &lsquo;<samp>-b_qfactor <var>factor</var></samp>&rsquo;</dt>
-<dd><p>qp factor between P- and B-frames
-</p></dd>
-<dt> &lsquo;<samp>-i_qfactor <var>factor</var></samp>&rsquo;</dt>
-<dd><p>qp factor between P- and I-frames
-</p></dd>
-<dt> &lsquo;<samp>-b_qoffset <var>offset</var></samp>&rsquo;</dt>
-<dd><p>qp offset between P- and B-frames
-</p></dd>
-<dt> &lsquo;<samp>-i_qoffset <var>offset</var></samp>&rsquo;</dt>
-<dd><p>qp offset between P- and I-frames
-</p></dd>
-<dt> &lsquo;<samp>-rc_eq <var>equation</var></samp>&rsquo;</dt>
-<dd><p>Set rate control equation (see section &quot;Expression Evaluation&quot;)
-(default = <code>tex^qComp</code>).
-</p>
-<p>When computing the rate control equation expression, besides the
-standard functions defined in the section &quot;Expression Evaluation&quot;, the
-following functions are available:
-</p><dl compact="compact">
-<dt> <var>bits2qp(bits)</var></dt>
-<dt> <var>qp2bits(qp)</var></dt>
-</dl>
-
-<p>and the following constants are available:
-</p><dl compact="compact">
-<dt> <var>iTex</var></dt>
-<dt> <var>pTex</var></dt>
-<dt> <var>tex</var></dt>
-<dt> <var>mv</var></dt>
-<dt> <var>fCode</var></dt>
-<dt> <var>iCount</var></dt>
-<dt> <var>mcVar</var></dt>
-<dt> <var>var</var></dt>
-<dt> <var>isI</var></dt>
-<dt> <var>isP</var></dt>
-<dt> <var>isB</var></dt>
-<dt> <var>avgQP</var></dt>
-<dt> <var>qComp</var></dt>
-<dt> <var>avgIITex</var></dt>
-<dt> <var>avgPITex</var></dt>
-<dt> <var>avgPPTex</var></dt>
-<dt> <var>avgBPTex</var></dt>
-<dt> <var>avgTex</var></dt>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-rc_override <var>override</var></samp>&rsquo;</dt>
-<dd><p>Rate control override for specific intervals, formated as &quot;int,int,int&quot;
-list separated with slashes. Two first values are the beginning and
-end frame numbers, last one is quantizer to use if positive, or quality
-factor if negative.
-</p></dd>
-<dt> &lsquo;<samp>-me_method <var>method</var></samp>&rsquo;</dt>
-<dd><p>Set motion estimation method to <var>method</var>.
-Available methods are (from lowest to best quality):
-</p><dl compact="compact">
-<dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
-<dd><p>Try just the (0, 0) vector.
-</p></dd>
-<dt> &lsquo;<samp>phods</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>log</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>hex</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>umh</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>epzs</samp>&rsquo;</dt>
-<dd><p>(default method)
-</p></dd>
-<dt> &lsquo;<samp>full</samp>&rsquo;</dt>
-<dd><p>exhaustive search (slow and marginally better than epzs)
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-dct_algo <var>algo</var></samp>&rsquo;</dt>
-<dd><p>Set DCT algorithm to <var>algo</var>. Available values are:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>FF_DCT_AUTO (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>FF_DCT_FASTINT
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>FF_DCT_INT
-</p></dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>FF_DCT_MMX
-</p></dd>
-<dt> &lsquo;<samp>4</samp>&rsquo;</dt>
-<dd><p>FF_DCT_MLIB
-</p></dd>
-<dt> &lsquo;<samp>5</samp>&rsquo;</dt>
-<dd><p>FF_DCT_ALTIVEC
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-idct_algo <var>algo</var></samp>&rsquo;</dt>
-<dd><p>Set IDCT algorithm to <var>algo</var>. Available values are:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_AUTO (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_INT
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_SIMPLE
-</p></dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_SIMPLEMMX
-</p></dd>
-<dt> &lsquo;<samp>4</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_LIBMPEG2MMX
-</p></dd>
-<dt> &lsquo;<samp>5</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_PS2
-</p></dd>
-<dt> &lsquo;<samp>6</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_MLIB
-</p></dd>
-<dt> &lsquo;<samp>7</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_ARM
-</p></dd>
-<dt> &lsquo;<samp>8</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_ALTIVEC
-</p></dd>
-<dt> &lsquo;<samp>9</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_SH4
-</p></dd>
-<dt> &lsquo;<samp>10</samp>&rsquo;</dt>
-<dd><p>FF_IDCT_SIMPLEARM
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-er <var>n</var></samp>&rsquo;</dt>
-<dd><p>Set error resilience to <var>n</var>.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>FF_ER_CAREFUL (default)
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>FF_ER_COMPLIANT
-</p></dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>FF_ER_AGGRESSIVE
-</p></dd>
-<dt> &lsquo;<samp>4</samp>&rsquo;</dt>
-<dd><p>FF_ER_VERY_AGGRESSIVE
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-ec <var>bit_mask</var></samp>&rsquo;</dt>
-<dd><p>Set error concealment to <var>bit_mask</var>. <var>bit_mask</var> is a bit mask of
-the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>FF_EC_GUESS_MVS (default = enabled)
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>FF_EC_DEBLOCK (default = enabled)
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-bf <var>frames</var></samp>&rsquo;</dt>
-<dd><p>Use &rsquo;frames&rsquo; B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
-</p></dd>
-<dt> &lsquo;<samp>-mbd <var>mode</var></samp>&rsquo;</dt>
-<dd><p>macroblock decision
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in ffmpeg).
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>FF_MB_DECISION_RD: rate distortion
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-4mv</samp>&rsquo;</dt>
-<dd><p>Use four motion vector by macroblock (MPEG-4 only).
-</p></dd>
-<dt> &lsquo;<samp>-part</samp>&rsquo;</dt>
-<dd><p>Use data partitioning (MPEG-4 only).
-</p></dd>
-<dt> &lsquo;<samp>-bug <var>param</var></samp>&rsquo;</dt>
-<dd><p>Work around encoder bugs that are not auto-detected.
-</p></dd>
-<dt> &lsquo;<samp>-strict <var>strictness</var></samp>&rsquo;</dt>
-<dd><p>How strictly to follow the standards.
-</p></dd>
-<dt> &lsquo;<samp>-aic</samp>&rsquo;</dt>
-<dd><p>Enable Advanced intra coding (h263+).
-</p></dd>
-<dt> &lsquo;<samp>-umv</samp>&rsquo;</dt>
-<dd><p>Enable Unlimited Motion Vector (h263+)
-</p>
-</dd>
-<dt> &lsquo;<samp>-deinterlace</samp>&rsquo;</dt>
-<dd><p>Deinterlace pictures.
-</p></dd>
-<dt> &lsquo;<samp>-ilme</samp>&rsquo;</dt>
-<dd><p>Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
-Use this option if your input file is interlaced and you want
-to keep the interlaced format for minimum losses.
-The alternative is to deinterlace the input stream with
-&lsquo;<samp>-deinterlace</samp>&rsquo;, but deinterlacing introduces losses.
-</p></dd>
-<dt> &lsquo;<samp>-psnr</samp>&rsquo;</dt>
-<dd><p>Calculate PSNR of compressed frames.
-</p></dd>
-<dt> &lsquo;<samp>-vstats</samp>&rsquo;</dt>
-<dd><p>Dump video coding statistics to &lsquo;<tt>vstats_HHMMSS.log</tt>&rsquo;.
-</p></dd>
-<dt> &lsquo;<samp>-vstats_file <var>file</var></samp>&rsquo;</dt>
-<dd><p>Dump video coding statistics to <var>file</var>.
-</p></dd>
-<dt> &lsquo;<samp>-top <var>n</var></samp>&rsquo;</dt>
-<dd><p>top=1/bottom=0/auto=-1 field first
-</p></dd>
-<dt> &lsquo;<samp>-dc <var>precision</var></samp>&rsquo;</dt>
-<dd><p>Intra_dc_precision.
-</p></dd>
-<dt> &lsquo;<samp>-vtag <var>fourcc/tag</var></samp>&rsquo;</dt>
-<dd><p>Force video tag/fourcc.
-</p></dd>
-<dt> &lsquo;<samp>-qphist</samp>&rsquo;</dt>
-<dd><p>Show QP histogram.
-</p></dd>
-<dt> &lsquo;<samp>-vbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
-<dd><p>Bitstream filters available are &quot;dump_extra&quot;, &quot;remove_extra&quot;, &quot;noise&quot;, &quot;h264_mp4toannexb&quot;, &quot;imxdump&quot;, &quot;mjpegadump&quot;, &quot;mjpeg2jpeg&quot;.
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
-</pre></td></tr></table>
-</dd>
-<dt> &lsquo;<samp>-force_key_frames <var>time</var>[,<var>time</var>...]</samp>&rsquo;</dt>
-<dd><p>Force key frames at the specified timestamps, more precisely at the first
-frames after each specified time.
-This option can be useful to ensure that a seek point is present at a
-chapter mark or any other designated place in the output file.
-The timestamps must be specified in ascending order.
-</p></dd>
-</dl>
-
-<a name="Audio-Options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Audio-Options">3.5 Audio Options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-aframes <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the number of audio frames to record.
-</p></dd>
-<dt> &lsquo;<samp>-ar <var>freq</var></samp>&rsquo;</dt>
-<dd><p>Set the audio sampling frequency. For input streams it is set by
-default to 44100 Hz, for output streams it is set by default to the
-frequency of the input stream. If the input file has audio streams
-with different frequencies, the behaviour is undefined.
-</p></dd>
-<dt> &lsquo;<samp>-ab <var>bitrate</var></samp>&rsquo;</dt>
-<dd><p>Set the audio bitrate in bit/s (default = 64k).
-</p></dd>
-<dt> &lsquo;<samp>-aq <var>q</var></samp>&rsquo;</dt>
-<dd><p>Set the audio quality (codec-specific, VBR).
-</p></dd>
-<dt> &lsquo;<samp>-ac <var>channels</var></samp>&rsquo;</dt>
-<dd><p>Set the number of audio channels. For input streams it is set by
-default to 1, for output streams it is set by default to the same
-number of audio channels in input. If the input file has audio streams
-with different channel count, the behaviour is undefined.
-</p></dd>
-<dt> &lsquo;<samp>-an</samp>&rsquo;</dt>
-<dd><p>Disable audio recording.
-</p></dd>
-<dt> &lsquo;<samp>-acodec <var>codec</var></samp>&rsquo;</dt>
-<dd><p>Force audio codec to <var>codec</var>. Use the <code>copy</code> special value to
-specify that the raw codec data must be copied as is.
-</p></dd>
-<dt> &lsquo;<samp>-newaudio</samp>&rsquo;</dt>
-<dd><p>Add a new audio track to the output file. If you want to specify parameters,
-do so before <code>-newaudio</code> (<code>-acodec</code>, <code>-ab</code>, etc..).
-</p>
-<p>Mapping will be done automatically, if the number of output streams is equal to
-the number of input streams, else it will pick the first one that matches. You
-can override the mapping using <code>-map</code> as usual.
-</p>
-<p>Example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
-</pre></td></tr></table>
-</dd>
-<dt> &lsquo;<samp>-alang <var>code</var></samp>&rsquo;</dt>
-<dd><p>Set the ISO 639 language code (3 letters) of the current audio stream.
-</p></dd>
-</dl>
-
-<a name="Advanced-Audio-options_003a"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Advanced-Audio-options_003a">3.6 Advanced Audio options:</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-atag <var>fourcc/tag</var></samp>&rsquo;</dt>
-<dd><p>Force audio tag/fourcc.
-</p></dd>
-<dt> &lsquo;<samp>-audio_service_type <var>type</var></samp>&rsquo;</dt>
-<dd><p>Set the type of service that the audio stream contains.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>ma</samp>&rsquo;</dt>
-<dd><p>Main Audio Service (default)
-</p></dd>
-<dt> &lsquo;<samp>ef</samp>&rsquo;</dt>
-<dd><p>Effects
-</p></dd>
-<dt> &lsquo;<samp>vi</samp>&rsquo;</dt>
-<dd><p>Visually Impaired
-</p></dd>
-<dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
-<dd><p>Hearing Impaired
-</p></dd>
-<dt> &lsquo;<samp>di</samp>&rsquo;</dt>
-<dd><p>Dialogue
-</p></dd>
-<dt> &lsquo;<samp>co</samp>&rsquo;</dt>
-<dd><p>Commentary
-</p></dd>
-<dt> &lsquo;<samp>em</samp>&rsquo;</dt>
-<dd><p>Emergency
-</p></dd>
-<dt> &lsquo;<samp>vo</samp>&rsquo;</dt>
-<dd><p>Voice Over
-</p></dd>
-<dt> &lsquo;<samp>ka</samp>&rsquo;</dt>
-<dd><p>Karaoke
-</p></dd>
-</dl>
-</dd>
-<dt> &lsquo;<samp>-absf <var>bitstream_filter</var></samp>&rsquo;</dt>
-<dd><p>Bitstream filters available are &quot;dump_extra&quot;, &quot;remove_extra&quot;, &quot;noise&quot;, &quot;mp3comp&quot;, &quot;mp3decomp&quot;.
-</p></dd>
-</dl>
-
-<a name="Subtitle-options_003a"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Subtitle-options_003a">3.7 Subtitle options:</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-scodec <var>codec</var></samp>&rsquo;</dt>
-<dd><p>Force subtitle codec (&rsquo;copy&rsquo; to copy stream).
-</p></dd>
-<dt> &lsquo;<samp>-newsubtitle</samp>&rsquo;</dt>
-<dd><p>Add a new subtitle stream to the current output stream.
-</p></dd>
-<dt> &lsquo;<samp>-slang <var>code</var></samp>&rsquo;</dt>
-<dd><p>Set the ISO 639 language code (3 letters) of the current subtitle stream.
-</p></dd>
-<dt> &lsquo;<samp>-sn</samp>&rsquo;</dt>
-<dd><p>Disable subtitle recording.
-</p></dd>
-<dt> &lsquo;<samp>-sbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
-<dd><p>Bitstream filters available are &quot;mov2textsub&quot;, &quot;text2movsub&quot;.
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
-</pre></td></tr></table>
-</dd>
-</dl>
-
-<a name="Audio_002fVideo-grab-options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Audio_002fVideo-grab-options">3.8 Audio/Video grab options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-vc <var>channel</var></samp>&rsquo;</dt>
-<dd><p>Set video grab channel (DV1394 only).
-</p></dd>
-<dt> &lsquo;<samp>-tvstd <var>standard</var></samp>&rsquo;</dt>
-<dd><p>Set television standard (NTSC, PAL (SECAM)).
-</p></dd>
-<dt> &lsquo;<samp>-isync</samp>&rsquo;</dt>
-<dd><p>Synchronize read on input.
-</p></dd>
-</dl>
-
-<a name="Advanced-options"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Advanced-options">3.9 Advanced options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-map <var>input_file_id</var>.<var>input_stream_id</var>[:<var>sync_file_id</var>.<var>sync_stream_id</var>]</samp>&rsquo;</dt>
-<dd>
-<p>Designate an input stream as a source for the output file. Each input
-stream is identified by the input file index <var>input_file_id</var> and
-the input stream index <var>input_stream_id</var> within the input
-file. Both indexes start at 0. If specified,
-<var>sync_file_id</var>.<var>sync_stream_id</var> sets which input stream
-is used as a presentation sync reference.
-</p>
-<p>The <code>-map</code> options must be specified just after the output file.
-If any <code>-map</code> options are used, the number of <code>-map</code> options
-on the command line must match the number of streams in the output
-file. The first <code>-map</code> option on the command line specifies the
-source for output stream 0, the second <code>-map</code> option specifies
-the source for output stream 1, etc.
-</p>
-<p>For example, if you have two audio streams in the first input file,
-these streams are identified by &quot;0.0&quot; and &quot;0.1&quot;. You can use
-<code>-map</code> to select which stream to place in an output file. For
-example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT out.wav -map 0.1
-</pre></td></tr></table>
-<p>will map the input stream in &lsquo;<tt>INPUT</tt>&rsquo; identified by &quot;0.1&quot; to
-the (single) output stream in &lsquo;<tt>out.wav</tt>&rsquo;.
-</p>
-<p>For example, to select the stream with index 2 from input file
-&lsquo;<tt>a.mov</tt>&rsquo; (specified by the identifier &quot;0.2&quot;), and stream with
-index 6 from input &lsquo;<tt>b.mov</tt>&rsquo; (specified by the identifier &quot;1.6&quot;),
-and copy them to the output file &lsquo;<tt>out.mov</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
-</pre></td></tr></table>
-
-<p>To add more streams to the output file, you can use the
-<code>-newaudio</code>, <code>-newvideo</code>, <code>-newsubtitle</code> options.
-</p>
-</dd>
-<dt> &lsquo;<samp>-map_meta_data <var>outfile</var>[,<var>metadata</var>]:<var>infile</var>[,<var>metadata</var>]</samp>&rsquo;</dt>
-<dd><p>Deprecated, use <var>-map_metadata</var> instead.
-</p>
-</dd>
-<dt> &lsquo;<samp>-map_metadata <var>outfile</var>[,<var>metadata</var>]:<var>infile</var>[,<var>metadata</var>]</samp>&rsquo;</dt>
-<dd><p>Set metadata information of <var>outfile</var> from <var>infile</var>. Note that those
-are file indices (zero-based), not filenames.
-Optional <var>metadata</var> parameters specify, which metadata to copy - (g)lobal
-(i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or
-per-(p)rogram. All metadata specifiers other than global must be followed by the
-stream/chapter/program number. If metadata specifier is omitted, it defaults to
-global.
-</p>
-<p>By default, global metadata is copied from the first input file to all output files,
-per-stream and per-chapter metadata is copied along with streams/chapters. These
-default mappings are disabled by creating any mapping of the relevant type. A negative
-file index can be used to create a dummy mapping that just disables automatic copying.
-</p>
-<p>For example to copy metadata from the first stream of the input file to global metadata
-of the output file:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
-</pre></td></tr></table>
-</dd>
-<dt> &lsquo;<samp>-map_chapters <var>outfile</var>:<var>infile</var></samp>&rsquo;</dt>
-<dd><p>Copy chapters from <var>infile</var> to <var>outfile</var>. If no chapter mapping is specified,
-then chapters are copied from the first input file with at least one chapter to all
-output files. Use a negative file index to disable any chapter copying.
-</p></dd>
-<dt> &lsquo;<samp>-debug</samp>&rsquo;</dt>
-<dd><p>Print specific debug info.
-</p></dd>
-<dt> &lsquo;<samp>-benchmark</samp>&rsquo;</dt>
-<dd><p>Show benchmarking information at the end of an encode.
-Shows CPU time used and maximum memory consumption.
-Maximum memory consumption is not supported on all systems,
-it will usually display as 0 if not supported.
-</p></dd>
-<dt> &lsquo;<samp>-dump</samp>&rsquo;</dt>
-<dd><p>Dump each input packet.
-</p></dd>
-<dt> &lsquo;<samp>-hex</samp>&rsquo;</dt>
-<dd><p>When dumping packets, also dump the payload.
-</p></dd>
-<dt> &lsquo;<samp>-bitexact</samp>&rsquo;</dt>
-<dd><p>Only use bit exact algorithms (for codec testing).
-</p></dd>
-<dt> &lsquo;<samp>-ps <var>size</var></samp>&rsquo;</dt>
-<dd><p>Set RTP payload size in bytes.
-</p></dd>
-<dt> &lsquo;<samp>-re</samp>&rsquo;</dt>
-<dd><p>Read input at native frame rate. Mainly used to simulate a grab device.
-</p></dd>
-<dt> &lsquo;<samp>-loop_input</samp>&rsquo;</dt>
-<dd><p>Loop over the input stream. Currently it works only for image
-streams. This option is used for automatic FFserver testing.
-</p></dd>
-<dt> &lsquo;<samp>-loop_output <var>number_of_times</var></samp>&rsquo;</dt>
-<dd><p>Repeatedly loop output for formats that support looping such as animated GIF
-(0 will loop the output infinitely).
-</p></dd>
-<dt> &lsquo;<samp>-threads <var>count</var></samp>&rsquo;</dt>
-<dd><p>Thread count.
-</p></dd>
-<dt> &lsquo;<samp>-vsync <var>parameter</var></samp>&rsquo;</dt>
-<dd><p>Video sync method.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>Frames will be duplicated and dropped to achieve exactly the requested
-constant framerate.
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>Frames are passed through with their timestamp or dropped so as to
-prevent 2 frames from having the same timestamp.
-</p></dd>
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>Chooses between 1 and 2 depending on muxer capabilities. This is the
-default method.
-</p></dd>
-</dl>
-
-<p>With -map you can select from which stream the timestamps should be
-taken. You can leave either video or audio unchanged and sync the
-remaining stream(s) to the unchanged one.
-</p>
-</dd>
-<dt> &lsquo;<samp>-async <var>samples_per_second</var></samp>&rsquo;</dt>
-<dd><p>Audio sync method. &quot;Stretches/squeezes&quot; the audio stream to match the timestamps,
-the parameter is the maximum samples per second by which the audio is changed.
--async 1 is a special case where only the start of the audio stream is corrected
-without any later correction.
-</p></dd>
-<dt> &lsquo;<samp>-copyts</samp>&rsquo;</dt>
-<dd><p>Copy timestamps from input to output.
-</p></dd>
-<dt> &lsquo;<samp>-copytb</samp>&rsquo;</dt>
-<dd><p>Copy input stream time base from input to output when stream copying.
-</p></dd>
-<dt> &lsquo;<samp>-shortest</samp>&rsquo;</dt>
-<dd><p>Finish encoding when the shortest input stream ends.
-</p></dd>
-<dt> &lsquo;<samp>-dts_delta_threshold</samp>&rsquo;</dt>
-<dd><p>Timestamp discontinuity delta threshold.
-</p></dd>
-<dt> &lsquo;<samp>-muxdelay <var>seconds</var></samp>&rsquo;</dt>
-<dd><p>Set the maximum demux-decode delay.
-</p></dd>
-<dt> &lsquo;<samp>-muxpreload <var>seconds</var></samp>&rsquo;</dt>
-<dd><p>Set the initial demux-decode delay.
-</p></dd>
-<dt> &lsquo;<samp>-streamid <var>output-stream-index</var>:<var>new-value</var></samp>&rsquo;</dt>
-<dd><p>Assign a new stream-id value to an output stream. This option should be
-specified prior to the output filename to which it applies.
-For the situation where multiple output files exist, a streamid
-may be reassigned to a different value.
-</p>
-<p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
-an output mpegts file:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
-</pre></td></tr></table>
-</dd>
-</dl>
-
-<a name="Preset-files"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Preset-files">3.10 Preset files</a></h2>
-
-<p>A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
-one for each line, specifying a sequence of options which would be
-awkward to specify on the command line. Lines starting with the hash
-(&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
-the &lsquo;<tt>ffpresets</tt>&rsquo; directory in the FFmpeg source tree for examples.
-</p>
-<p>Preset files are specified with the <code>vpre</code>, <code>apre</code>,
-<code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
-filename of the preset instead of a preset name as input and can be
-used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
-<code>spre</code> options, the options specified in a preset file are
-applied to the currently selected codec of the same type as the preset
-option.
-</p>
-<p>The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
-preset options identifies the preset file to use according to the
-following rules:
-</p>
-<p>First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
-directories &lsquo;<tt>$FFMPEG_DATADIR</tt>&rsquo; (if set), and &lsquo;<tt>$HOME/.ffmpeg</tt>&rsquo;, and in
-the datadir defined at configuration time (usually &lsquo;<tt>PREFIX/share/ffmpeg</tt>&rsquo;)
-or in a &lsquo;<tt>ffpresets</tt>&rsquo; folder along the executable on win32,
-in that order. For example, if the argument is <code>libx264-max</code>, it will
-search for the file &lsquo;<tt>libx264-max.ffpreset</tt>&rsquo;.
-</p>
-<p>If no such file is found, then ffmpeg will search for a file named
-<var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
-directories, where <var>codec_name</var> is the name of the codec to which
-the preset file options will be applied. For example, if you select
-the video codec with <code>-vcodec libx264</code> and use <code>-vpre max</code>,
-then it will search for the file &lsquo;<tt>libx264-max.ffpreset</tt>&rsquo;.
-</p>
-<a name="Tips"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Tips">4. Tips</a></h1>
-
-<ul>
-<li>
-For streaming at very low bitrate application, use a low frame rate
-and a small GOP size. This is especially true for RealVideo where
-the Linux player does not seem to be very fast, so it can miss
-frames. An example is:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
-</pre></td></tr></table>
-
-</li><li>
-The parameter &rsquo;q&rsquo; which is displayed while encoding is the current
-quantizer. The value 1 indicates that a very good quality could
-be achieved. The value 31 indicates the worst quality. If q=31 appears
-too often, it means that the encoder cannot compress enough to meet
-your bitrate. You must either increase the bitrate, decrease the
-frame rate or decrease the frame size.
-
-</li><li>
-If your computer is not fast enough, you can speed up the
-compression at the expense of the compression ratio. You can use
-&rsquo;-me zero&rsquo; to speed up motion estimation, and &rsquo;-intra&rsquo; to disable
-motion estimation completely (you have only I-frames, which means it
-is about as good as JPEG compression).
-
-</li><li>
-To have very low audio bitrates, reduce the sampling frequency
-(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
-
-</li><li>
-To have a constant quality (but a variable bitrate), use the option
-&rsquo;-qscale n&rsquo; when &rsquo;n&rsquo; is between 1 (excellent quality) and 31 (worst
-quality).
-
-</li><li>
-When converting video files, you can use the &rsquo;-sameq&rsquo; option which
-uses the same quality factor in the encoder as in the decoder.
-It allows almost lossless encoding.
-
-</li></ul>
-
-<a name="Examples"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Examples">5. Examples</a></h1>
-
-<a name="Video-and-Audio-grabbing"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Video-and-Audio-grabbing">5.1 Video and Audio grabbing</a></h2>
-
-<p>If you specify the input format and device then ffmpeg can grab video
-and audio directly.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
-</pre></td></tr></table>
-
-<p>Note that you must activate the right video source and channel before
-launching ffmpeg with any TV viewer such as xawtv
-(<a href="http://linux.bytesex.org/xawtv/">http://linux.bytesex.org/xawtv/</a>) by Gerd Knorr. You also
-have to set the audio recording levels correctly with a
-standard mixer.
-</p>
-<a name="X11-grabbing"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-X11-grabbing">5.2 X11 grabbing</a></h2>
-
-<p>Grab the X11 display with ffmpeg via
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
-</pre></td></tr></table>
-
-<p>0.0 is display.screen number of your X11 server, same as
-the DISPLAY environment variable.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
-</pre></td></tr></table>
-
-<p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
-variable. 10 is the x-offset and 20 the y-offset for the grabbing.
-</p>
-<a name="Video-and-Audio-file-format-conversion"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Video-and-Audio-file-format-conversion">5.3 Video and Audio file format conversion</a></h2>
-
-<p>Any supported file format and protocol can serve as input to ffmpeg:
-</p>
-<p>Examples:
-</p><ul>
-<li>
-You can use YUV files as input:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
-</pre></td></tr></table>
-
-<p>It will use the files:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
-/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
-</pre></td></tr></table>
-
-<p>The Y files use twice the resolution of the U and V files. They are
-raw files, without header. They can be generated by all decent video
-decoders. You must specify the size of the image with the &lsquo;<samp>-s</samp>&rsquo; option
-if ffmpeg cannot guess it.
-</p>
-</li><li>
-You can input from a raw YUV420P file:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/test.yuv /tmp/out.avi
-</pre></td></tr></table>
-
-<p>test.yuv is a file containing raw YUV planar data. Each frame is composed
-of the Y plane followed by the U and V planes at half vertical and
-horizontal resolution.
-</p>
-</li><li>
-You can output to a raw YUV420P file:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i mydivx.avi hugefile.yuv
-</pre></td></tr></table>
-
-</li><li>
-You can set several input files and output files:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
-</pre></td></tr></table>
-
-<p>Converts the audio file a.wav and the raw YUV video file a.yuv
-to MPEG file a.mpg.
-</p>
-</li><li>
-You can also do audio and video conversions at the same time:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
-</pre></td></tr></table>
-
-<p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
-</p>
-</li><li>
-You can encode to several formats at the same time and define a
-mapping from input stream to output streams:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
-</pre></td></tr></table>
-
-<p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
-file:index&rsquo; specifies which input stream is used for each output
-stream, in the order of the definition of output streams.
-</p>
-</li><li>
-You can transcode decrypted VOBs:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
-</pre></td></tr></table>
-
-<p>This is a typical DVD ripping example; the input is a VOB file, the
-output an AVI file with MPEG-4 video and MP3 audio. Note that in this
-command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
-GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
-input video. Furthermore, the audio stream is MP3-encoded so you need
-to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
-The mapping is particularly useful for DVD transcoding
-to get the desired audio language.
-</p>
-<p>NOTE: To see the supported input formats, use <code>ffmpeg -formats</code>.
-</p>
-</li><li>
-You can extract images from a video, or create a video from many images:
-
-<p>For extracting images from a video:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
-</pre></td></tr></table>
-
-<p>This will extract one video frame per second from the video and will
-output them in files named &lsquo;<tt>foo-001.jpeg</tt>&rsquo;, &lsquo;<tt>foo-002.jpeg</tt>&rsquo;,
-etc. Images will be rescaled to fit the new WxH values.
-</p>
-<p>If you want to extract just a limited number of frames, you can use the
-above command in combination with the -vframes or -t option, or in
-combination with -ss to start extracting from a certain point in time.
-</p>
-<p>For creating a video from many images:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
-</pre></td></tr></table>
-
-<p>The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
-composed of three digits padded with zeroes to express the sequence
-number. It is the same syntax supported by the C printf function, but
-only formats accepting a normal integer are suitable.
-</p>
-</li><li>
-You can put many streams of the same type in the output:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
-</pre></td></tr></table>
-
-<p>In addition to the first video and audio streams, the resulting
-output file &lsquo;<tt>test12.avi</tt>&rsquo; will contain the second video
-and the second audio stream found in the input streams list.
-</p>
-<p>The <code>-newvideo</code>, <code>-newaudio</code> and <code>-newsubtitle</code>
-options have to be specified immediately after the name of the output
-file to which you want to add them.
-</p>
-</li></ul>
-
-<a name="Expression-Evaluation"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Expression-Evaluation">6. Expression Evaluation</a></h1>
-
-<p>When evaluating an arithemetic expression, FFmpeg uses an internal
-formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
-interface.
-</p>
-<p>An expression may contain unary, binary operators, constants, and
-functions.
-</p>
-<p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
-another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
-<var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
-expression evaluates to the value of <var>expr2</var>.
-</p>
-<p>The following binary operators are available: <code>+</code>, <code>-</code>,
-<code>*</code>, <code>/</code>, <code>^</code>.
-</p>
-<p>The following unary operators are available: <code>+</code>, <code>-</code>.
-</p>
-<p>The following functions are available:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>sin(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>cos(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>tan(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>atan(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>asin(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>acos(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>exp(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>log(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>abs(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>squish(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
-<dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
-</p>
-</dd>
-<dt> &lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
-<dd><p>Allow to store the value of the expression <var>expr</var> in an internal
-variable. <var>var</var> specifies the number of the variable where to
-store the value, and it is a value ranging from 0 to 9. The function
-returns the value stored in the internal variable.
-</p>
-</dd>
-<dt> &lsquo;<samp>ld(var)</samp>&rsquo;</dt>
-<dd><p>Allow to load the value of the internal variable with number
-<var>var</var>, which was previosly stored with st(<var>var</var>, <var>expr</var>).
-The function returns the loaded value.
-</p>
-</dd>
-<dt> &lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
-<dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
-non-zero, and returns the value of the last <var>expr</var> evaluation, or
-NAN if <var>cond</var> was always false.
-</p>
-</dd>
-<dt> &lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
-<dd><p>Round the value of expression <var>expr</var> upwards to the nearest
-integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
-<dd><p>Round the value of expression <var>expr</var> downwards to the nearest
-integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
-<dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
-integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
-<dd><p>Compute the square root of <var>expr</var>. This is equivalent to
-&quot;(<var>expr</var>)^.5&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>not(expr)</samp>&rsquo;</dt>
-<dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
-</p>
-</dd>
-<dt> &lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
-<dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
-&quot;(<var>x</var>)^(<var>y</var>)&quot;.
-</p></dd>
-</dl>
-
-<p>Note that:
-</p>
-<p><code>*</code> works like AND
-</p>
-<p><code>+</code> works like OR
-</p>
-<p>thus
-</p><table><tr><td>&nbsp;</td><td><pre class="example">if A then B else C
-</pre></td></tr></table>
-<p>is equivalent to
-</p><table><tr><td>&nbsp;</td><td><pre class="example">A*B + not(A)*C
-</pre></td></tr></table>
-
-<p>In your C code, you can extend the list of unary and binary functions,
-and define recognized constants, so that they are available for your
-expressions.
-</p>
-<p>The evaluator also recognizes the International System number
-postfixes. If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used
-instead of powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8,
-and can be appended after another postfix or used alone. This allows
-using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
-</p>
-<p>Follows the list of available International System postfixes, with
-indication of the corresponding powers of 10 and of 2.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>y</samp>&rsquo;</dt>
-<dd><p>-24 / -80
-</p></dd>
-<dt> &lsquo;<samp>z</samp>&rsquo;</dt>
-<dd><p>-21 / -70
-</p></dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>-18 / -60
-</p></dd>
-<dt> &lsquo;<samp>f</samp>&rsquo;</dt>
-<dd><p>-15 / -50
-</p></dd>
-<dt> &lsquo;<samp>p</samp>&rsquo;</dt>
-<dd><p>-12 / -40
-</p></dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>-9 / -30
-</p></dd>
-<dt> &lsquo;<samp>u</samp>&rsquo;</dt>
-<dd><p>-6 / -20
-</p></dd>
-<dt> &lsquo;<samp>m</samp>&rsquo;</dt>
-<dd><p>-3 / -10
-</p></dd>
-<dt> &lsquo;<samp>c</samp>&rsquo;</dt>
-<dd><p>-2
-</p></dd>
-<dt> &lsquo;<samp>d</samp>&rsquo;</dt>
-<dd><p>-1
-</p></dd>
-<dt> &lsquo;<samp>h</samp>&rsquo;</dt>
-<dd><p>2
-</p></dd>
-<dt> &lsquo;<samp>k</samp>&rsquo;</dt>
-<dd><p>3 / 10
-</p></dd>
-<dt> &lsquo;<samp>K</samp>&rsquo;</dt>
-<dd><p>3 / 10
-</p></dd>
-<dt> &lsquo;<samp>M</samp>&rsquo;</dt>
-<dd><p>6 / 20
-</p></dd>
-<dt> &lsquo;<samp>G</samp>&rsquo;</dt>
-<dd><p>9 / 30
-</p></dd>
-<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
-<dd><p>12 / 40
-</p></dd>
-<dt> &lsquo;<samp>P</samp>&rsquo;</dt>
-<dd><p>15 / 40
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>18 / 50
-</p></dd>
-<dt> &lsquo;<samp>Z</samp>&rsquo;</dt>
-<dd><p>21 / 60
-</p></dd>
-<dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
-<dd><p>24 / 70
-</p></dd>
-</dl>
-
-<a name="Decoders"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Decoders">7. Decoders</a></h1>
-
-<p>Decoders are configured elements in FFmpeg which allow the decoding of
-multimedia streams.
-</p>
-<p>When you configure your FFmpeg build, all the supported native decoders
-are enabled by default. Decoders requiring an external library must be enabled
-manually via the corresponding <code>--enable-lib</code> option. You can list all
-available decoders using the configure option <code>--list-decoders</code>.
-</p>
-<p>You can disable all the decoders with the configure option
-<code>--disable-decoders</code> and selectively enable / disable single decoders
-with the options <code>--enable-decoder=<var>DECODER</var></code> /
-<code>--disable-decoder=<var>DECODER</var></code>.
-</p>
-<p>The option <code>-codecs</code> of the ff* tools will display the list of
-enabled decoders.
-</p>
-
-<a name="Video-Decoders"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Video-Decoders">8. Video Decoders</a></h1>
-
-<p>A description of some of the currently available video decoders
-follows.
-</p>
-<a name="rawvideo"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-rawvideo">8.1 rawvideo</a></h2>
-
-<p>Rawvideo decoder.
-</p>
-<p>This decoder decodes rawvideo streams.
-</p>
-<a name="Options"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Options">8.1.1 Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
-<dd><p>Specify the assumed field type of the input video.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>the video is assumed to be progressive (default)
-</p></dd>
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>bottom-field-first is assumed
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>top-field-first is assumed
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Encoders"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Encoders">9. Encoders</a></h1>
-
-<p>Encoders are configured elements in FFmpeg which allow the encoding of
-multimedia streams.
-</p>
-<p>When you configure your FFmpeg build, all the supported native encoders
-are enabled by default. Encoders requiring an external library must be enabled
-manually via the corresponding <code>--enable-lib</code> option. You can list all
-available encoders using the configure option <code>--list-encoders</code>.
-</p>
-<p>You can disable all the encoders with the configure option
-<code>--disable-encoders</code> and selectively enable / disable single encoders
-with the options <code>--enable-encoder=<var>ENCODER</var></code> /
-<code>--disable-encoder=<var>ENCODER</var></code>.
-</p>
-<p>The option <code>-codecs</code> of the ff* tools will display the list of
-enabled encoders.
-</p>
-
-<a name="Audio-Encoders"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Encoders">10. Audio Encoders</a></h1>
-
-<p>A description of some of the currently available audio encoders
-follows.
-</p>
-<a name="ac3-and-ac3_005ffixed"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-ac3-and-ac3_005ffixed">10.1 ac3 and ac3_fixed</a></h2>
-
-<p>AC-3 audio encoders.
-</p>
-<p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
-the undocumented RealAudio 3 (a.k.a. dnet).
-</p>
-<p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
-encoder only uses fixed-point integer math. This does not mean that one is
-always faster, just that one or the other may be better suited to a
-particular system. The floating-point encoder will generally produce better
-quality audio for a given bitrate. The <var>ac3_fixed</var> encoder is not the
-default codec for any of the output formats, so it must be specified explicitly
-using the option <code>-acodec ac3_fixed</code> in order to use it.
-</p>
-<a name="AC_002d3-Metadata"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-AC_002d3-Metadata">10.1.1 AC-3 Metadata</a></h3>
-
-<p>The AC-3 metadata options are used to set parameters that describe the audio,
-but in most cases do not affect the audio encoding itself. Some of the options
-do directly affect or influence the decoding and playback of the resulting
-bitstream, while others are just for informational purposes. A few of the
-options will add bits to the output stream that could otherwise be used for
-audio data, and will thus affect the quality of the output. Those will be
-indicated accordingly with a note in the option list below.
-</p>
-<p>These parameters are described in detail in several publicly-available
-documents.
-</p><ul>
-<li> <a href="http://www.atsc.org/cms/standards/a_52-2010.pdf">A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard</a>
-</li><li> <a href="http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf">A/54 - Guide to the Use of the ATSC Digital Television Standard</a>
-</li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
-</li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
-</li></ul>
-
-<a name="Metadata-Control-Options"></a>
-<h4 class="subsubsection"><a href="ffmpeg.html#toc-Metadata-Control-Options">10.1.1.1 Metadata Control Options</a></h4>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-per_frame_metadata <var>boolean</var></samp>&rsquo;</dt>
-<dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
-metadata for each frame.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>The metadata values set at initialization will be used for every frame in the
-stream. (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>Metadata values can be changed before encoding each frame.
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Downmix-Levels"></a>
-<h4 class="subsubsection"><a href="ffmpeg.html#toc-Downmix-Levels">10.1.1.2 Downmix Levels</a></h4>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-center_mixlev <var>level</var></samp>&rsquo;</dt>
-<dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
-channel when downmixing to stereo. This field will only be written to the
-bitstream if a center channel is present. The value is specified as a scale
-factor. There are 3 valid values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
-<dd><p>Apply -3dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
-<dd><p>Apply -4.5dB gain (default)
-</p></dd>
-<dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
-<dd><p>Apply -6dB gain
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-surround_mixlev <var>level</var></samp>&rsquo;</dt>
-<dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
-channel(s) when downmixing to stereo. This field will only be written to the
-bitstream if one or more surround channels are present. The value is specified
-as a scale factor.  There are 3 valid values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
-<dd><p>Apply -3dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
-<dd><p>Apply -6dB gain (default)
-</p></dd>
-<dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
-<dd><p>Silence Surround Channel(s)
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Audio-Production-Information"></a>
-<h4 class="subsubsection"><a href="ffmpeg.html#toc-Audio-Production-Information">10.1.1.3 Audio Production Information</a></h4>
-<p>Audio Production Information is optional information describing the mixing
-environment.  Either none or both of the fields are written to the bitstream.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-mixing_level <var>number</var></samp>&rsquo;</dt>
-<dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
-environment when the mix was mastered. Valid values are 80 to 111, or -1 for
-unknown or not indicated. The default value is -1, but that value cannot be
-used if the Audio Production Information is written to the bitstream. Therefore,
-if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
-option must not be -1.
-</p>
-</dd>
-<dt> &lsquo;<samp>-room_type <var>type</var></samp>&rsquo;</dt>
-<dd><p>Room Type. Describes the equalization used during the final mixing session at
-the studio or on the dubbing stage. A large room is a dubbing stage with the
-industry standard X-curve equalization; a small room has flat equalization.
-This field will not be written to the bitstream if both the <code>mixing_level</code>
-option and the <code>room_type</code> option have the default values.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
-<dd><p>Not Indicated (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>large</samp>&rsquo;</dt>
-<dd><p>Large Room
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>small</samp>&rsquo;</dt>
-<dd><p>Small Room
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Other-Metadata-Options"></a>
-<h4 class="subsubsection"><a href="ffmpeg.html#toc-Other-Metadata-Options">10.1.1.4 Other Metadata Options</a></h4>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-copyright <var>boolean</var></samp>&rsquo;</dt>
-<dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>off</samp>&rsquo;</dt>
-<dd><p>No Copyright Exists (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>on</samp>&rsquo;</dt>
-<dd><p>Copyright Exists
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-dialnorm <var>value</var></samp>&rsquo;</dt>
-<dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
-program is below digital 100% full scale (0 dBFS). This parameter determines a
-level shift during audio reproduction that sets the average volume of the
-dialogue to a preset level. The goal is to match volume level between program
-sources. A value of -31dB will result in no volume level change, relative to
-the source volume, during audio reproduction. Valid values are whole numbers in
-the range -31 to -1, with -31 being the default.
-</p>
-</dd>
-<dt> &lsquo;<samp>-dsur_mode <var>mode</var></samp>&rsquo;</dt>
-<dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
-(Pro Logic). This field will only be written to the bitstream if the audio
-stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
-apply Dolby Surround processing.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
-<dd><p>Not Indicated (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>off</samp>&rsquo;</dt>
-<dd><p>Not Dolby Surround Encoded
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>on</samp>&rsquo;</dt>
-<dd><p>Dolby Surround Encoded
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-original <var>boolean</var></samp>&rsquo;</dt>
-<dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
-original source and not a copy.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>off</samp>&rsquo;</dt>
-<dd><p>Not Original Source
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>on</samp>&rsquo;</dt>
-<dd><p>Original Source (default)
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Extended-Bitstream-Information"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Extended-Bitstream-Information">10.1.2 Extended Bitstream Information</a></h3>
-<p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
-specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
-If any one parameter in a group is specified, all values in that group will be
-written to the bitstream.  Default values are used for those that are written
-but have not been specified.  If the mixing levels are written, the decoder
-will use these values instead of the ones specified in the <code>center_mixlev</code>
-and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
-Syntax.
-</p>
-<a name="Extended-Bitstream-Information-_002d-Part-1"></a>
-<h4 class="subsubsection"><a href="ffmpeg.html#toc-Extended-Bitstream-Information-_002d-Part-1">10.1.2.1 Extended Bitstream Information - Part 1</a></h4>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-dmix_mode <var>mode</var></samp>&rsquo;</dt>
-<dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
-(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
-<dd><p>Not Indicated (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>ltrt</samp>&rsquo;</dt>
-<dd><p>Lt/Rt Downmix Preferred
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>loro</samp>&rsquo;</dt>
-<dd><p>Lo/Ro Downmix Preferred
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-ltrt_cmixlev <var>level</var></samp>&rsquo;</dt>
-<dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
-center channel when downmixing to stereo in Lt/Rt mode.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>1.414</samp>&rsquo;</dt>
-<dd><p>Apply +3dB gain
-</p></dd>
-<dt> &lsquo;<samp>1.189</samp>&rsquo;</dt>
-<dd><p>Apply +1.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>1.000</samp>&rsquo;</dt>
-<dd><p>Apply 0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
-<dd><p>Apply -1.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
-<dd><p>Apply -3.0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
-<dd><p>Apply -4.5dB gain (default)
-</p></dd>
-<dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
-<dd><p>Apply -6.0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
-<dd><p>Silence Center Channel
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-ltrt_surmixlev <var>level</var></samp>&rsquo;</dt>
-<dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
-surround channel(s) when downmixing to stereo in Lt/Rt mode.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
-<dd><p>Apply -1.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
-<dd><p>Apply -3.0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
-<dd><p>Apply -4.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
-<dd><p>Apply -6.0dB gain (default)
-</p></dd>
-<dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
-<dd><p>Silence Surround Channel(s)
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-loro_cmixlev <var>level</var></samp>&rsquo;</dt>
-<dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
-center channel when downmixing to stereo in Lo/Ro mode.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>1.414</samp>&rsquo;</dt>
-<dd><p>Apply +3dB gain
-</p></dd>
-<dt> &lsquo;<samp>1.189</samp>&rsquo;</dt>
-<dd><p>Apply +1.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>1.000</samp>&rsquo;</dt>
-<dd><p>Apply 0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
-<dd><p>Apply -1.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
-<dd><p>Apply -3.0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
-<dd><p>Apply -4.5dB gain (default)
-</p></dd>
-<dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
-<dd><p>Apply -6.0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
-<dd><p>Silence Center Channel
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-loro_surmixlev <var>level</var></samp>&rsquo;</dt>
-<dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
-surround channel(s) when downmixing to stereo in Lo/Ro mode.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
-<dd><p>Apply -1.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
-<dd><p>Apply -3.0dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
-<dd><p>Apply -4.5dB gain
-</p></dd>
-<dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
-<dd><p>Apply -6.0dB gain (default)
-</p></dd>
-<dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
-<dd><p>Silence Surround Channel(s)
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Extended-Bitstream-Information-_002d-Part-2"></a>
-<h4 class="subsubsection"><a href="ffmpeg.html#toc-Extended-Bitstream-Information-_002d-Part-2">10.1.2.2 Extended Bitstream Information - Part 2</a></h4>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-dsurex_mode <var>mode</var></samp>&rsquo;</dt>
-<dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
-(7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
-apply Dolby Surround EX processing.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
-<dd><p>Not Indicated (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>on</samp>&rsquo;</dt>
-<dd><p>Dolby Surround EX On
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>off</samp>&rsquo;</dt>
-<dd><p>Dolby Surround EX Off
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-dheadphone_mode <var>mode</var></samp>&rsquo;</dt>
-<dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
-encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
-option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
-processing.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
-<dd><p>Not Indicated (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>on</samp>&rsquo;</dt>
-<dd><p>Dolby Headphone On
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>off</samp>&rsquo;</dt>
-<dd><p>Dolby Headphone Off
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-ad_conv_type <var>type</var></samp>&rsquo;</dt>
-<dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
-conversion.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
-<dd><p>Standard A/D Converter (default)
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>hdcd</samp>&rsquo;</dt>
-<dd><p>HDCD A/D Converter
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Other-AC_002d3-Encoding-Options"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Other-AC_002d3-Encoding-Options">10.1.3 Other AC-3 Encoding Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-stereo_rematrixing <var>boolean</var></samp>&rsquo;</dt>
-<dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
-is an optional AC-3 feature that increases quality by selectively encoding
-the left/right channels as mid/side. This option is enabled by default, and it
-is highly recommended that it be left as enabled except for testing purposes.
-</p>
-</dd>
-</dl>
-
-<a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">10.1.4 Floating-Point-Only AC-3 Encoding Options</a></h3>
-
-<p>These options are only valid for the floating-point encoder and do not exist
-for the fixed-point encoder due to the corresponding features not being
-implemented in fixed-point.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-channel_coupling <var>boolean</var></samp>&rsquo;</dt>
-<dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
-that increases quality by combining high frequency information from multiple
-channels into a single channel. The per-channel high frequency information is
-sent with less accuracy in both the frequency and time domains. This allows
-more bits to be used for lower frequencies while preserving enough information
-to reconstruct the high frequencies. This option is enabled by default for the
-floating-point encoder and should generally be left as enabled except for
-testing purposes or to increase encoding speed.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
-<dd><p>Selected by Encoder (default)
-</p></dd>
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>off</samp>&rsquo;</dt>
-<dd><p>Disable Channel Coupling
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>on</samp>&rsquo;</dt>
-<dd><p>Enable Channel Coupling
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-cpl_start_band <var>number</var></samp>&rsquo;</dt>
-<dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
-value higher than the bandwidth is used, it will be reduced to 1 less than the
-coupling end band. If <var>auto</var> is used, the start band will be determined by
-the encoder based on the bit rate, sample rate, and channel layout. This option
-has no effect if channel coupling is disabled.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
-<dd><p>Selected by Encoder (default)
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-
-<a name="Video-Encoders"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Video-Encoders">11. Video Encoders</a></h1>
-
-<p>A description of some of the currently available video encoders
-follows.
-</p>
-<a name="libvpx"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-libvpx">11.1 libvpx</a></h2>
-
-<p>VP8 format supported through libvpx.
-</p>
-<p>Requires the presence of the libvpx headers and library during configuration.
-You need to explicitly configure the build with <code>--enable-libvpx</code>.
-</p>
-<a name="Options-1"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Options-1">11.1.1 Options</a></h3>
-
-<p>Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>threads</samp>&rsquo;</dt>
-<dd><p>g_threads
-</p>
-</dd>
-<dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
-<dd><p>g_profile
-</p>
-</dd>
-<dt> &lsquo;<samp>vb</samp>&rsquo;</dt>
-<dd><p>rc_target_bitrate
-</p>
-</dd>
-<dt> &lsquo;<samp>g</samp>&rsquo;</dt>
-<dd><p>kf_max_dist
-</p>
-</dd>
-<dt> &lsquo;<samp>keyint_min</samp>&rsquo;</dt>
-<dd><p>kf_min_dist
-</p>
-</dd>
-<dt> &lsquo;<samp>qmin</samp>&rsquo;</dt>
-<dd><p>rc_min_quantizer
-</p>
-</dd>
-<dt> &lsquo;<samp>qmax</samp>&rsquo;</dt>
-<dd><p>rc_max_quantizer
-</p>
-</dd>
-<dt> &lsquo;<samp>bufsize, vb</samp>&rsquo;</dt>
-<dd><p>rc_buf_sz
-<code>(bufsize * 1000 / vb)</code>
-</p>
-<p>rc_buf_optimal_sz
-<code>(bufsize * 1000 / vb * 5 / 6)</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>rc_init_occupancy, vb</samp>&rsquo;</dt>
-<dd><p>rc_buf_initial_sz
-<code>(rc_init_occupancy * 1000 / vb)</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>rc_buffer_aggressivity</samp>&rsquo;</dt>
-<dd><p>rc_undershoot_pct
-</p>
-</dd>
-<dt> &lsquo;<samp>skip_threshold</samp>&rsquo;</dt>
-<dd><p>rc_dropframe_thresh
-</p>
-</dd>
-<dt> &lsquo;<samp>qcomp</samp>&rsquo;</dt>
-<dd><p>rc_2pass_vbr_bias_pct
-</p>
-</dd>
-<dt> &lsquo;<samp>maxrate, vb</samp>&rsquo;</dt>
-<dd><p>rc_2pass_vbr_maxsection_pct
-<code>(maxrate * 100 / vb)</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>minrate, vb</samp>&rsquo;</dt>
-<dd><p>rc_2pass_vbr_minsection_pct
-<code>(minrate * 100 / vb)</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>minrate, maxrate, vb</samp>&rsquo;</dt>
-<dd><p><code>VPX_CBR</code>
-<code>(minrate == maxrate == vb)</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>crf</samp>&rsquo;</dt>
-<dd><p><code>VPX_CQ</code>, <code>VP8E_SET_CQ_LEVEL</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>quality</samp>&rsquo;</dt>
-<dd><dl compact="compact">
-<dt> &lsquo;<samp><var>best</var></samp>&rsquo;</dt>
-<dd><p><code>VPX_DL_BEST_QUALITY</code>
-</p></dd>
-<dt> &lsquo;<samp><var>good</var></samp>&rsquo;</dt>
-<dd><p><code>VPX_DL_GOOD_QUALITY</code>
-</p></dd>
-<dt> &lsquo;<samp><var>realtime</var></samp>&rsquo;</dt>
-<dd><p><code>VPX_DL_REALTIME</code>
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>speed</samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_CPUUSED</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>nr</samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_NOISE_SENSITIVITY</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>mb_threshold</samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_STATIC_THRESHOLD</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>slices</samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_TOKEN_PARTITIONS</code>
-</p>
-</dd>
-<dt> &lsquo;<samp>Alternate reference frame related</samp>&rsquo;</dt>
-<dd><dl compact="compact">
-<dt> &lsquo;<samp>vp8flags altref</samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_ENABLEAUTOALTREF</code>
-</p></dd>
-<dt> &lsquo;<samp><var>arnr_max_frames</var></samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_ARNR_MAXFRAMES</code>
-</p></dd>
-<dt> &lsquo;<samp><var>arnr_type</var></samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_ARNR_TYPE</code>
-</p></dd>
-<dt> &lsquo;<samp><var>arnr_strength</var></samp>&rsquo;</dt>
-<dd><p><code>VP8E_SET_ARNR_STRENGTH</code>
-</p></dd>
-<dt> &lsquo;<samp><var>rc_lookahead</var></samp>&rsquo;</dt>
-<dd><p>g_lag_in_frames
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>vp8flags error_resilient</samp>&rsquo;</dt>
-<dd><p>g_error_resilient
-</p>
-</dd>
-</dl>
-
-<p>For more information about libvpx see:
-<a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
-</p>
-<a name="libx264"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-libx264">11.2 libx264</a></h2>
-
-<p>H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
-libx264.
-</p>
-<p>Requires the presence of the libx264 headers and library during
-configuration. You need to explicitly configure the build with
-<code>--enable-libx264</code>.
-</p>
-<a name="Options-2"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Options-2">11.2.1 Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>preset <var>preset_name</var></samp>&rsquo;</dt>
-<dd><p>Set the encoding preset.
-</p>
-</dd>
-<dt> &lsquo;<samp>tune <var>tune_name</var></samp>&rsquo;</dt>
-<dd><p>Tune the encoding params.
-Deprecated in favor of <var>x264_opts</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>fastfirstpass <var>bool</var></samp>&rsquo;</dt>
-<dd><p>Use fast settings when encoding first pass, default value is 1.
-Deprecated in favor of <var>x264_opts</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>profile <var>profile_name</var></samp>&rsquo;</dt>
-<dd><p>Set profile restrictions.
-Deprecated in favor of <var>x264_opts</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>level <var>level</var></samp>&rsquo;</dt>
-<dd><p>Specify level (as defined by Annex A).
-Deprecated in favor of <var>x264_opts</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>passlogfile <var>filename</var></samp>&rsquo;</dt>
-<dd><p>Specify filename for 2 pass stats.
-Deprecated in favor of <var>x264_opts</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>wpredp <var>wpred_type</var></samp>&rsquo;</dt>
-<dd><p>Specify Weighted prediction for P-frames.
-Deprecated in favor of <var>x264_opts</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>x264opts <var>options</var></samp>&rsquo;</dt>
-<dd><p>Allow to set any x264 option, see x264 manual for a list.
-</p>
-<p><var>options</var> is a list of <var>key</var>=<var>value</var> couples separated by
-&quot;:&quot;.
-</p></dd>
-</dl>
-
-<p>For example to specify libx264 encoding options with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
-</pre></td></tr></table>
-
-<p>For more information about libx264 and the supported options see:
-<a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>
-</p>
-<a name="Demuxers"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Demuxers">12. Demuxers</a></h1>
-
-<p>Demuxers are configured elements in FFmpeg which allow to read the
-multimedia streams from a particular type of file.
-</p>
-<p>When you configure your FFmpeg build, all the supported demuxers
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-demuxers&quot;.
-</p>
-<p>You can disable all the demuxers using the configure option
-&quot;&ndash;disable-demuxers&quot;, and selectively enable a single demuxer with
-the option &quot;&ndash;enable-demuxer=<var>DEMUXER</var>&quot;, or disable it
-with the option &quot;&ndash;disable-demuxer=<var>DEMUXER</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-enabled demuxers.
-</p>
-<p>The description of some of the currently available demuxers follows.
-</p>
-<a name="image2"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-image2">12.1 image2</a></h2>
-
-<p>Image file demuxer.
-</p>
-<p>This demuxer reads from a list of image files specified by a pattern.
-</p>
-<p>The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
-specifies the position of the characters representing a sequential
-number in each filename matched by the pattern. If the form
-&quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
-filename is 0-padded and <var>N</var> is the total number of 0-padded
-digits representing the number. The literal character &rsquo;%&rsquo; can be
-specified in the pattern with the string &quot;%%&quot;.
-</p>
-<p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
-the file list specified by the pattern must contain a number
-inclusively contained between 0 and 4, all the following numbers must
-be sequential. This limitation may be hopefully fixed.
-</p>
-<p>The pattern may contain a suffix which is used to automatically
-determine the format of the images contained in the files.
-</p>
-<p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
-filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
-&lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
-sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
-&lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
-</p>
-<p>The size, the pixel format, and the format of each image must be the
-same for all the files in the sequence.
-</p>
-<p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
-video from the images in the file sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;,
-&lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an input framerate of 10 frames per
-second:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
-</pre></td></tr></table>
-
-<p>Note that the pattern must not necessarily contain &quot;%d&quot; or
-&quot;%0<var>N</var>d&quot;, for example to convert a single image file
-&lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
-</pre></td></tr></table>
-
-<a name="applehttp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-applehttp">12.2 applehttp</a></h2>
-
-<p>Apple HTTP Live Streaming demuxer.
-</p>
-<p>This demuxer presents all AVStreams from all variant streams.
-The id field is set to the bitrate variant index number. By setting
-the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
-the caller can decide which variant streams to actually receive.
-The total bitrate of the variant that the stream belongs to is
-available in a metadata key named &quot;variant_bitrate&quot;.
-</p>
-<a name="Muxers"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Muxers">13. Muxers</a></h1>
-
-<p>Muxers are configured elements in FFmpeg which allow writing
-multimedia streams to a particular type of file.
-</p>
-<p>When you configure your FFmpeg build, all the supported muxers
-are enabled by default. You can list all available muxers using the
-configure option <code>--list-muxers</code>.
-</p>
-<p>You can disable all the muxers with the configure option
-<code>--disable-muxers</code> and selectively enable / disable single muxers
-with the options <code>--enable-muxer=<var>MUXER</var></code> /
-<code>--disable-muxer=<var>MUXER</var></code>.
-</p>
-<p>The option <code>-formats</code> of the ff* tools will display the list of
-enabled muxers.
-</p>
-<p>A description of some of the currently available muxers follows.
-</p>
-<p><a name="crc"></a>
-</p><a name="crc-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-crc-1">13.1 crc</a></h2>
-
-<p>CRC (Cyclic Redundancy Check) testing format.
-</p>
-<p>This muxer computes and prints the Adler-32 CRC of all the input audio
-and video frames. By default audio frames are converted to signed
-16-bit raw audio and video frames to raw video before computing the
-CRC.
-</p>
-<p>The output of the muxer consists of a single line of the form:
-CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
-8 digits containing the CRC for all the decoded input frames.
-</p>
-<p>For example to compute the CRC of the input, and store it in the file
-&lsquo;<tt>out.crc</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
-</pre></td></tr></table>
-
-<p>You can print the CRC to stdout with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc -
-</pre></td></tr></table>
-
-<p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
-specifying the audio and video codec and format. For example to
-compute the CRC of the input audio converted to PCM unsigned 8-bit
-and the input video converted to MPEG-2 video, use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
-</pre></td></tr></table>
-
-<p>See also the <code>framecrc</code> muxer (see <a href="#framecrc">framecrc</a>).
-</p>
-<p><a name="framecrc"></a>
-</p><a name="framecrc-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-framecrc-1">13.2 framecrc</a></h2>
-
-<p>Per-frame CRC (Cyclic Redundancy Check) testing format.
-</p>
-<p>This muxer computes and prints the Adler-32 CRC for each decoded audio
-and video frame. By default audio frames are converted to signed
-16-bit raw audio and video frames to raw video before computing the
-CRC.
-</p>
-<p>The output of the muxer consists of a line for each audio and video
-frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
-<var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
-number 0-padded to 8 digits containing the CRC of the decoded frame.
-</p>
-<p>For example to compute the CRC of each decoded frame in the input, and
-store it in the file &lsquo;<tt>out.crc</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
-</pre></td></tr></table>
-
-<p>You can print the CRC of each decoded frame to stdout with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
-</pre></td></tr></table>
-
-<p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
-specifying the audio and video codec and format. For example, to
-compute the CRC of each decoded input audio frame converted to PCM
-unsigned 8-bit and of each decoded input video frame converted to
-MPEG-2 video, use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
-</pre></td></tr></table>
-
-<p>See also the <code>crc</code> muxer (see <a href="#crc">crc</a>).
-</p>
-<a name="image2-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-image2-1">13.3 image2</a></h2>
-
-<p>Image file muxer.
-</p>
-<p>The image file muxer writes video frames to image files.
-</p>
-<p>The output filenames are specified by a pattern, which can be used to
-produce sequentially numbered series of files.
-The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
-specifies the position of the characters representing a numbering in
-the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
-representing the number in each filename is 0-padded to <var>N</var>
-digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
-the string &quot;%%&quot;.
-</p>
-<p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
-the file list specified will contain the number 1, all the following
-numbers will be sequential.
-</p>
-<p>The pattern may contain a suffix which is used to automatically
-determine the format of the image files to write.
-</p>
-<p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
-filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
-&lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
-The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
-form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
-etc.
-</p>
-<p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
-sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
-taking one image every second from the input video:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
-</pre></td></tr></table>
-
-<p>Note that with &lsquo;<tt>ffmpeg</tt>&rsquo;, if the format is not specified with the
-<code>-f</code> option and the output filename specifies an image file
-format, the image2 muxer is automatically selected, so the previous
-command can be written as:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
-</pre></td></tr></table>
-
-<p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
-&quot;%0<var>N</var>d&quot;, for example to create a single image file
-&lsquo;<tt>img.jpeg</tt>&rsquo; from the input video you can employ the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
-</pre></td></tr></table>
-
-<p>The image muxer supports the .Y.U.V image file format. This format is
-special in that that each image frame consists of three files, for
-each of the YUV420P components. To read or write this image file format,
-specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
-&rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
-</p>
-<a name="mpegts"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mpegts">13.4 mpegts</a></h2>
-
-<p>MPEG transport stream muxer.
-</p>
-<p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
-</p>
-<p>The muxer options are:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-mpegts_original_network_id <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the original_network_id (default 0x0001). This is unique identifier
-of a network in DVB. Its main use is in the unique identification of a
-service through the path Original_Network_ID, Transport_Stream_ID.
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_transport_stream_id <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the transport_stream_id (default 0x0001). This identifies a
-transponder in DVB.
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_service_id <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the service_id (default 0x0001) also known as program in DVB.
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_pmt_start_pid <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_start_pid <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
-</p></dd>
-</dl>
-
-<p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
-and <code>service_name</code>. If they are not set the default for
-<code>service_provider</code> is &quot;FFmpeg&quot; and the default for
-<code>service_name</code> is &quot;Service01&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
-     -mpegts_original_network_id 0x1122 \
-     -mpegts_transport_stream_id 0x3344 \
-     -mpegts_service_id 0x5566 \
-     -mpegts_pmt_start_pid 0x1500 \
-     -mpegts_start_pid 0x150 \
-     -metadata service_provider=&quot;Some provider&quot; \
-     -metadata service_name=&quot;Some Channel&quot; \
-     -y out.ts
-</pre></td></tr></table>
-
-<a name="null"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-null">13.5 null</a></h2>
-
-<p>Null muxer.
-</p>
-<p>This muxer does not generate any output file, it is mainly useful for
-testing or benchmarking purposes.
-</p>
-<p>For example to benchmark decoding with &lsquo;<tt>ffmpeg</tt>&rsquo; you can use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
-</pre></td></tr></table>
-
-<p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
-file, but specifying the output file is required by the &lsquo;<tt>ffmpeg</tt>&rsquo;
-syntax.
-</p>
-<p>Alternatively you can write the command as:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
-</pre></td></tr></table>
-
-<a name="matroska"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-matroska">13.6 matroska</a></h2>
-
-<p>Matroska container muxer.
-</p>
-<p>This muxer implements the matroska and webm container specs.
-</p>
-<p>The recognized metadata settings in this muxer are:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>title=<var>title name</var></samp>&rsquo;</dt>
-<dd><p>Name provided to a single track
-</p></dd>
-</dl>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>language=<var>language name</var></samp>&rsquo;</dt>
-<dd><p>Specifies the language of the track in the Matroska languages form
-</p></dd>
-</dl>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>stereo_mode=<var>mode</var></samp>&rsquo;</dt>
-<dd><p>Stereo 3D video layout of two views in a single video track
-</p><dl compact="compact">
-<dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
-<dd><p>video is not stereo
-</p></dd>
-<dt> &lsquo;<samp>left_right</samp>&rsquo;</dt>
-<dd><p>Both views are arranged side by side, Left-eye view is on the left
-</p></dd>
-<dt> &lsquo;<samp>bottom_top</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
-</p></dd>
-<dt> &lsquo;<samp>top_bottom</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
-</p></dd>
-<dt> &lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
-<dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
-</p></dd>
-<dt> &lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
-<dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
-</p></dd>
-<dt> &lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
-<dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
-</p></dd>
-<dt> &lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
-<dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
-</p></dd>
-<dt> &lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
-</p></dd>
-<dt> &lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
-</p></dd>
-<dt> &lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
-<dd><p>All frames are in anaglyph format viewable through red-cyan filters
-</p></dd>
-<dt> &lsquo;<samp>right_left</samp>&rsquo;</dt>
-<dd><p>Both views are arranged side by side, Right-eye view is on the left
-</p></dd>
-<dt> &lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
-<dd><p>All frames are in anaglyph format viewable through green-magenta filters
-</p></dd>
-<dt> &lsquo;<samp>block_lr</samp>&rsquo;</dt>
-<dd><p>Both eyes laced in one Block, Left-eye view is first
-</p></dd>
-<dt> &lsquo;<samp>block_rl</samp>&rsquo;</dt>
-<dd><p>Both eyes laced in one Block, Right-eye view is first
-</p></dd>
-</dl>
-</dd>
-</dl>
-
-<p>For example a 3D WebM clip can be created using the following command line:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
-</pre></td></tr></table>
-
-<a name="Input-Devices"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Input-Devices">14. Input Devices</a></h1>
-
-<p>Input devices are configured elements in FFmpeg which allow to access
-the data coming from a multimedia device attached to your system.
-</p>
-<p>When you configure your FFmpeg build, all the supported input devices
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-indevs&quot;.
-</p>
-<p>You can disable all the input devices using the configure option
-&quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
-option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
-input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-supported input devices (amongst the demuxers).
-</p>
-<p>A description of the currently available input devices follows.
-</p>
-<a name="alsa-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-alsa-1">14.1 alsa</a></h2>
-
-<p>ALSA (Advanced Linux Sound Architecture) input device.
-</p>
-<p>To enable this input device during configuration you need libasound
-installed on your system.
-</p>
-<p>This device allows capturing from an ALSA device. The name of the
-device to capture has to be an ALSA card identifier.
-</p>
-<p>An ALSA identifier has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
-</pre></td></tr></table>
-
-<p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
-</p>
-<p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
-specify card number or identifier, device number and subdevice number
-(-1 means any).
-</p>
-<p>To see the list of cards currently recognized by your system check the
-files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
-</p>
-<p>For example to capture with &lsquo;<tt>ffmpeg</tt>&rsquo; from an ALSA device with
-card id 0, you may run the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
-</pre></td></tr></table>
-
-<p>For more information see:
-<a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
-</p>
-<a name="bktr"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-bktr">14.2 bktr</a></h2>
-
-<p>BSD video input device.
-</p>
-<a name="dv1394"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-dv1394">14.3 dv1394</a></h2>
-
-<p>Linux DV 1394 input device.
-</p>
-<a name="fbdev"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-fbdev">14.4 fbdev</a></h2>
-
-<p>Linux framebuffer input device.
-</p>
-<p>The Linux framebuffer is a graphic hardware-independent abstraction
-layer to show graphics on a computer monitor, typically on the
-console. It is accessed through a file device node, usually
-&lsquo;<tt>/dev/fb0</tt>&rsquo;.
-</p>
-<p>For more detailed information read the file
-Documentation/fb/framebuffer.txt included in the Linux source tree.
-</p>
-<p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
-</pre></td></tr></table>
-
-<p>You can take a single screenshot image with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
-</pre></td></tr></table>
-
-<p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
-</p>
-<a name="jack"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-jack">14.5 jack</a></h2>
-
-<p>JACK input device.
-</p>
-<p>To enable this input device during configuration you need libjack
-installed on your system.
-</p>
-<p>A JACK input device creates one or more JACK writable clients, one for
-each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
-<var>client_name</var> is the name provided by the application, and <var>N</var>
-is a number which identifies the channel.
-Each writable client will send the acquired data to the FFmpeg input
-device.
-</p>
-<p>Once you have created one or more JACK readable clients, you need to
-connect them to one or more JACK writable clients.
-</p>
-<p>To connect or disconnect JACK clients you can use the
-&lsquo;<tt>jack_connect</tt>&rsquo; and &lsquo;<tt>jack_disconnect</tt>&rsquo; programs, or do it
-through a graphical interface, for example with &lsquo;<tt>qjackctl</tt>&rsquo;.
-</p>
-<p>To list the JACK clients and their properties you can invoke the command
-&lsquo;<tt>jack_lsp</tt>&rsquo;.
-</p>
-<p>Follows an example which shows how to capture a JACK readable client
-with &lsquo;<tt>ffmpeg</tt>&rsquo;.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
-$ ffmpeg -f jack -i ffmpeg -y out.wav
-
-# Start the sample jack_metro readable client.
-$ jack_metro -b 120 -d 0.2 -f 4000
-
-# List the current JACK clients.
-$ jack_lsp -c
-system:capture_1
-system:capture_2
-system:playback_1
-system:playback_2
-ffmpeg:input_1
-metro:120_bpm
-
-# Connect metro to the ffmpeg writable client.
-$ jack_connect metro:120_bpm ffmpeg:input_1
-</pre></td></tr></table>
-
-<p>For more information read:
-<a href="http://jackaudio.org/">http://jackaudio.org/</a>
-</p>
-<a name="libdc1394"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-libdc1394">14.6 libdc1394</a></h2>
-
-<p>IIDC1394 input device, based on libdc1394 and libraw1394.
-</p>
-<a name="oss-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-oss-1">14.7 oss</a></h2>
-
-<p>Open Sound System input device.
-</p>
-<p>The filename to provide to the input device is the device node
-representing the OSS input device, and is usually set to
-&lsquo;<tt>/dev/dsp</tt>&rsquo;.
-</p>
-<p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
-</pre></td></tr></table>
-
-<p>For more information about OSS see:
-<a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
-</p>
-<a name="sndio"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-sndio">14.8 sndio</a></h2>
-
-<p>sndio input device.
-</p>
-<p>To enable this input device during configuration you need libsndio
-installed on your system.
-</p>
-<p>The filename to provide to the input device is the device node
-representing the sndio input device, and is usually set to
-&lsquo;<tt>/dev/audio0</tt>&rsquo;.
-</p>
-<p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
-</pre></td></tr></table>
-
-<a name="video4linux-and-video4linux2"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-video4linux-and-video4linux2">14.9 video4linux and video4linux2</a></h2>
-
-<p>Video4Linux and Video4Linux2 input video devices.
-</p>
-<p>The name of the device to grab is a file device node, usually Linux
-systems tend to automatically create such nodes when the device
-(e.g. an USB webcam) is plugged into the system, and has a name of the
-kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
-the device.
-</p>
-<p>Video4Linux and Video4Linux2 devices only support a limited set of
-<var>width</var>x<var>height</var> sizes and framerates. You can check which are
-supported for example with the command &lsquo;<tt>dov4l</tt>&rsquo; for Video4Linux
-devices and the command &lsquo;<tt>v4l-info</tt>&rsquo; for Video4Linux2 devices.
-</p>
-<p>If the size for the device is set to 0x0, the input device will
-try to autodetect the size to use.
-Only for the video4linux2 device, if the frame rate is set to 0/0 the
-input device will use the frame rate value already set in the driver.
-</p>
-<p>Video4Linux support is deprecated since Linux 2.6.30, and will be
-dropped in later versions.
-</p>
-<p>Follow some usage examples of the video4linux devices with the ff*
-tools.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
-# to the default of 25/1.
-ffplay -s 320x240 -f video4linux /dev/video0
-
-# Grab and show the input of a video4linux2 device, autoadjust size.
-ffplay -f video4linux2 /dev/video0
-
-# Grab and record the input of a video4linux2 device, autoadjust size,
-# frame rate value defaults to 0/0 so it is read from the video4linux2
-# driver.
-ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
-</pre></td></tr></table>
-
-<a name="vfwcap"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-vfwcap">14.10 vfwcap</a></h2>
-
-<p>VfW (Video for Windows) capture input device.
-</p>
-<p>The filename passed as input is the capture driver number, ranging from
-0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
-other filename will be interpreted as device number 0.
-</p>
-<a name="x11grab"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-x11grab">14.11 x11grab</a></h2>
-
-<p>X11 video input device.
-</p>
-<p>This device allows to capture a region of an X11 display.
-</p>
-<p>The filename passed as input has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
-</pre></td></tr></table>
-
-<p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
-X11 display name of the screen to grab from. <var>hostname</var> can be
-ommitted, and defaults to &quot;localhost&quot;. The environment variable
-<code>DISPLAY</code> contains the default display name.
-</p>
-<p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
-area with respect to the top-left border of the X11 screen. They
-default to 0.
-</p>
-<p>Check the X11 documentation (e.g. man X) for more detailed information.
-</p>
-<p>Use the &lsquo;<tt>dpyinfo</tt>&rsquo; program for getting basic information about the
-properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
-</p>
-<p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
-
-# Grab at position 10,20.
-ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
-</pre></td></tr></table>
-
-<a name="Output-Devices"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Output-Devices">15. Output Devices</a></h1>
-
-<p>Output devices are configured elements in FFmpeg which allow to write
-multimedia data to an output device attached to your system.
-</p>
-<p>When you configure your FFmpeg build, all the supported output devices
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-outdevs&quot;.
-</p>
-<p>You can disable all the output devices using the configure option
-&quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
-option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
-input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-enabled output devices (amongst the muxers).
-</p>
-<p>A description of the currently available output devices follows.
-</p>
-<a name="alsa"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-alsa">15.1 alsa</a></h2>
-
-<p>ALSA (Advanced Linux Sound Architecture) output device.
-</p>
-<a name="oss"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-oss">15.2 oss</a></h2>
-
-<p>OSS (Open Sound System) output device.
-</p>
-<a name="sdl"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-sdl">15.3 sdl</a></h2>
-
-<p>SDL (Simple Directmedia Layer) output device.
-</p>
-<p>This output devices allows to show a video stream in an SDL
-window. Only one SDL window is allowed per application, so you can
-have only one instance of this output device in an application.
-</p>
-<p>To enable this output device you need libsdl installed on your system
-when configuring your build.
-</p>
-<p>For more information about SDL, check:
-<a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
-</p>
-<a name="Options-3"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Options-3">15.3.1 Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
-<dd><p>Set the SDL window title, if not specified default to the filename
-specified for the output device.
-</p>
-</dd>
-<dt> &lsquo;<samp>icon_title</samp>&rsquo;</dt>
-<dd><p>Set the name of the iconified SDL window, if not specified it is set
-to the same value of <var>window_title</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>window_size</samp>&rsquo;</dt>
-<dd><p>Set the SDL window size, can be a string of the form
-<var>width</var>x<var>height</var> or a video size abbreviation.
-If not specified it defaults to the size of the input video.
-</p></dd>
-</dl>
-
-<a name="Examples-1"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Examples-1">15.3.2 Examples</a></h3>
-
-<p>The following command shows the &lsquo;<tt>ffmpeg</tt>&rsquo; output is an
-SDL window, forcing its size to the qcif format:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
-</pre></td></tr></table>
-
-<a name="sndio-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-sndio-1">15.4 sndio</a></h2>
-
-<p>sndio audio output device.
-</p>
-<a name="Protocols"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Protocols">16. Protocols</a></h1>
-
-<p>Protocols are configured elements in FFmpeg which allow to access
-resources which require the use of a particular protocol.
-</p>
-<p>When you configure your FFmpeg build, all the supported protocols are
-enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-protocols&quot;.
-</p>
-<p>You can disable all the protocols using the configure option
-&quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
-option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
-particular protocol using the option
-&quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
-</p>
-<p>The option &quot;-protocols&quot; of the ff* tools will display the list of
-supported protocols.
-</p>
-<p>A description of the currently available protocols follows.
-</p>
-<a name="applehttp-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-applehttp-1">16.1 applehttp</a></h2>
-
-<p>Read Apple HTTP Live Streaming compliant segmented stream as
-a uniform one. The M3U8 playlists describing the segments can be
-remote HTTP resources or local files, accessed using the standard
-file protocol.
-HTTP is default, specific protocol can be declared by specifying
-&quot;+<var>proto</var>&quot; after the applehttp URI scheme name, where <var>proto</var>
-is either &quot;file&quot; or &quot;http&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
-applehttp+http://host/path/to/remote/resource.m3u8
-applehttp+file://path/to/local/resource.m3u8
-</pre></td></tr></table>
-
-<a name="concat"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-concat">16.2 concat</a></h2>
-
-<p>Physical concatenation protocol.
-</p>
-<p>Allow to read and seek from many resource in sequence as if they were
-a unique resource.
-</p>
-<p>A URL accepted by this protocol has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
-</pre></td></tr></table>
-
-<p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
-resource to be concatenated, each one possibly specifying a distinct
-protocol.
-</p>
-<p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
-&lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with &lsquo;<tt>ffplay</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
-</pre></td></tr></table>
-
-<p>Note that you may need to escape the character &quot;|&quot; which is special for
-many shells.
-</p>
-<a name="file"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-file">16.3 file</a></h2>
-
-<p>File access protocol.
-</p>
-<p>Allow to read from or read to a file.
-</p>
-<p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with &lsquo;<tt>ffmpeg</tt>&rsquo;
-use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
-</pre></td></tr></table>
-
-<p>The ff* tools default to the file protocol, that is a resource
-specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
-&quot;file:FILE.mpeg&quot;.
-</p>
-<a name="gopher"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-gopher">16.4 gopher</a></h2>
-
-<p>Gopher protocol.
-</p>
-<a name="http"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-http">16.5 http</a></h2>
-
-<p>HTTP (Hyper Text Transfer Protocol).
-</p>
-<a name="mmst"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mmst">16.6 mmst</a></h2>
-
-<p>MMS (Microsoft Media Server) protocol over TCP.
-</p>
-<a name="mmsh"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mmsh">16.7 mmsh</a></h2>
-
-<p>MMS (Microsoft Media Server) protocol over HTTP.
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
-</pre></td></tr></table>
-
-<a name="md5"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-md5">16.8 md5</a></h2>
-
-<p>MD5 output protocol.
-</p>
-<p>Computes the MD5 hash of the data to be written, and on close writes
-this to the designated output or stdout if none is specified. It can
-be used to test muxers without writing an actual file.
-</p>
-<p>Some examples follow.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
-ffmpeg -i input.flv -f avi -y md5:output.avi.md5
-
-# Write the MD5 hash of the encoded AVI file to stdout.
-ffmpeg -i input.flv -f avi -y md5:
-</pre></td></tr></table>
-
-<p>Note that some formats (typically MOV) require the output protocol to
-be seekable, so they will fail with the MD5 output protocol.
-</p>
-<a name="pipe"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-pipe">16.9 pipe</a></h2>
-
-<p>UNIX pipe access protocol.
-</p>
-<p>Allow to read and write from UNIX pipes.
-</p>
-<p>The accepted syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
-</pre></td></tr></table>
-
-<p><var>number</var> is the number corresponding to the file descriptor of the
-pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
-is not specified, by default the stdout file descriptor will be used
-for writing, stdin for reading.
-</p>
-<p>For example to read from stdin with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
-# ...this is the same as...
-cat test.wav | ffmpeg -i pipe:
-</pre></td></tr></table>
-
-<p>For writing to stdout with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
-# ...this is the same as...
-ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
-</pre></td></tr></table>
-
-<p>Note that some formats (typically MOV), require the output protocol to
-be seekable, so they will fail with the pipe output protocol.
-</p>
-<a name="rtmp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-rtmp">16.10 rtmp</a></h2>
-
-<p>Real-Time Messaging Protocol.
-</p>
-<p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
-dia content across a TCP/IP network.
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
-</pre></td></tr></table>
-
-<p>The accepted parameters are:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>server</samp>&rsquo;</dt>
-<dd><p>The address of the RTMP server.
-</p>
-</dd>
-<dt> &lsquo;<samp>port</samp>&rsquo;</dt>
-<dd><p>The number of the TCP port to use (by default is 1935).
-</p>
-</dd>
-<dt> &lsquo;<samp>app</samp>&rsquo;</dt>
-<dd><p>It is the name of the application to access. It usually corresponds to
-the path where the application is installed on the RTMP server
-(e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.).
-</p>
-</dd>
-<dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
-<dd><p>It is the path or name of the resource to play with reference to the
-application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;.
-</p>
-</dd>
-</dl>
-
-<p>For example to read with &lsquo;<tt>ffplay</tt>&rsquo; a multimedia resource named
-&quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
-</pre></td></tr></table>
-
-<a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">16.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
-
-<p>Real-Time Messaging Protocol and its variants supported through
-librtmp.
-</p>
-<p>Requires the presence of the librtmp headers and library during
-configuration. You need to explicitely configure the build with
-&quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
-protocol.
-</p>
-<p>This protocol provides most client functions and a few server
-functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
-encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
-variants of these encrypted types (RTMPTE, RTMPTS).
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
-</pre></td></tr></table>
-
-<p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
-&quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
-<var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
-meaning as specified for the RTMP native protocol.
-<var>options</var> contains a list of space-separated options of the form
-<var>key</var>=<var>val</var>.
-</p>
-<p>See the librtmp manual page (man 3 librtmp) for more information.
-</p>
-<p>For example, to stream a file in real-time to an RTMP server using
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
-</pre></td></tr></table>
-
-<p>To play the same stream using &lsquo;<tt>ffplay</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
-</pre></td></tr></table>
-
-<a name="rtp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-rtp">16.12 rtp</a></h2>
-
-<p>Real-Time Protocol.
-</p>
-<a name="rtsp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-rtsp">16.13 rtsp</a></h2>
-
-<p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
-and muxer. The demuxer supports both normal RTSP (with data transferred
-over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
-data transferred over RDT).
-</p>
-<p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
-supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
-RTSP server, <a href="http://github.com/revmischa/rtsp-server">http://github.com/revmischa/rtsp-server</a>).
-</p>
-<p>The required syntax for a RTSP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<p><var>options</var> is a <code>&amp;</code>-separated list. The following options
-are supported:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
-<dd><p>Use UDP as lower transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
-<dd><p>Use TCP (interleaving within the RTSP control channel) as lower
-transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>multicast</samp>&rsquo;</dt>
-<dd><p>Use UDP multicast as lower transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>http</samp>&rsquo;</dt>
-<dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
-passing proxies.
-</p>
-</dd>
-<dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
-<dd><p>Accept packets only from negotiated peer address and port.
-</p></dd>
-</dl>
-
-<p>Multiple lower transport protocols may be specified, in that case they are
-tried one at a time (if the setup of one fails, the next one is tried).
-For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
-</p>
-<p>When receiving data over UDP, the demuxer tries to reorder received packets
-(since they may arrive out of order, or packets may get lost totally). In
-order for this to be enabled, a maximum delay must be specified in the
-<code>max_delay</code> field of AVFormatContext.
-</p>
-<p>When watching multi-bitrate Real-RTSP streams with &lsquo;<tt>ffplay</tt>&rsquo;, the
-streams to display can be chosen with <code>-vst</code> <var>n</var> and
-<code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
-on the fly by pressing <code>v</code> and <code>a</code>.
-</p>
-<p>Example command lines:
-</p>
-<p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
-</pre></td></tr></table>
-
-<p>To watch a stream tunneled over HTTP:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtsp://server/video.mp4?http
-</pre></td></tr></table>
-
-<p>To send a stream in realtime to a RTSP server, for others to watch:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
-</pre></td></tr></table>
-
-<a name="sap"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-sap">16.14 sap</a></h2>
-
-<p>Session Announcement Protocol (RFC 2974). This is not technically a
-protocol handler in libavformat, it is a muxer and demuxer.
-It is used for signalling of RTP streams, by announcing the SDP for the
-streams regularly on a separate port.
-</p>
-<a name="Muxer"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Muxer">16.14.1 Muxer</a></h3>
-
-<p>The syntax for a SAP url given to the muxer is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
-</pre></td></tr></table>
-
-<p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
-or to port 5004 if no port is specified.
-<var>options</var> is a <code>&amp;</code>-separated list. The following options
-are supported:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
-<dd><p>Specify the destination IP address for sending the announcements to.
-If omitted, the announcements are sent to the commonly used SAP
-announcement multicast address 224.2.127.254 (sap.mcast.net), or
-ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
-</p>
-</dd>
-<dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
-<dd><p>Specify the port to send the announcements on, defaults to
-9875 if not specified.
-</p>
-</dd>
-<dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
-<dd><p>Specify the time to live value for the announcements and RTP packets,
-defaults to 255.
-</p>
-</dd>
-<dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
-<dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
-default), all streams are sent on unique ports, with each stream on a
-port 2 numbers higher than the previous.
-VLC/Live555 requires this to be set to 1, to be able to receive the stream.
-The RTP stack in libavformat for receiving requires all streams to be sent
-on unique ports.
-</p></dd>
-</dl>
-
-<p>Example command lines follow.
-</p>
-<p>To broadcast a stream on the local subnet, for watching in VLC:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
-</pre></td></tr></table>
-
-<p>Similarly, for watching in ffplay:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
-</pre></td></tr></table>
-
-<p>And for watching in ffplay, over IPv6:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
-</pre></td></tr></table>
-
-<a name="Demuxer"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-Demuxer">16.14.2 Demuxer</a></h3>
-
-<p>The syntax for a SAP url given to the demuxer is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
-</pre></td></tr></table>
-
-<p><var>address</var> is the multicast address to listen for announcements on,
-if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
-is the port that is listened on, 9875 if omitted.
-</p>
-<p>The demuxers listens for announcements on the given address and port.
-Once an announcement is received, it tries to receive that particular stream.
-</p>
-<p>Example command lines follow.
-</p>
-<p>To play back the first stream announced on the normal SAP multicast address:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
-</pre></td></tr></table>
-
-<p>To play back the first stream announced on one the default IPv6 SAP multicast address:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
-</pre></td></tr></table>
-
-<a name="tcp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-tcp">16.15 tcp</a></h2>
-
-<p>Trasmission Control Protocol.
-</p>
-<p>The required syntax for a TCP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
-<dd><p>Listen for an incoming connection
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
-ffplay tcp://<var>hostname</var>:<var>port</var>
-</pre></td></tr></table>
-
-</dd>
-</dl>
-
-<a name="udp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-udp">16.16 udp</a></h2>
-
-<p>User Datagram Protocol.
-</p>
-<p>The required syntax for a UDP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<p><var>options</var> contains a list of &amp;-seperated options of the form <var>key</var>=<var>val</var>.
-Follow the list of supported options.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
-<dd><p>set the UDP buffer size in bytes
-</p>
-</dd>
-<dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
-<dd><p>override the local UDP port to bind with
-</p>
-</dd>
-<dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
-<dd><p>set the size in bytes of UDP packets
-</p>
-</dd>
-<dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
-<dd><p>explicitly allow or disallow reusing UDP sockets
-</p>
-</dd>
-<dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
-<dd><p>set the time to live value (for multicast only)
-</p>
-</dd>
-<dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
-<dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
-destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
-If the destination address isn&rsquo;t known at the start, this option can
-be specified in ff_udp_set_remote_url, too.
-This allows finding out the source address for the packets with getsockname,
-and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
-unreachable&quot; is received.
-For receiving, this gives the benefit of only receiving packets from
-the specified peer address/port.
-</p></dd>
-</dl>
-
-<p>Some usage examples of the udp protocol with &lsquo;<tt>ffmpeg</tt>&rsquo; follow.
-</p>
-<p>To stream over UDP to a remote endpoint:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
-</pre></td></tr></table>
-
-<p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
-</pre></td></tr></table>
-
-<p>To receive over UDP from a remote endpoint:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
-</pre></td></tr></table>
-
-<a name="Bitstream-Filters"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Bitstream-Filters">17. Bitstream Filters</a></h1>
-
-<p>When you configure your FFmpeg build, all the supported bitstream
-filters are enabled by default. You can list all available ones using
-the configure option <code>--list-bsfs</code>.
-</p>
-<p>You can disable all the bitstream filters using the configure option
-<code>--disable-bsfs</code>, and selectively enable any bitstream filter using
-the option <code>--enable-bsf=BSF</code>, or you can disable a particular
-bitstream filter using the option <code>--disable-bsf=BSF</code>.
-</p>
-<p>The option <code>-bsfs</code> of the ff* tools will display the list of
-all the supported bitstream filters included in your build.
-</p>
-<p>Below is a description of the currently available bitstream filters.
-</p>
-<a name="aac_005fadtstoasc"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-aac_005fadtstoasc">17.1 aac_adtstoasc</a></h2>
-
-<a name="chomp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-chomp">17.2 chomp</a></h2>
-
-<a name="dump_005fextradata"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-dump_005fextradata">17.3 dump_extradata</a></h2>
-
-<a name="h264_005fmp4toannexb"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-h264_005fmp4toannexb">17.4 h264_mp4toannexb</a></h2>
-
-<a name="imx_005fdump_005fheader"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-imx_005fdump_005fheader">17.5 imx_dump_header</a></h2>
-
-<a name="mjpeg2jpeg"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mjpeg2jpeg">17.6 mjpeg2jpeg</a></h2>
-
-<p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
-</p>
-<p>MJPEG is a video codec wherein each video frame is essentially a
-JPEG image. The individual frames can be extracted without loss,
-e.g. by
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
-</pre></td></tr></table>
-
-<p>Unfortunately, these chunks are incomplete JPEG images, because
-they lack the DHT segment required for decoding. Quoting from
-<a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
-</p>
-<p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
-commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
-MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
-Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
-and it must use basic Huffman encoding, not arithmetic or
-progressive. . . . You can indeed extract the MJPEG frames and
-decode them with a regular JPEG decoder, but you have to prepend
-the DHT segment to them, or else the decoder won&rsquo;t have any idea
-how to decompress the data. The exact table necessary is given in
-the OpenDML spec.&quot;
-</p>
-<p>This bitstream filter patches the header of frames extracted from an MJPEG
-stream (carrying the AVI1 header ID and lacking a DHT segment) to
-produce fully qualified JPEG images.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
-exiftran -i -9 frame*.jpg
-ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
-</pre></td></tr></table>
-
-<a name="mjpega_005fdump_005fheader"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mjpega_005fdump_005fheader">17.7 mjpega_dump_header</a></h2>
-
-<a name="movsub"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-movsub">17.8 movsub</a></h2>
-
-<a name="mp3_005fheader_005fcompress"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mp3_005fheader_005fcompress">17.9 mp3_header_compress</a></h2>
-
-<a name="mp3_005fheader_005fdecompress"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mp3_005fheader_005fdecompress">17.10 mp3_header_decompress</a></h2>
-
-<a name="noise"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-noise">17.11 noise</a></h2>
-
-<a name="remove_005fextradata"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-remove_005fextradata">17.12 remove_extradata</a></h2>
-
-<a name="Filtergraph-description"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Filtergraph-description">18. Filtergraph description</a></h1>
-
-<p>A filtergraph is a directed graph of connected filters. It can contain
-cycles, and there can be multiple links between a pair of
-filters. Each link has one input pad on one side connecting it to one
-filter from which it takes its input, and one output pad on the other
-side connecting it to the one filter accepting its output.
-</p>
-<p>Each filter in a filtergraph is an instance of a filter class
-registered in the application, which defines the features and the
-number of input and output pads of the filter.
-</p>
-<p>A filter with no input pads is called a &quot;source&quot;, a filter with no
-output pads is called a &quot;sink&quot;.
-</p>
-<a name="Filtergraph-syntax"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-Filtergraph-syntax">18.1 Filtergraph syntax</a></h2>
-
-<p>A filtergraph can be represented using a textual representation, which
-is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
-tools, and by the <code>av_parse_graph()</code> function defined in
-&lsquo;<tt>libavfilter/avfiltergraph</tt>&rsquo;.
-</p>
-<p>A filterchain consists of a sequence of connected filters, each one
-connected to the previous one in the sequence. A filterchain is
-represented by a list of &quot;,&quot;-separated filter descriptions.
-</p>
-<p>A filtergraph consists of a sequence of filterchains. A sequence of
-filterchains is represented by a list of &quot;;&quot;-separated filterchain
-descriptions.
-</p>
-<p>A filter is represented by a string of the form:
-[<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
-</p>
-<p><var>filter_name</var> is the name of the filter class of which the
-described filter is an instance of, and has to be the name of one of
-the filter classes registered in the program.
-The name of the filter class is optionally followed by a string
-&quot;=<var>arguments</var>&quot;.
-</p>
-<p><var>arguments</var> is a string which contains the parameters used to
-initialize the filter instance, and are described in the filter
-descriptions below.
-</p>
-<p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
-and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
-within the quoted text; otherwise the argument string is considered
-terminated when the next special character (belonging to the set
-&quot;[]=;,&quot;) is encountered.
-</p>
-<p>The name and arguments of the filter are optionally preceded and
-followed by a list of link labels.
-A link label allows to name a link and associate it to a filter output
-or input pad. The preceding labels <var>in_link_1</var>
-... <var>in_link_N</var>, are associated to the filter input pads,
-the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
-associated to the output pads.
-</p>
-<p>When two link labels with the same name are found in the
-filtergraph, a link between the corresponding input and output pad is
-created.
-</p>
-<p>If an output pad is not labelled, it is linked by default to the first
-unlabelled input pad of the next filter in the filterchain.
-For example in the filterchain:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
-</pre></td></tr></table>
-<p>the split filter instance has two output pads, and the overlay filter
-instance two input pads. The first output pad of split is labelled
-&quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
-output pad of split is linked to the second input pad of overlay,
-which are both unlabelled.
-</p>
-<p>In a complete filterchain all the unlabelled filter input and output
-pads must be connected. A filtergraph is considered valid if all the
-filter input and output pads of all the filterchains are connected.
-</p>
-<p>Follows a BNF description for the filtergraph syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
-<var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
-<var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
-<var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
-<var>FILTER</var>           ::= [<var>LINKNAMES</var>] <var>NAME</var> [&quot;=&quot; <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
-<var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
-<var>FILTERGRAPH</var>      ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
-</pre></td></tr></table>
-
-
-<a name="Audio-Filters"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Filters">19. Audio Filters</a></h1>
-
-<p>When you configure your FFmpeg build, you can disable any of the
-existing filters using &ndash;disable-filters.
-The configure output will show the audio filters included in your
-build.
-</p>
-<p>Below is a description of the currently available audio filters.
-</p>
-<a name="anull"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-anull">19.1 anull</a></h2>
-
-<p>Pass the audio source unchanged to the output.
-</p>
-
-<a name="Audio-Sources"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Sources">20. Audio Sources</a></h1>
-
-<p>Below is a description of the currently available audio sources.
-</p>
-<a name="anullsrc"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-anullsrc">20.1 anullsrc</a></h2>
-
-<p>Null audio source, never return audio frames. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-</p>
-<p>It accepts as optional parameter a string of the form
-<var>sample_rate</var>:<var>channel_layout</var>.
-</p>
-<p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
-</p>
-<p><var>channel_layout</var> specify the channel layout, and can be either an
-integer or a string representing a channel layout. The default value
-of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
-</p>
-<p>Check the channel_layout_map definition in
-&lsquo;<tt>libavcodec/audioconvert.c</tt>&rsquo; for the mapping between strings and
-channel layout values.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
-anullsrc=48000:4
-
-# same as
-anullsrc=48000:mono
-</pre></td></tr></table>
-
-
-<a name="Audio-Sinks"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Sinks">21. Audio Sinks</a></h1>
-
-<p>Below is a description of the currently available audio sinks.
-</p>
-<a name="anullsink"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-anullsink">21.1 anullsink</a></h2>
-
-<p>Null audio sink, do absolutely nothing with the input audio. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-</p>
-
-<a name="Video-Filters"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Video-Filters">22. Video Filters</a></h1>
-
-<p>When you configure your FFmpeg build, you can disable any of the
-existing filters using &ndash;disable-filters.
-The configure output will show the video filters included in your
-build.
-</p>
-<p>Below is a description of the currently available video filters.
-</p>
-<a name="blackframe"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-blackframe">22.1 blackframe</a></h2>
-
-<p>Detect frames that are (almost) completely black. Can be useful to
-detect chapter transitions or commercials. Output lines consist of
-the frame number of the detected frame, the percentage of blackness,
-the position in the file if known or -1 and the timestamp in seconds.
-</p>
-<p>In order to display the output lines, you need to set the loglevel at
-least to the AV_LOG_INFO value.
-</p>
-<p>The filter accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
-</pre></td></tr></table>
-
-<p><var>amount</var> is the percentage of the pixels that have to be below the
-threshold, and defaults to 98.
-</p>
-<p><var>threshold</var> is the threshold below which a pixel value is
-considered black, and defaults to 32.
-</p>
-<a name="copy"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-copy">22.2 copy</a></h2>
-
-<p>Copy the input source unchanged to the output. Mainly useful for
-testing purposes.
-</p>
-<a name="crop"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-crop">22.3 crop</a></h2>
-
-<p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
-</p>
-<p>The parameters are expressions containing the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), PHI (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
-each new frame.
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output (cropped) width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>the number of input frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>the position in the file of the input frame, NAN if unknown
-</p>
-</dd>
-<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
-<dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
-</p>
-</dd>
-</dl>
-
-<p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
-the width and height of the output (cropped) video. They are
-evaluated just at the configuration of the filter.
-</p>
-<p>The default value of <var>out_w</var> is &quot;in_w&quot;, and the default value of
-<var>out_h</var> is &quot;in_h&quot;.
-</p>
-<p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
-and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
-cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
-evaluated after <var>out_w</var> and <var>out_h</var>.
-</p>
-<p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
-position of the top-left corner of the output (non-cropped) area. They
-are evaluated for each frame. If the evaluated value is not valid, it
-is approximated to the nearest valid value.
-</p>
-<p>The default value of <var>x</var> is &quot;(in_w-out_w)/2&quot;, and the default
-value for <var>y</var> is &quot;(in_h-out_h)/2&quot;, which set the cropped area at
-the center of the input image.
-</p>
-<p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
-for <var>y</var> may depend on <var>x</var>.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># crop the central input area with size 100x100
-crop=100:100
-
-# crop the central input area with size 2/3 of the input video
-&quot;crop=2/3*in_w:2/3*in_h&quot;
-
-# crop the input video central square
-crop=in_h
-
-# delimit the rectangle with the top-left corner placed at position
-# 100:100 and the right-bottom corner corresponding to the right-bottom
-# corner of the input image.
-crop=in_w-100:in_h-100:100:100
-
-# crop 10 pixels from the left and right borders, and 20 pixels from
-# the top and bottom borders
-&quot;crop=in_w-2*10:in_h-2*20&quot;
-
-# keep only the bottom right quarter of the input image
-&quot;crop=in_w/2:in_h/2:in_w/2:in_h/2&quot;
-
-# crop height for getting Greek harmony
-&quot;crop=in_w:1/PHI*in_w&quot;
-
-# trembling effect
-&quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)&quot;
-
-# erratic camera effect depending on timestamp
-&quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
-
-# set x depending on the value of y
-&quot;crop=in_w/2:in_h/2:y:10+10*sin(n/10)&quot;
-</pre></td></tr></table>
-
-<a name="cropdetect"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-cropdetect">22.4 cropdetect</a></h2>
-
-<p>Auto-detect crop size.
-</p>
-<p>Calculate necessary cropping parameters and prints the recommended
-parameters through the logging system. The detected dimensions
-correspond to the non-black area of the input video.
-</p>
-<p>It accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
-<dd><p>Threshold, which can be optionally specified from nothing (0) to
-everything (255), defaults to 24.
-</p>
-</dd>
-<dt> &lsquo;<samp>round</samp>&rsquo;</dt>
-<dd><p>Value which the width/height should be divisible by, defaults to
-16. The offset is automatically adjusted to center the video. Use 2 to
-get only even dimensions (needed for 4:2:2 video). 16 is best when
-encoding to most video codecs.
-</p>
-</dd>
-<dt> &lsquo;<samp>reset</samp>&rsquo;</dt>
-<dd><p>Counter that determines after how many frames cropdetect will reset
-the previously detected largest video area and start over to detect
-the current optimal crop area. Defaults to 0.
-</p>
-<p>This can be useful when channel logos distort the video area. 0
-indicates never reset and return the largest area encountered during
-playback.
-</p></dd>
-</dl>
-
-<a name="drawbox"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-drawbox">22.5 drawbox</a></h2>
-
-<p>Draw a colored box on the input image.
-</p>
-<p>It accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>Specify the top left corner coordinates of the box. Default to 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd><p>Specify the width and height of the box, if 0 they are interpreted as
-the input width and height. Default to 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd><p>Specify the color of the box to write, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-</p></dd>
-</dl>
-
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># draw a black box around the edge of the input image
-drawbox
-
-# draw a box with color red and an opacity of 50%
-drawbox=10:20:200:60:red@0.5&quot;
-</pre></td></tr></table>
-
-<a name="drawtext"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-drawtext">22.6 drawtext</a></h2>
-
-<p>Draw text string or text from specified file on top of video using the
-libfreetype library.
-</p>
-<p>To enable compilation of this filter you need to configure FFmpeg with
-<code>--enable-libfreetype</code>.
-</p>
-<p>The filter also recognizes strftime() sequences in the provided text
-and expands them accordingly. Check the documentation of strftime().
-</p>
-<p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
-separated by &quot;:&quot;.
-</p>
-<p>The description of the accepted parameters follows.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
-<dd><p>The font file to be used for drawing text. Path must be included.
-This parameter is mandatory.
-</p>
-</dd>
-<dt> &lsquo;<samp>text</samp>&rsquo;</dt>
-<dd><p>The text string to be drawn. The text must be a sequence of UTF-8
-encoded characters.
-This parameter is mandatory if no file is specified with the parameter
-<var>textfile</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
-<dd><p>A text file containing text to be drawn. The text must be a sequence
-of UTF-8 encoded characters.
-</p>
-<p>This parameter is mandatory if no text string is specified with the
-parameter <var>text</var>.
-</p>
-<p>If both text and textfile are specified, an error is thrown.
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>The offsets where text will be drawn within the video frame.
-Relative to the top/left border of the output image.
-</p>
-<p>The default value of <var>x</var> and <var>y</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
-<dd><p>The font size to be used for drawing text.
-The default value of <var>fontsize</var> is 16.
-</p>
-</dd>
-<dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing fonts.
-Either a string (e.g. &quot;red&quot;) or in 0xRRGGBB[AA] format
-(e.g. &quot;0xff000033&quot;), possibly followed by an alpha specifier.
-The default value of <var>fontcolor</var> is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing box around text.
-Either a string (e.g. &quot;yellow&quot;) or in 0xRRGGBB[AA] format
-(e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
-The default value of <var>boxcolor</var> is &quot;white&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>box</samp>&rsquo;</dt>
-<dd><p>Used to draw a box around text using background color.
-Value should be either 1 (enable) or 0 (disable).
-The default value of <var>box</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>shadowx, shadowy</samp>&rsquo;</dt>
-<dd><p>The x and y offsets for the text shadow position with respect to the
-position of the text. They can be either positive or negative
-values. Default value for both is &quot;0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing a shadow behind the drawn text.  It
-can be a color name (e.g. &quot;yellow&quot;) or a string in the 0xRRGGBB[AA]
-form (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
-The default value of <var>shadowcolor</var> is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
-<dd><p>Flags to be used for loading the fonts.
-</p>
-<p>The flags map the corresponding flags supported by libfreetype, and are
-a combination of the following values:
-</p><dl compact="compact">
-<dt> <var>default</var></dt>
-<dt> <var>no_scale</var></dt>
-<dt> <var>no_hinting</var></dt>
-<dt> <var>render</var></dt>
-<dt> <var>no_bitmap</var></dt>
-<dt> <var>vertical_layout</var></dt>
-<dt> <var>force_autohint</var></dt>
-<dt> <var>crop_bitmap</var></dt>
-<dt> <var>pedantic</var></dt>
-<dt> <var>ignore_global_advance_width</var></dt>
-<dt> <var>no_recurse</var></dt>
-<dt> <var>ignore_transform</var></dt>
-<dt> <var>monochrome</var></dt>
-<dt> <var>linear_design</var></dt>
-<dt> <var>no_autohint</var></dt>
-<dt> <var>end table</var></dt>
-</dl>
-
-<p>Default value is &quot;render&quot;.
-</p>
-<p>For more information consult the documentation for the FT_LOAD_*
-libfreetype flags.
-</p>
-</dd>
-<dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
-<dd><p>The size in number of spaces to use for rendering the tab.
-Default value is 4.
-</p></dd>
-</dl>
-
-<p>For example the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
-</pre></td></tr></table>
-
-<p>will draw &quot;Test Text&quot; with font FreeSerif, using the default values
-for the optional parameters.
-</p>
-<p>The command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
-          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
-</pre></td></tr></table>
-
-<p>will draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
-and y=50 (counting from the top-left corner of the screen), text is
-yellow with a red box around it. Both the text and the box have an
-opacity of 20%.
-</p>
-<p>Note that the double quotes are not necessary if spaces are not used
-within the parameter list.
-</p>
-<p>For more information about libfreetype, check:
-<a href="http://www.freetype.org/">http://www.freetype.org/</a>.
-</p>
-<a name="fade"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-fade">22.7 fade</a></h2>
-
-<p>Apply fade-in/out effect to input video.
-</p>
-<p>It accepts the parameters:
-<var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
-</p>
-<p><var>type</var> specifies if the effect type, can be either &quot;in&quot; for
-fade-in, or &quot;out&quot; for a fade-out effect.
-</p>
-<p><var>start_frame</var> specifies the number of the start frame for starting
-to apply the fade effect.
-</p>
-<p><var>nb_frames</var> specifies the number of frames for which the fade
-effect has to last. At the end of the fade-in effect the output video
-will have the same intensity as the input video, at the end of the
-fade-out transition the output video will be completely black.
-</p>
-<p>A few usage examples follow, usable too as test scenarios.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># fade in first 30 frames of video
-fade=in:0:30
-
-# fade out last 45 frames of a 200-frame video
-fade=out:155:45
-
-# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
-fade=in:0:25, fade=out:975:25
-
-# make first 5 frames black, then fade in from frame 5-24
-fade=in:5:20
-</pre></td></tr></table>
-
-<a name="fieldorder"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-fieldorder">22.8 fieldorder</a></h2>
-
-<p>Transform the field order of the input video.
-</p>
-<p>It accepts one parameter which specifies the required field order that
-the input interlaced video will be transformed to. The parameter can
-assume one of the following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0 or bff</samp>&rsquo;</dt>
-<dd><p>output bottom field first
-</p></dd>
-<dt> &lsquo;<samp>1 or tff</samp>&rsquo;</dt>
-<dd><p>output top field first
-</p></dd>
-</dl>
-
-<p>Default value is &quot;tff&quot;.
-</p>
-<p>Transformation is achieved by shifting the picture content up or down
-by one line, and filling the remaining line with appropriate picture content.
-This method is consistent with most broadcast field order converters.
-</p>
-<p>If the input video is not flagged as being interlaced, or it is already
-flagged as being of the required output field order then this filter does
-not alter the incoming video.
-</p>
-<p>This filter is very useful when converting to or from PAL DV material,
-which is bottom field first.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
-</pre></td></tr></table>
-
-<a name="fifo"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-fifo">22.9 fifo</a></h2>
-
-<p>Buffer input images and send them when they are requested.
-</p>
-<p>This filter is mainly useful when auto-inserted by the libavfilter
-framework.
-</p>
-<p>The filter does not take parameters.
-</p>
-<a name="format"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-format">22.10 format</a></h2>
-
-<p>Convert the input video to one of the specified pixel formats.
-Libavfilter will try to pick one that is supported for the input to
-the next filter.
-</p>
-<p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
-for example &quot;yuv420p:monow:rgb24&quot;.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># convert the input video to the format &quot;yuv420p&quot;
-format=yuv420p
-
-# convert the input video to any of the formats in the list
-format=yuv420p:yuv444p:yuv410p
-</pre></td></tr></table>
-
-<p><a name="frei0r"></a>
-</p><a name="frei0r-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-frei0r-1">22.11 frei0r</a></h2>
-
-<p>Apply a frei0r effect to the input video.
-</p>
-<p>To enable compilation of this filter you need to install the frei0r
-header and configure FFmpeg with &ndash;enable-frei0r.
-</p>
-<p>The filter supports the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
-</pre></td></tr></table>
-
-<p><var>filter_name</var> is the name to the frei0r effect to load. If the
-environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
-is searched in each one of the directories specified by the colon
-separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
-paths, which are in this order: &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;,
-&lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;, &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
-</p>
-<p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
-for the frei0r effect.
-</p>
-<p>A frei0r effect parameter can be a boolean (whose values are specified
-with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
-<var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
-numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
-description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
-<var>X</var> and <var>Y</var> being float numbers) and a string.
-</p>
-<p>The number and kind of parameters depend on the loaded effect. If an
-effect parameter is not specified the default value is set.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
-frei0r=distort0r:0.5:0.01
-
-# apply the colordistance effect, takes a color as first parameter
-frei0r=colordistance:0.2/0.3/0.4
-frei0r=colordistance:violet
-frei0r=colordistance:0x112233
-
-# apply the perspective effect, specify the top left and top right
-# image positions
-frei0r=perspective:0.2/0.2:0.8/0.2
-</pre></td></tr></table>
-
-<p>For more information see:
-<a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
-</p>
-<a name="gradfun"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-gradfun">22.12 gradfun</a></h2>
-
-<p>Fix the banding artifacts that are sometimes introduced into nearly flat
-regions by truncation to 8bit colordepth.
-Interpolate the gradients that should go where the bands are, and
-dither them.
-</p>
-<p>This filter is designed for playback only.  Do not use it prior to
-lossy compression, because compression tends to lose the dither and
-bring back the bands.
-</p>
-<p>The filter takes two optional parameters, separated by &rsquo;:&rsquo;:
-<var>strength</var>:<var>radius</var>
-</p>
-<p><var>strength</var> is the maximum amount by which the filter will change
-any one pixel. Also the threshold for detecting nearly flat
-regions. Acceptable values range from .51 to 255, default value is
-1.2, out-of-range values will be clipped to the valid range.
-</p>
-<p><var>radius</var> is the neighborhood to fit the gradient to. A larger
-radius makes for smoother gradients, but also prevents the filter from
-modifying the pixels near detailed regions. Acceptable values are
-8-32, default value is 16, out-of-range values will be clipped to the
-valid range.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># default parameters
-gradfun=1.2:16
-
-# omitting radius
-gradfun=1.2
-</pre></td></tr></table>
-
-<a name="hflip"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-hflip">22.13 hflip</a></h2>
-
-<p>Flip the input video horizontally.
-</p>
-<p>For example to horizontally flip the video in input with
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
-</pre></td></tr></table>
-
-<a name="hqdn3d"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-hqdn3d">22.14 hqdn3d</a></h2>
-
-<p>High precision/quality 3d denoise filter. This filter aims to reduce
-image noise producing smooth images and making still images really
-still. It should enhance compressibility.
-</p>
-<p>It accepts the following optional parameters:
-<var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
-<dd><p>a non-negative float number which specifies spatial luma strength,
-defaults to 4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
-<dd><p>a non-negative float number which specifies spatial chroma strength,
-defaults to 3.0*<var>luma_spatial</var>/4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
-<dd><p>a float number which specifies luma temporal strength, defaults to
-6.0*<var>luma_spatial</var>/4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
-<dd><p>a float number which specifies chroma temporal strength, defaults to
-<var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
-</p></dd>
-</dl>
-
-<a name="mp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-mp">22.15 mp</a></h2>
-
-<p>Apply an MPlayer filter to the input video.
-</p>
-<p>This filter provides a wrapper around most of the filters of
-MPlayer/MEncoder.
-</p>
-<p>This wrapper is considered experimental. Some of the wrapped filters
-may not work properly and we may drop support for them, as they will
-be implemented natively into FFmpeg. Thus you should avoid
-depending on them when writing portable scripts.
-</p>
-<p>The filters accepts the parameters:
-<var>filter_name</var>[:=]<var>filter_params</var>
-</p>
-<p><var>filter_name</var> is the name of a supported MPlayer filter,
-<var>filter_params</var> is a string containing the parameters accepted by
-the named filter.
-</p>
-<p>The list of the currently supported filters follows:
-</p><dl compact="compact">
-<dt> <var>2xsai</var></dt>
-<dt> <var>blackframe</var></dt>
-<dt> <var>boxblur</var></dt>
-<dt> <var>cropdetect</var></dt>
-<dt> <var>decimate</var></dt>
-<dt> <var>delogo</var></dt>
-<dt> <var>denoise3d</var></dt>
-<dt> <var>detc</var></dt>
-<dt> <var>dint</var></dt>
-<dt> <var>divtc</var></dt>
-<dt> <var>down3dright</var></dt>
-<dt> <var>dsize</var></dt>
-<dt> <var>eq2</var></dt>
-<dt> <var>eq</var></dt>
-<dt> <var>field</var></dt>
-<dt> <var>fil</var></dt>
-<dt> <var>fixpts</var></dt>
-<dt> <var>framestep</var></dt>
-<dt> <var>fspp</var></dt>
-<dt> <var>geq</var></dt>
-<dt> <var>gradfun</var></dt>
-<dt> <var>harddup</var></dt>
-<dt> <var>hqdn3d</var></dt>
-<dt> <var>hue</var></dt>
-<dt> <var>il</var></dt>
-<dt> <var>ilpack</var></dt>
-<dt> <var>ivtc</var></dt>
-<dt> <var>kerndeint</var></dt>
-<dt> <var>mcdeint</var></dt>
-<dt> <var>mirror</var></dt>
-<dt> <var>noise</var></dt>
-<dt> <var>ow</var></dt>
-<dt> <var>palette</var></dt>
-<dt> <var>perspective</var></dt>
-<dt> <var>phase</var></dt>
-<dt> <var>pp7</var></dt>
-<dt> <var>pullup</var></dt>
-<dt> <var>qp</var></dt>
-<dt> <var>rectangle</var></dt>
-<dt> <var>remove-logo</var></dt>
-<dt> <var>rgbtest</var></dt>
-<dt> <var>rotate</var></dt>
-<dt> <var>sab</var></dt>
-<dt> <var>screenshot</var></dt>
-<dt> <var>smartblur</var></dt>
-<dt> <var>softpulldown</var></dt>
-<dt> <var>softskip</var></dt>
-<dt> <var>spp</var></dt>
-<dt> <var>swapuv</var></dt>
-<dt> <var>telecine</var></dt>
-<dt> <var>test</var></dt>
-<dt> <var>tile</var></dt>
-<dt> <var>tinterlace</var></dt>
-<dt> <var>unsharp</var></dt>
-<dt> <var>uspp</var></dt>
-<dt> <var>yuvcsp</var></dt>
-<dt> <var>yvu9</var></dt>
-</dl>
-
-<p>The parameter syntax and behavior for the listed filters are the same
-of the corresponding MPlayer filters. For detailed instructions check
-the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
-mp=delogo=200:200:80:20:1
-
-# adjust gamma, brightness, contrast
-mp=eq2=1.0:2:0.5
-
-# tweak hue and saturation
-mp=hue=100:-10
-</pre></td></tr></table>
-
-<p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
-</p>
-<a name="noformat"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-noformat">22.16 noformat</a></h2>
-
-<p>Force libavfilter not to use any of the specified pixel formats for the
-input to the next filter.
-</p>
-<p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
-for example &quot;yuv420p:monow:rgb24&quot;.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># force libavfilter to use a format different from &quot;yuv420p&quot; for the
-# input to the vflip filter
-noformat=yuv420p,vflip
-
-# convert the input video to any of the formats not contained in the list
-noformat=yuv420p:yuv444p:yuv410p
-</pre></td></tr></table>
-
-<a name="null-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-null-1">22.17 null</a></h2>
-
-<p>Pass the video source unchanged to the output.
-</p>
-<a name="ocv"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-ocv">22.18 ocv</a></h2>
-
-<p>Apply video transform using libopencv.
-</p>
-<p>To enable this filter install libopencv library and headers and
-configure FFmpeg with &ndash;enable-libopencv.
-</p>
-<p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
-</p>
-<p><var>filter_name</var> is the name of the libopencv filter to apply.
-</p>
-<p><var>filter_params</var> specifies the parameters to pass to the libopencv
-filter. If not specified the default values are assumed.
-</p>
-<p>Refer to the official libopencv documentation for more precise
-informations:
-<a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
-</p>
-<p>Follows the list of supported libopencv filters.
-</p>
-<p><a name="dilate"></a>
-</p><a name="dilate-1"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-dilate-1">22.18.1 dilate</a></h3>
-
-<p>Dilate an image by using a specific structuring element.
-This filter corresponds to the libopencv function <code>cvDilate</code>.
-</p>
-<p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
-</p>
-<p><var>struct_el</var> represents a structuring element, and has the syntax:
-<var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
-</p>
-<p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
-the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
-point, and <var>shape</var> the shape for the structuring element, and
-can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
-</p>
-<p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
-string of the form &quot;=<var>filename</var>&quot;. The file with name
-<var>filename</var> is assumed to represent a binary image, with each
-printable character corresponding to a bright pixel. When a custom
-<var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
-or columns and rows of the read file are assumed instead.
-</p>
-<p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
-</p>
-<p><var>nb_iterations</var> specifies the number of times the transform is
-applied to the image, and defaults to 1.
-</p>
-<p>Follow some example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
-ocv=dilate
-
-# dilate using a structuring element with a 5x5 cross, iterate two times
-ocv=dilate=5x5+2x2/cross:2
-
-# read the shape from the file diamond.shape, iterate two times
-# the file diamond.shape may contain a pattern of characters like this:
-#   *
-#  ***
-# *****
-#  ***
-#   *
-# the specified cols and rows are ignored (but not the anchor point coordinates)
-ocv=0x0+2x2/custom=diamond.shape:2
-</pre></td></tr></table>
-
-<a name="erode"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-erode">22.18.2 erode</a></h3>
-
-<p>Erode an image by using a specific structuring element.
-This filter corresponds to the libopencv function <code>cvErode</code>.
-</p>
-<p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
-with the same meaning and use of those of the dilate filter
-(see <a href="#dilate">dilate</a>).
-</p>
-<a name="smooth"></a>
-<h3 class="subsection"><a href="ffmpeg.html#toc-smooth">22.18.3 smooth</a></h3>
-
-<p>Smooth the input video.
-</p>
-<p>The filter takes the following parameters:
-<var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
-</p>
-<p><var>type</var> is the type of smooth filter to apply, and can be one of
-the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
-&quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
-</p>
-<p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
-parameters whose meanings depend on smooth type. <var>param1</var> and
-<var>param2</var> accept integer positive values or 0, <var>param3</var> and
-<var>param4</var> accept float values.
-</p>
-<p>The default value for <var>param1</var> is 3, the default value for the
-other parameters is 0.
-</p>
-<p>These parameters correspond to the parameters assigned to the
-libopencv function <code>cvSmooth</code>.
-</p>
-<a name="overlay"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-overlay">22.19 overlay</a></h2>
-
-<p>Overlay one video on top of another.
-</p>
-<p>It takes two inputs and one output, the first input is the &quot;main&quot;
-video on which the second input is overlayed.
-</p>
-<p>It accepts the parameters: <var>x</var>:<var>y</var>.
-</p>
-<p><var>x</var> is the x coordinate of the overlayed video on the main video,
-<var>y</var> is the y coordinate. The parameters are expressions containing
-the following parameters:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>main_w, main_h</samp>&rsquo;</dt>
-<dd><p>main input width and height
-</p>
-</dd>
-<dt> &lsquo;<samp>W, H</samp>&rsquo;</dt>
-<dd><p>same as <var>main_w</var> and <var>main_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>overlay_w, overlay_h</samp>&rsquo;</dt>
-<dd><p>overlay input width and height
-</p>
-</dd>
-<dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
-<dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
-</p></dd>
-</dl>
-
-<p>Be aware that frames are taken from each input video in timestamp
-order, hence, if their initial timestamps differ, it is a a good idea
-to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
-have them begin in the same zero timestamp, as it does the example for
-the <var>movie</var> filter.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
-# corner of the main video.
-overlay=main_w-overlay_w-10:main_h-overlay_h-10
-
-# insert a transparent PNG logo in the bottom left corner of the input
-movie=logo.png [logo];
-[in][logo] overlay=10:main_h-overlay_h-10 [out]
-
-# insert 2 different transparent PNG logos (second logo on bottom
-# right corner):
-movie=logo1.png [logo1];
-movie=logo2.png [logo2];
-[in][logo1]       overlay=10:H-h-10 [in+logo1];
-[in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
-
-# add a transparent color layer on top of the main video,
-# WxH specifies the size of the main input to the overlay filter
-color=red.3:WxH [over]; [in][over] overlay [out]
-</pre></td></tr></table>
-
-<p>You can chain togheter more overlays but the efficiency of such
-approach is yet to be tested.
-</p>
-<a name="pad"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-pad">22.20 pad</a></h2>
-
-<p>Add paddings to the input image, and places the original input at the
-given coordinates <var>x</var>, <var>y</var>.
-</p>
-<p>It accepts the following parameters:
-<var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
-</p>
-<p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
-expressions containing the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input video width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output width and heigth, that is the size of the padded area as
-specified by the <var>width</var> and <var>height</var> expressions
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
-expressions, or NAN if not yet specified
-</p>
-</dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
-<dd><p>horizontal and vertical chroma subsample values. For example for the
-pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
-</p></dd>
-</dl>
-
-<p>Follows the description of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd>
-<p>Specify the size of the output image with the paddings added. If the
-value for <var>width</var> or <var>height</var> is 0, the corresponding input size
-is used for the output.
-</p>
-<p>The <var>width</var> expression can reference the value set by the
-<var>height</var> expression, and viceversa.
-</p>
-<p>The default value of <var>width</var> and <var>height</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd>
-<p>Specify the offsets where to place the input image in the padded area
-with respect to the top/left border of the output image.
-</p>
-<p>The <var>x</var> expression can reference the value set by the <var>y</var>
-expression, and viceversa.
-</p>
-<p>The default value of <var>x</var> and <var>y</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd>
-<p>Specify the color of the padded area, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-</p>
-<p>The default value of <var>color</var> is &quot;black&quot;.
-</p>
-</dd>
-</dl>
-
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># Add paddings with color &quot;violet&quot; to the input video. Output video
-# size is 640x480, the top-left corner of the input video is placed at
-# column 0, row 40.
-pad=640:480:0:40:violet
-
-# pad the input to get an output with dimensions increased bt 3/2,
-# and put the input video at the center of the padded area
-pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
-
-# pad the input to get a squared output with size equal to the maximum
-# value between the input width and height, and put the input video at
-# the center of the padded area
-pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
-
-# pad the input to get a final w/h ratio of 16:9
-pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
-
-# double output size and put the input video in the bottom-right
-# corner of the output padded area
-pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
-</pre></td></tr></table>
-
-<a name="pixdesctest"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-pixdesctest">22.21 pixdesctest</a></h2>
-
-<p>Pixel format descriptor test filter, mainly useful for internal
-testing. The output video should be equal to the input video.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
-</pre></td></tr></table>
-
-<p>can be used to test the monowhite pixel format descriptor definition.
-</p>
-<a name="scale"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-scale">22.22 scale</a></h2>
-
-<p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
-</p>
-<p>The parameters <var>width</var> and <var>height</var> are expressions containing
-the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output (cropped) width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
-<dd><p>horizontal and vertical chroma subsample values. For example for the
-pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
-</p></dd>
-</dl>
-
-<p>If the input image format is different from the format requested by
-the next filter, the scale filter will convert the input to the
-requested format.
-</p>
-<p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
-size is used for the output.
-</p>
-<p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
-use, for the respective output size, a value that maintains the aspect
-ratio of the input image.
-</p>
-<p>The default value of <var>width</var> and <var>height</var> is 0.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># scale the input video to a size of 200x100.
-scale=200:100
-
-# scale the input to 2x
-scale=2*iw:2*ih
-# the above is the same as
-scale=2*in_w:2*in_h
-
-# scale the input to half size
-scale=iw/2:ih/2
-
-# increase the width, and set the height to the same size
-scale=3/2*iw:ow
-
-# seek for Greek harmony
-scale=iw:1/PHI*iw
-scale=ih*PHI:ih
-
-# increase the height, and set the width to 3/2 of the height
-scale=3/2*oh:3/5*ih
-
-# increase the size, but make the size a multiple of the chroma
-scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
-
-# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
-scale='min(500\, iw*3/2):-1'
-</pre></td></tr></table>
-
-<a name="select"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-select">22.23 select</a></h2>
-<p>Select frames to pass in output.
-</p>
-<p>It accepts in input an expression, which is evaluated for each input
-frame. If the expression is evaluated to a non-zero value, the frame
-is selected and passed to the output, otherwise it is discarded.
-</p>
-<p>The expression can contain the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
-<dd><p>Greek PI
-</p>
-</dd>
-<dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
-<dd><p>golden ratio
-</p>
-</dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Euler number
-</p>
-</dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the filtered frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the selected frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the last selected frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
-<dd><p>timebase of the input timestamps
-</p>
-</dd>
-<dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
-<dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in <var>TB</var> units, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
-<dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in seconds, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the previously filtered video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the last previously filtered video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
-<dd><p>the PTS of the last previously selected video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the first video frame in the video, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
-<dd><p>the time of the first video frame in the video, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>pict_type</samp>&rsquo;</dt>
-<dd><p>the picture type of the filtered frame, can assume one of the following
-values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>PICT_TYPE_I</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_P</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_B</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_S</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_SI</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_SP</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_BI</samp>&rsquo;</dt>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>interlace_type</samp>&rsquo;</dt>
-<dd><p>the frame interlace type, can assume one of the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>INTERLACE_TYPE_P</samp>&rsquo;</dt>
-<dd><p>the frame is progressive (not interlaced)
-</p></dd>
-<dt> &lsquo;<samp>INTERLACE_TYPE_T</samp>&rsquo;</dt>
-<dd><p>the frame is top-field-first
-</p></dd>
-<dt> &lsquo;<samp>INTERLACE_TYPE_B</samp>&rsquo;</dt>
-<dd><p>the frame is bottom-field-first
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>key</samp>&rsquo;</dt>
-<dd><p>1 if the filtered frame is a key-frame, 0 otherwise
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>the position in the file of the filtered frame, -1 if the information
-is not available (e.g. for synthetic video)
-</p></dd>
-</dl>
-
-<p>The default value of the select expression is &quot;1&quot;.
-</p>
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># select all frames in input
-select
-
-# the above is the same as:
-select=1
-
-# skip all frames:
-select=0
-
-# select only I-frames
-select='eq(pict_type\,PICT_TYPE_I)'
-
-# select one frame every 100
-select='not(mod(n\,100))'
-
-# select only frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)'
-
-# select only I frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
-
-# select frames with a minimum distance of 10 seconds
-select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
-</pre></td></tr></table>
-
-<p><a name="setdar"></a>
-</p><a name="setdar-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-setdar-1">22.24 setdar</a></h2>
-
-<p>Set the Display Aspect Ratio for the filter output video.
-</p>
-<p>This is done by changing the specified Sample (aka Pixel) Aspect
-Ratio, according to the following equation:
-<em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
-</p>
-<p>Keep in mind that this filter does not modify the pixel dimensions of
-the video frame. Also the display aspect ratio set by this filter may
-be changed by later filters in the filterchain, e.g. in case of
-scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is applied.
-</p>
-<p>The filter accepts a parameter string which represents the wanted
-display aspect ratio.
-The parameter can be a floating point number string, or an expression
-of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio.
-If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
-</p>
-<p>For example to change the display aspect ratio to 16:9, specify:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">setdar=16:9
-# the above is equivalent to
-setdar=1.77777
-</pre></td></tr></table>
-
-<p>See also the &quot;setsar&quot; filter documentation (see <a href="#setsar">setsar</a>).
-</p>
-<a name="setpts"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-setpts">22.25 setpts</a></h2>
-
-<p>Change the PTS (presentation timestamp) of the input video frames.
-</p>
-<p>Accept in input an expression evaluated through the eval API, which
-can contain the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
-<dd><p>the presentation timestamp in input
-</p>
-</dd>
-<dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
-<dd><p>Greek PI
-</p>
-</dd>
-<dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
-<dd><p>golden ratio
-</p>
-</dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Euler number
-</p>
-</dd>
-<dt> &lsquo;<samp>N</samp>&rsquo;</dt>
-<dd><p>the count of the input frame, starting from 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
-<dd><p>the PTS of the first video frame
-</p>
-</dd>
-<dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
-<dd><p>tell if the current frame is interlaced
-</p>
-</dd>
-<dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
-<dd><p>original position in the file of the frame, or undefined if undefined
-for the current frame
-</p>
-</dd>
-<dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
-<dd><p>previous input PTS
-</p>
-</dd>
-<dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
-<dd><p>previous output PTS
-</p>
-</dd>
-</dl>
-
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># start counting PTS from zero
-setpts=PTS-STARTPTS
-
-# fast motion
-setpts=0.5*PTS
-
-# slow motion
-setpts=2.0*PTS
-
-# fixed rate 25 fps
-setpts=N/(25*TB)
-
-# fixed rate 25 fps with some jitter
-setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
-</pre></td></tr></table>
-
-<p><a name="setsar"></a>
-</p><a name="setsar-1"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-setsar-1">22.26 setsar</a></h2>
-
-<p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
-</p>
-<p>Note that as a consequence of the application of this filter, the
-output display aspect ratio will change according to the following
-equation:
-<em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
-</p>
-<p>Keep in mind that the sample aspect ratio set by this filter may be
-changed by later filters in the filterchain, e.g. if another &quot;setsar&quot;
-or a &quot;setdar&quot; filter is applied.
-</p>
-<p>The filter accepts a parameter string which represents the wanted
-sample aspect ratio.
-The parameter can be a floating point number string, or an expression
-of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio.
-If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
-</p>
-<p>For example to change the sample aspect ratio to 10:11, specify:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">setsar=10:11
-</pre></td></tr></table>
-
-<a name="settb"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-settb">22.27 settb</a></h2>
-
-<p>Set the timebase to use for the output frames timestamps.
-It is mainly useful for testing timebase configuration.
-</p>
-<p>It accepts in input an arithmetic expression representing a rational.
-The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;, &quot;AVTB&quot; (the
-default timebase), and &quot;intb&quot; (the input timebase).
-</p>
-<p>The default value for the input is &quot;intb&quot;.
-</p>
-<p>Follow some examples.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># set the timebase to 1/25
-settb=1/25
-
-# set the timebase to 1/10
-settb=0.1
-
-#set the timebase to 1001/1000
-settb=1+0.001
-
-#set the timebase to 2*intb
-settb=2*intb
-
-#set the default timebase value
-settb=AVTB
-</pre></td></tr></table>
-
-<a name="showinfo"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-showinfo">22.28 showinfo</a></h2>
-
-<p>Show a line containing various information for each input video frame.
-The input video is not modified.
-</p>
-<p>The shown line contains a sequence of key/value pairs of the form
-<var>key</var>:<var>value</var>.
-</p>
-<p>A description of each shown parameter follows:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>sequential number of the input frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
-<dd><p>Presentation TimeStamp of the input frame, expressed as a number of
-time base units. The time base unit depends on the filter input pad.
-</p>
-</dd>
-<dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
-<dd><p>Presentation TimeStamp of the input frame, expressed as a number of
-seconds
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>position of the frame in the input stream, -1 if this information in
-unavailable and/or meanigless (for example in case of synthetic video)
-</p>
-</dd>
-<dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
-<dd><p>pixel format name
-</p>
-</dd>
-<dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
-<dd><p>sample aspect ratio of the input frame, expressed in the form
-<var>num</var>/<var>den</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>s</samp>&rsquo;</dt>
-<dd><p>size of the input frame, expressed in the form
-<var>width</var>x<var>height</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>i</samp>&rsquo;</dt>
-<dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
-for bottom field first)
-</p>
-</dd>
-<dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
-<dd><p>1 if the frame is a key frame, 0 otherwise
-</p>
-</dd>
-<dt> &lsquo;<samp>type</samp>&rsquo;</dt>
-<dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
-P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
-Check also the documentation of the <code>AVPictureType</code> enum and of
-the <code>av_get_picture_type_char</code> function defined in
-&lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
-</p>
-</dd>
-<dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
-<dd><p>Adler-32 checksum of all the planes of the input frame
-</p>
-</dd>
-<dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
-<dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
-&quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
-</p></dd>
-</dl>
-
-<a name="slicify"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-slicify">22.29 slicify</a></h2>
-
-<p>Pass the images of input video on to next video filter as multiple
-slices.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;slicify=32&quot; out.avi
-</pre></td></tr></table>
-
-<p>The filter accepts the slice height as parameter. If the parameter is
-not specified it will use the default value of 16.
-</p>
-<p>Adding this in the beginning of filter chains should make filtering
-faster due to better use of the memory cache.
-</p>
-<a name="split"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-split">22.30 split</a></h2>
-
-<p>Pass on the input video to two outputs. Both outputs are identical to
-the input video.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
-[splitout1] crop=100:100:0:0    [cropout];
-[splitout2] pad=200:200:100:100 [padout];
-</pre></td></tr></table>
-
-<p>will create two separate outputs from the same input, one cropped and
-one padded.
-</p>
-<a name="transpose"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-transpose">22.31 transpose</a></h2>
-
-<p>Transpose rows with columns in the input video and optionally flip it.
-</p>
-<p>It accepts a parameter representing an integer, which can assume the
-values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
-. . -&gt;  . .
-l.r     R.r
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees clockwise, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
-. . -&gt;  . .
-l.r     r.R
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees counterclockwise, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
-. . -&gt;  . .
-l.r     L.l
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
-. . -&gt;  . .
-l.r     l.L
-</pre></td></tr></table>
-</dd>
-</dl>
-
-<a name="unsharp"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-unsharp">22.32 unsharp</a></h2>
-
-<p>Sharpen or blur the input video.
-</p>
-<p>It accepts the following parameters:
-<var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>
-</p>
-<p>Negative values for the amount will blur the input video, while positive
-values will sharpen. All parameters are optional and default to the
-equivalent of the string &rsquo;5:5:1.0:0:0:0.0&rsquo;.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>luma_msize_x</samp>&rsquo;</dt>
-<dd><p>Set the luma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_msize_y</samp>&rsquo;</dt>
-<dd><p>Set the luma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
-<dd><p>Set the luma effect strength. It can be a float number between -2.0
-and 5.0, default value is 1.0.
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_msize_x</samp>&rsquo;</dt>
-<dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
-and 13, default value is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_msize_y</samp>&rsquo;</dt>
-<dd><p>Set the chroma matrix vertical size. It can be an integer between 3
-and 13, default value is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
-<dd><p>Set the chroma effect strength. It can be a float number between -2.0
-and 5.0, default value is 0.0.
-</p>
-</dd>
-</dl>
-
-<table><tr><td>&nbsp;</td><td><pre class="example"># Strong luma sharpen effect parameters
-unsharp=7:7:2.5
-
-# Strong blur of both luma and chroma parameters
-unsharp=7:7:-2:7:7:-2
-
-# Use the default values with <code>ffmpeg</code>
-./ffmpeg -i in.avi -vf &quot;unsharp&quot; out.mp4
-</pre></td></tr></table>
-
-<a name="vflip"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-vflip">22.33 vflip</a></h2>
-
-<p>Flip the input video vertically.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
-</pre></td></tr></table>
-
-<a name="yadif"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-yadif">22.34 yadif</a></h2>
-
-<p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
-filter&quot;).
-</p>
-<p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>.
-</p>
-<p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
-following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>output 1 frame for each frame
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>output 1 frame for each field
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>like 0 but skips spatial interlacing check
-</p></dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>like 1 but skips spatial interlacing check
-</p></dd>
-</dl>
-
-<p>Default value is 0.
-</p>
-<p><var>parity</var> specifies the picture field parity assumed for the input
-interlaced video, accepts one of the following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>assume bottom field first
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>assume top field first
-</p></dd>
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>enable automatic detection
-</p></dd>
-</dl>
-
-<p>Default value is -1.
-If interlacing is unknown or decoder does not export this information,
-top field first will be assumed.
-</p>
-
-<a name="Video-Sources"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Video-Sources">23. Video Sources</a></h1>
-
-<p>Below is a description of the currently available video sources.
-</p>
-<a name="buffer"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-buffer">23.1 buffer</a></h2>
-
-<p>Buffer video frames, and make them available to the filter chain.
-</p>
-<p>This source is mainly intended for a programmatic use, in particular
-through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
-</p>
-<p>It accepts the following parameters:
-<var>width</var>:<var>height</var>:<var>pix_fmt_string</var>:<var>timebase_num</var>:<var>timebase_den</var>:<var>sample_aspect_ratio_num</var>:<var>sample_aspect_ratio.den</var>:<var>scale_params</var>
-</p>
-<p>All the parameters but <var>scale_params</var> need to be explicitely
-defined.
-</p>
-<p>Follows the list of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd><p>Specify the width and height of the buffered video frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>pix_fmt_string</samp>&rsquo;</dt>
-<dd><p>A string representing the pixel format of the buffered video frames.
-It may be a number corresponding to a pixel format, or a pixel format
-name.
-</p>
-</dd>
-<dt> &lsquo;<samp>timebase_num, timebase_den</samp>&rsquo;</dt>
-<dd><p>Specify numerator and denomitor of the timebase assumed by the
-timestamps of the buffered frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>&rsquo;</dt>
-<dd><p>Specify numerator and denominator of the sample aspect ratio assumed
-by the video frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>scale_params</samp>&rsquo;</dt>
-<dd><p>Specify the optional parameters to be used for the scale filter which
-is automatically inserted when an input change is detected in the
-input size or format.
-</p></dd>
-</dl>
-
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
-</pre></td></tr></table>
-
-<p>will instruct the source to accept video frames with size 320x240 and
-with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
-square pixels (1:1 sample aspect ratio).
-Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
-(check the enum PixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
-this example corresponds to:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:6:1:24:1:1
-</pre></td></tr></table>
-
-<a name="color"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-color">23.2 color</a></h2>
-
-<p>Provide an uniformly colored input.
-</p>
-<p>It accepts the following parameters:
-<var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
-</p>
-<p>Follows the description of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd><p>Specify the color of the source. It can be the name of a color (case
-insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
-alpha specifier. The default value is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
-<dd><p>Specify the size of the sourced video, it may be a string of the form
-<var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
-default value is &quot;320x240&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
-<dd><p>Specify the frame rate of the sourced video, as the number of frames
-generated per second. It has to be a string in the format
-<var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
-number or a valid video frame rate abbreviation. The default value is
-&quot;25&quot;.
-</p>
-</dd>
-</dl>
-
-<p>For example the following graph description will generate a red source
-with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
-frames per second, which will be overlayed over the source connected
-to the pad with identifier &quot;in&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">&quot;color=red@0.2:qcif:10 [color]; [in][color] overlay [out]&quot;
-</pre></td></tr></table>
-
-<a name="movie"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-movie">23.3 movie</a></h2>
-
-<p>Read a video stream from a movie container.
-</p>
-<p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
-<var>movie_name</var> is the name of the resource to read (not necessarily
-a file but also a device or a stream accessed through some protocol),
-and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
-pairs, separated by &quot;:&quot;.
-</p>
-<p>The description of the accepted options follows.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
-<dd><p>Specifies the format assumed for the movie to read, and can be either
-the name of a container or an input device. If not specified the
-format is guessed from <var>movie_name</var> or by probing.
-</p>
-</dd>
-<dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
-<dd><p>Specifies the seek point in seconds, the frames will be output
-starting from this seek point, the parameter is evaluated with
-<code>av_strtod</code> so the numerical value may be suffixed by an IS
-postfix. Default value is &quot;0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
-<dd><p>Specifies the index of the video stream to read. If the value is -1,
-the best suited video stream will be automatically selected. Default
-value is &quot;-1&quot;.
-</p>
-</dd>
-</dl>
-
-<p>This filter allows to overlay a second video on top of main input of
-a filtergraph as shown in this graph:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
-                                    ^
-                                    |
-movie --&gt; scale--&gt; deltapts1 -------+
-</pre></td></tr></table>
-
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
-# on top of the input labelled as &quot;in&quot;.
-movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-# read from a video4linux2 device, and overlay it on top of the input
-# labelled as &quot;in&quot;
-movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-</pre></td></tr></table>
-
-<a name="nullsrc"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-nullsrc">23.4 nullsrc</a></h2>
-
-<p>Null video source, never return images. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-</p>
-<p>It accepts as optional parameter a string of the form
-<var>width</var>:<var>height</var>:<var>timebase</var>.
-</p>
-<p><var>width</var> and <var>height</var> specify the size of the configured
-source. The default values of <var>width</var> and <var>height</var> are
-respectively 352 and 288 (corresponding to the CIF size format).
-</p>
-<p><var>timebase</var> specifies an arithmetic expression representing a
-timebase. The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;,
-&quot;AVTB&quot; (the default timebase), and defaults to the value &quot;AVTB&quot;.
-</p>
-<a name="frei0r_005fsrc"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-frei0r_005fsrc">23.5 frei0r_src</a></h2>
-
-<p>Provide a frei0r source.
-</p>
-<p>To enable compilation of this filter you need to install the frei0r
-header and configure FFmpeg with &ndash;enable-frei0r.
-</p>
-<p>The source supports the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
-</pre></td></tr></table>
-
-<p><var>size</var> is the size of the video to generate, may be a string of the
-form <var>width</var>x<var>height</var> or a frame size abbreviation.
-<var>rate</var> is the rate of the video to generate, may be a string of
-the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
-<var>src_name</var> is the name to the frei0r source to load. For more
-information regarding frei0r and how to set the parameters read the
-section &quot;frei0r&quot; (see <a href="#frei0r">frei0r</a>) in the description of the video
-filters.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
-# which is overlayed on the overlay filter main input
-frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
-</pre></td></tr></table>
-
-
-<a name="Video-Sinks"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Video-Sinks">24. Video Sinks</a></h1>
-
-<p>Below is a description of the currently available video sinks.
-</p>
-<a name="nullsink"></a>
-<h2 class="section"><a href="ffmpeg.html#toc-nullsink">24.1 nullsink</a></h2>
-
-<p>Null video sink, do absolutely nothing with the input video. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-</p>
-
-<a name="Metadata"></a>
-<h1 class="chapter"><a href="ffmpeg.html#toc-Metadata">25. Metadata</a></h1>
-
-<p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
-INI-like text file and then load it back using the metadata muxer/demuxer.
-</p>
-<p>The file format is as follows:
-</p><ol>
-<li>
-A file consists of a header and a number of metadata tags divided into sections,
-each on its own line.
-
-</li><li>
-The header is a &rsquo;;FFMETADATA&rsquo; string, followed by a version number (now 1).
-
-</li><li>
-Metadata tags are of the form &rsquo;key=value&rsquo;
-
-</li><li>
-Immediately after header follows global metadata
-
-</li><li>
-After global metadata there may be sections with per-stream/per-chapter
-metadata.
-
-</li><li>
-A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
-brackets (&rsquo;[&rsquo;, &rsquo;]&rsquo;) and ends with next section or end of file.
-
-</li><li>
-At the beginning of a chapter section there may be an optional timebase to be
-used for start/end values. It must be in form &rsquo;TIMEBASE=num/den&rsquo;, where num and
-den are integers. If the timebase is missing then start/end times are assumed to
-be in milliseconds.
-Next a chapter section must contain chapter start and end times in form
-&rsquo;START=num&rsquo;, &rsquo;END=num&rsquo;, where num is a positive integer.
-
-</li><li>
-Empty lines and lines starting with &rsquo;;&rsquo; or &rsquo;#&rsquo; are ignored.
-
-</li><li>
-Metadata keys or values containing special characters (&rsquo;=&rsquo;, &rsquo;;&rsquo;, &rsquo;#&rsquo;, &rsquo;\&rsquo; and a
-newline) must be escaped with a backslash &rsquo;\&rsquo;.
-
-</li><li>
-Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
-the tag (in the example above key is &rsquo;foo &rsquo;, value is &rsquo; bar&rsquo;).
-</li></ol>
-
-<p>A ffmetadata file might look like this:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">;FFMETADATA1
-title=bike\\shed
-;this is a comment
-artist=FFmpeg troll team
-
-[CHAPTER]
-TIMEBASE=1/1000
-START=0
-#chapter ends at 0:01:00
-END=60000
-title=chapter \#1
-[STREAM]
-title=multi\
-line
-</pre></td></tr></table>
-
-
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/doc/ffplay.html b/ffmpeg 0.7/doc/ffplay.html
deleted file mode 100644 (file)
index ffb9d00..0000000
+++ /dev/null
@@ -1,3933 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>ffplay Documentation</title>
-
-<meta name="description" content="ffplay Documentation">
-<meta name="keywords" content="ffplay Documentation">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">ffplay Documentation</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
-  <li><a name="toc-Description" href="#Description">2. Description</a></li>
-  <li><a name="toc-Options-2" href="#Options-2">3. Options</a>
-  <ul class="toc">
-    <li><a name="toc-Generic-options" href="#Generic-options">3.1 Generic options</a></li>
-    <li><a name="toc-Main-options" href="#Main-options">3.2 Main options</a></li>
-    <li><a name="toc-Advanced-options" href="#Advanced-options">3.3 Advanced options</a></li>
-    <li><a name="toc-While-playing" href="#While-playing">3.4 While playing</a></li>
-  </ul></li>
-  <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">4. Expression Evaluation</a></li>
-  <li><a name="toc-Decoders" href="#Decoders">5. Decoders</a></li>
-  <li><a name="toc-Video-Decoders" href="#Video-Decoders">6. Video Decoders</a>
-  <ul class="toc">
-    <li><a name="toc-rawvideo" href="#rawvideo">6.1 rawvideo</a>
-    <ul class="toc">
-      <li><a name="toc-Options-1" href="#Options-1">6.1.1 Options</a></li>
-    </ul>
-</li>
-  </ul></li>
-  <li><a name="toc-Demuxers" href="#Demuxers">7. Demuxers</a>
-  <ul class="toc">
-    <li><a name="toc-image2-1" href="#image2-1">7.1 image2</a></li>
-    <li><a name="toc-applehttp" href="#applehttp">7.2 applehttp</a></li>
-  </ul></li>
-  <li><a name="toc-Muxers" href="#Muxers">8. Muxers</a>
-  <ul class="toc">
-    <li><a name="toc-crc-1" href="#crc-1">8.1 crc</a></li>
-    <li><a name="toc-framecrc-1" href="#framecrc-1">8.2 framecrc</a></li>
-    <li><a name="toc-image2" href="#image2">8.3 image2</a></li>
-    <li><a name="toc-mpegts" href="#mpegts">8.4 mpegts</a></li>
-    <li><a name="toc-null" href="#null">8.5 null</a></li>
-    <li><a name="toc-matroska" href="#matroska">8.6 matroska</a></li>
-  </ul></li>
-  <li><a name="toc-Input-Devices" href="#Input-Devices">9. Input Devices</a>
-  <ul class="toc">
-    <li><a name="toc-alsa" href="#alsa">9.1 alsa</a></li>
-    <li><a name="toc-bktr" href="#bktr">9.2 bktr</a></li>
-    <li><a name="toc-dv1394" href="#dv1394">9.3 dv1394</a></li>
-    <li><a name="toc-fbdev" href="#fbdev">9.4 fbdev</a></li>
-    <li><a name="toc-jack" href="#jack">9.5 jack</a></li>
-    <li><a name="toc-libdc1394" href="#libdc1394">9.6 libdc1394</a></li>
-    <li><a name="toc-oss" href="#oss">9.7 oss</a></li>
-    <li><a name="toc-sndio" href="#sndio">9.8 sndio</a></li>
-    <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">9.9 video4linux and video4linux2</a></li>
-    <li><a name="toc-vfwcap" href="#vfwcap">9.10 vfwcap</a></li>
-    <li><a name="toc-x11grab" href="#x11grab">9.11 x11grab</a></li>
-  </ul></li>
-  <li><a name="toc-Output-Devices" href="#Output-Devices">10. Output Devices</a>
-  <ul class="toc">
-    <li><a name="toc-alsa-1" href="#alsa-1">10.1 alsa</a></li>
-    <li><a name="toc-oss-1" href="#oss-1">10.2 oss</a></li>
-    <li><a name="toc-sdl" href="#sdl">10.3 sdl</a>
-    <ul class="toc">
-      <li><a name="toc-Options" href="#Options">10.3.1 Options</a></li>
-      <li><a name="toc-Examples" href="#Examples">10.3.2 Examples</a></li>
-    </ul></li>
-    <li><a name="toc-sndio-1" href="#sndio-1">10.4 sndio</a></li>
-  </ul></li>
-  <li><a name="toc-Protocols" href="#Protocols">11. Protocols</a>
-  <ul class="toc">
-    <li><a name="toc-applehttp-1" href="#applehttp-1">11.1 applehttp</a></li>
-    <li><a name="toc-concat" href="#concat">11.2 concat</a></li>
-    <li><a name="toc-file" href="#file">11.3 file</a></li>
-    <li><a name="toc-gopher" href="#gopher">11.4 gopher</a></li>
-    <li><a name="toc-http" href="#http">11.5 http</a></li>
-    <li><a name="toc-mmst" href="#mmst">11.6 mmst</a></li>
-    <li><a name="toc-mmsh" href="#mmsh">11.7 mmsh</a></li>
-    <li><a name="toc-md5" href="#md5">11.8 md5</a></li>
-    <li><a name="toc-pipe" href="#pipe">11.9 pipe</a></li>
-    <li><a name="toc-rtmp" href="#rtmp">11.10 rtmp</a></li>
-    <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
-    <li><a name="toc-rtp" href="#rtp">11.12 rtp</a></li>
-    <li><a name="toc-rtsp" href="#rtsp">11.13 rtsp</a></li>
-    <li><a name="toc-sap" href="#sap">11.14 sap</a>
-    <ul class="toc">
-      <li><a name="toc-Muxer" href="#Muxer">11.14.1 Muxer</a></li>
-      <li><a name="toc-Demuxer" href="#Demuxer">11.14.2 Demuxer</a></li>
-    </ul></li>
-    <li><a name="toc-tcp" href="#tcp">11.15 tcp</a></li>
-    <li><a name="toc-udp" href="#udp">11.16 udp</a></li>
-  </ul></li>
-  <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">12. Filtergraph description</a>
-  <ul class="toc">
-    <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">12.1 Filtergraph syntax</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Filters" href="#Audio-Filters">13. Audio Filters</a>
-  <ul class="toc">
-    <li><a name="toc-anull" href="#anull">13.1 anull</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Sources" href="#Audio-Sources">14. Audio Sources</a>
-  <ul class="toc">
-    <li><a name="toc-anullsrc" href="#anullsrc">14.1 anullsrc</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">15. Audio Sinks</a>
-  <ul class="toc">
-    <li><a name="toc-anullsink" href="#anullsink">15.1 anullsink</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Filters" href="#Video-Filters">16. Video Filters</a>
-  <ul class="toc">
-    <li><a name="toc-blackframe" href="#blackframe">16.1 blackframe</a></li>
-    <li><a name="toc-copy" href="#copy">16.2 copy</a></li>
-    <li><a name="toc-crop" href="#crop">16.3 crop</a></li>
-    <li><a name="toc-cropdetect" href="#cropdetect">16.4 cropdetect</a></li>
-    <li><a name="toc-drawbox" href="#drawbox">16.5 drawbox</a></li>
-    <li><a name="toc-drawtext" href="#drawtext">16.6 drawtext</a></li>
-    <li><a name="toc-fade" href="#fade">16.7 fade</a></li>
-    <li><a name="toc-fieldorder" href="#fieldorder">16.8 fieldorder</a></li>
-    <li><a name="toc-fifo" href="#fifo">16.9 fifo</a></li>
-    <li><a name="toc-format" href="#format">16.10 format</a></li>
-    <li><a name="toc-frei0r-1" href="#frei0r-1">16.11 frei0r</a></li>
-    <li><a name="toc-gradfun" href="#gradfun">16.12 gradfun</a></li>
-    <li><a name="toc-hflip" href="#hflip">16.13 hflip</a></li>
-    <li><a name="toc-hqdn3d" href="#hqdn3d">16.14 hqdn3d</a></li>
-    <li><a name="toc-mp" href="#mp">16.15 mp</a></li>
-    <li><a name="toc-noformat" href="#noformat">16.16 noformat</a></li>
-    <li><a name="toc-null-1" href="#null-1">16.17 null</a></li>
-    <li><a name="toc-ocv" href="#ocv">16.18 ocv</a>
-    <ul class="toc">
-      <li><a name="toc-dilate-1" href="#dilate-1">16.18.1 dilate</a></li>
-      <li><a name="toc-erode" href="#erode">16.18.2 erode</a></li>
-      <li><a name="toc-smooth" href="#smooth">16.18.3 smooth</a></li>
-    </ul></li>
-    <li><a name="toc-overlay" href="#overlay">16.19 overlay</a></li>
-    <li><a name="toc-pad" href="#pad">16.20 pad</a></li>
-    <li><a name="toc-pixdesctest" href="#pixdesctest">16.21 pixdesctest</a></li>
-    <li><a name="toc-scale" href="#scale">16.22 scale</a></li>
-    <li><a name="toc-select" href="#select">16.23 select</a></li>
-    <li><a name="toc-setdar-1" href="#setdar-1">16.24 setdar</a></li>
-    <li><a name="toc-setpts" href="#setpts">16.25 setpts</a></li>
-    <li><a name="toc-setsar-1" href="#setsar-1">16.26 setsar</a></li>
-    <li><a name="toc-settb" href="#settb">16.27 settb</a></li>
-    <li><a name="toc-showinfo" href="#showinfo">16.28 showinfo</a></li>
-    <li><a name="toc-slicify" href="#slicify">16.29 slicify</a></li>
-    <li><a name="toc-split" href="#split">16.30 split</a></li>
-    <li><a name="toc-transpose" href="#transpose">16.31 transpose</a></li>
-    <li><a name="toc-unsharp" href="#unsharp">16.32 unsharp</a></li>
-    <li><a name="toc-vflip" href="#vflip">16.33 vflip</a></li>
-    <li><a name="toc-yadif" href="#yadif">16.34 yadif</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Sources" href="#Video-Sources">17. Video Sources</a>
-  <ul class="toc">
-    <li><a name="toc-buffer" href="#buffer">17.1 buffer</a></li>
-    <li><a name="toc-color" href="#color">17.2 color</a></li>
-    <li><a name="toc-movie" href="#movie">17.3 movie</a></li>
-    <li><a name="toc-nullsrc" href="#nullsrc">17.4 nullsrc</a></li>
-    <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">17.5 frei0r_src</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Sinks" href="#Video-Sinks">18. Video Sinks</a>
-  <ul class="toc">
-    <li><a name="toc-nullsink" href="#nullsink">18.1 nullsink</a></li>
-  </ul>
-</li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="Synopsis"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Synopsis">1. Synopsis</a></h1>
-
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay [options] [&lsquo;<tt>input_file</tt>&rsquo;]
-</pre></td></tr></table>
-
-<a name="Description"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Description">2. Description</a></h1>
-
-<p>FFplay is a very simple and portable media player using the FFmpeg
-libraries and the SDL library. It is mostly used as a testbed for the
-various FFmpeg APIs.
-</p>
-<a name="Options-2"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Options-2">3. Options</a></h1>
-
-<p>All the numerical options, if not specified otherwise, accept in input
-a string representing a number, which may contain one of the
-International System number postfixes, for example &rsquo;K&rsquo;, &rsquo;M&rsquo;, &rsquo;G&rsquo;.
-If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used instead of
-powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8, and can be
-appended after another postfix or used alone. This allows using for
-example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
-</p>
-<p>Options which do not take arguments are boolean options, and set the
-corresponding value to true. They can be set to false by prefixing
-with &quot;no&quot; the option name, for example using &quot;-nofoo&quot; in the
-commandline will set to false the boolean option with name &quot;foo&quot;.
-</p>
-<a name="Generic-options"></a>
-<h2 class="section"><a href="ffplay.html#toc-Generic-options">3.1 Generic options</a></h2>
-
-<p>These options are shared amongst the ff* tools.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
-<dd><p>Show license.
-</p>
-</dd>
-<dt> &lsquo;<samp>-h, -?, -help, --help</samp>&rsquo;</dt>
-<dd><p>Show help.
-</p>
-</dd>
-<dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
-<dd><p>Show version.
-</p>
-</dd>
-<dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
-<dd><p>Show available formats.
-</p>
-<p>The fields preceding the format names have the following meanings:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Decoding available
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Encoding available
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
-<dd><p>Show available codecs.
-</p>
-<p>The fields preceding the codec names have the following meanings:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Decoding available
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Encoding available
-</p></dd>
-<dt> &lsquo;<samp>V/A/S</samp>&rsquo;</dt>
-<dd><p>Video/audio/subtitle codec
-</p></dd>
-<dt> &lsquo;<samp>S</samp>&rsquo;</dt>
-<dd><p>Codec supports slices
-</p></dd>
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Codec supports direct rendering
-</p></dd>
-<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
-<dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
-<dd><p>Show available bitstream filters.
-</p>
-</dd>
-<dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
-<dd><p>Show available protocols.
-</p>
-</dd>
-<dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
-<dd><p>Show available libavfilter filters.
-</p>
-</dd>
-<dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
-<dd><p>Show available pixel formats.
-</p>
-</dd>
-<dt> &lsquo;<samp>-loglevel <var>loglevel</var></samp>&rsquo;</dt>
-<dd><p>Set the logging level used by the library.
-<var>loglevel</var> is a number or a string containing one of the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>error</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>info</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
-</dl>
-
-<p>By default the program logs to stderr, if coloring is supported by the
-terminal, colors are used to mark errors and warnings. Log coloring
-can be disabled setting the environment variable
-<code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
-the environment variable <code>FFMPEG_FORCE_COLOR</code>.
-The use of the environment variable <code>NO_COLOR</code> is deprecated and
-will be dropped in a following FFmpeg version.
-</p>
-</dd>
-</dl>
-
-<a name="Main-options"></a>
-<h2 class="section"><a href="ffplay.html#toc-Main-options">3.2 Main options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-x <var>width</var></samp>&rsquo;</dt>
-<dd><p>Force displayed width.
-</p></dd>
-<dt> &lsquo;<samp>-y <var>height</var></samp>&rsquo;</dt>
-<dd><p>Force displayed height.
-</p></dd>
-<dt> &lsquo;<samp>-s <var>size</var></samp>&rsquo;</dt>
-<dd><p>Set frame size (WxH or abbreviation), needed for videos which don&rsquo;t
-contain a header with the frame size like raw YUV.
-</p></dd>
-<dt> &lsquo;<samp>-an</samp>&rsquo;</dt>
-<dd><p>Disable audio.
-</p></dd>
-<dt> &lsquo;<samp>-vn</samp>&rsquo;</dt>
-<dd><p>Disable video.
-</p></dd>
-<dt> &lsquo;<samp>-ss <var>pos</var></samp>&rsquo;</dt>
-<dd><p>Seek to a given position in seconds.
-</p></dd>
-<dt> &lsquo;<samp>-t <var>duration</var></samp>&rsquo;</dt>
-<dd><p>play &lt;duration&gt; seconds of audio/video
-</p></dd>
-<dt> &lsquo;<samp>-bytes</samp>&rsquo;</dt>
-<dd><p>Seek by bytes.
-</p></dd>
-<dt> &lsquo;<samp>-nodisp</samp>&rsquo;</dt>
-<dd><p>Disable graphical display.
-</p></dd>
-<dt> &lsquo;<samp>-f <var>fmt</var></samp>&rsquo;</dt>
-<dd><p>Force format.
-</p></dd>
-<dt> &lsquo;<samp>-window_title <var>title</var></samp>&rsquo;</dt>
-<dd><p>Set window title (default is the input filename).
-</p></dd>
-<dt> &lsquo;<samp>-loop <var>number</var></samp>&rsquo;</dt>
-<dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
-</p></dd>
-<dt> &lsquo;<samp>-showmode <var>mode</var></samp>&rsquo;</dt>
-<dd><p>Set the show mode to use.
-Available values for <var>mode</var> are:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>0, video</samp>&rsquo;</dt>
-<dd><p>show video
-</p></dd>
-<dt> &lsquo;<samp>1, waves</samp>&rsquo;</dt>
-<dd><p>show audio waves
-</p></dd>
-<dt> &lsquo;<samp>2, rdft</samp>&rsquo;</dt>
-<dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
-</p></dd>
-</dl>
-
-<p>Default value is &quot;video&quot;, if video is not present or cannot be played
-&quot;rdft&quot; is automatically selected.
-</p>
-<p>You can interactively cycle through the available show modes by
-pressing the key &lt;w&gt;.
-</p>
-</dd>
-<dt> &lsquo;<samp>-vf <var>filter_graph</var></samp>&rsquo;</dt>
-<dd><p><var>filter_graph</var> is a description of the filter graph to apply to
-the input video.
-Use the option &quot;-filters&quot; to show all the available filters (including
-also sources and sinks).
-</p>
-</dd>
-<dt> &lsquo;<samp>-i <var>input_file</var></samp>&rsquo;</dt>
-<dd><p>Read <var>input_file</var>.
-</p></dd>
-</dl>
-
-<a name="Advanced-options"></a>
-<h2 class="section"><a href="ffplay.html#toc-Advanced-options">3.3 Advanced options</a></h2>
-<dl compact="compact">
-<dt> &lsquo;<samp>-pix_fmt <var>format</var></samp>&rsquo;</dt>
-<dd><p>Set pixel format.
-</p></dd>
-<dt> &lsquo;<samp>-stats</samp>&rsquo;</dt>
-<dd><p>Show the stream duration, the codec parameters, the current position in
-the stream and the audio/video synchronisation drift.
-</p></dd>
-<dt> &lsquo;<samp>-bug</samp>&rsquo;</dt>
-<dd><p>Work around bugs.
-</p></dd>
-<dt> &lsquo;<samp>-fast</samp>&rsquo;</dt>
-<dd><p>Non-spec-compliant optimizations.
-</p></dd>
-<dt> &lsquo;<samp>-genpts</samp>&rsquo;</dt>
-<dd><p>Generate pts.
-</p></dd>
-<dt> &lsquo;<samp>-rtp_tcp</samp>&rsquo;</dt>
-<dd><p>Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
-if you are streaming with the RTSP protocol.
-</p></dd>
-<dt> &lsquo;<samp>-sync <var>type</var></samp>&rsquo;</dt>
-<dd><p>Set the master clock to audio (<code>type=audio</code>), video
-(<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
-master clock is used to control audio-video synchronization. Most media
-players use audio as master clock, but in some cases (streaming or high
-quality broadcast) it is necessary to change that. This option is mainly
-used for debugging purposes.
-</p></dd>
-<dt> &lsquo;<samp>-threads <var>count</var></samp>&rsquo;</dt>
-<dd><p>Set the thread count.
-</p></dd>
-<dt> &lsquo;<samp>-ast <var>audio_stream_number</var></samp>&rsquo;</dt>
-<dd><p>Select the desired audio stream number, counting from 0. The number
-refers to the list of all the input audio streams. If it is greater
-than the number of audio streams minus one, then the last one is
-selected, if it is negative the audio playback is disabled.
-</p></dd>
-<dt> &lsquo;<samp>-vst <var>video_stream_number</var></samp>&rsquo;</dt>
-<dd><p>Select the desired video stream number, counting from 0. The number
-refers to the list of all the input video streams. If it is greater
-than the number of video streams minus one, then the last one is
-selected, if it is negative the video playback is disabled.
-</p></dd>
-<dt> &lsquo;<samp>-sst <var>subtitle_stream_number</var></samp>&rsquo;</dt>
-<dd><p>Select the desired subtitle stream number, counting from 0. The number
-refers to the list of all the input subtitle streams. If it is greater
-than the number of subtitle streams minus one, then the last one is
-selected, if it is negative the subtitle rendering is disabled.
-</p></dd>
-<dt> &lsquo;<samp>-autoexit</samp>&rsquo;</dt>
-<dd><p>Exit when video is done playing.
-</p></dd>
-<dt> &lsquo;<samp>-exitonkeydown</samp>&rsquo;</dt>
-<dd><p>Exit if any key is pressed.
-</p></dd>
-<dt> &lsquo;<samp>-exitonmousedown</samp>&rsquo;</dt>
-<dd><p>Exit if any mouse button is pressed.
-</p></dd>
-</dl>
-
-<a name="While-playing"></a>
-<h2 class="section"><a href="ffplay.html#toc-While-playing">3.4 While playing</a></h2>
-
-<dl compact="compact">
-<dt> &lt;q, ESC&gt;</dt>
-<dd><p>Quit.
-</p>
-</dd>
-<dt> &lt;f&gt;</dt>
-<dd><p>Toggle full screen.
-</p>
-</dd>
-<dt> &lt;p, SPC&gt;</dt>
-<dd><p>Pause.
-</p>
-</dd>
-<dt> &lt;a&gt;</dt>
-<dd><p>Cycle audio channel.
-</p>
-</dd>
-<dt> &lt;v&gt;</dt>
-<dd><p>Cycle video channel.
-</p>
-</dd>
-<dt> &lt;t&gt;</dt>
-<dd><p>Cycle subtitle channel.
-</p>
-</dd>
-<dt> &lt;w&gt;</dt>
-<dd><p>Show audio waves.
-</p>
-</dd>
-<dt> &lt;left/right&gt;</dt>
-<dd><p>Seek backward/forward 10 seconds.
-</p>
-</dd>
-<dt> &lt;down/up&gt;</dt>
-<dd><p>Seek backward/forward 1 minute.
-</p>
-</dd>
-<dt> &lt;mouse click&gt;</dt>
-<dd><p>Seek to percentage in file corresponding to fraction of width.
-</p>
-</dd>
-</dl>
-
-
-<a name="Expression-Evaluation"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Expression-Evaluation">4. Expression Evaluation</a></h1>
-
-<p>When evaluating an arithemetic expression, FFmpeg uses an internal
-formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
-interface.
-</p>
-<p>An expression may contain unary, binary operators, constants, and
-functions.
-</p>
-<p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
-another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
-<var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
-expression evaluates to the value of <var>expr2</var>.
-</p>
-<p>The following binary operators are available: <code>+</code>, <code>-</code>,
-<code>*</code>, <code>/</code>, <code>^</code>.
-</p>
-<p>The following unary operators are available: <code>+</code>, <code>-</code>.
-</p>
-<p>The following functions are available:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>sin(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>cos(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>tan(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>atan(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>asin(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>acos(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>exp(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>log(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>abs(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>squish(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
-<dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
-</p>
-</dd>
-<dt> &lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
-<dd><p>Allow to store the value of the expression <var>expr</var> in an internal
-variable. <var>var</var> specifies the number of the variable where to
-store the value, and it is a value ranging from 0 to 9. The function
-returns the value stored in the internal variable.
-</p>
-</dd>
-<dt> &lsquo;<samp>ld(var)</samp>&rsquo;</dt>
-<dd><p>Allow to load the value of the internal variable with number
-<var>var</var>, which was previosly stored with st(<var>var</var>, <var>expr</var>).
-The function returns the loaded value.
-</p>
-</dd>
-<dt> &lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
-<dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
-non-zero, and returns the value of the last <var>expr</var> evaluation, or
-NAN if <var>cond</var> was always false.
-</p>
-</dd>
-<dt> &lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
-<dd><p>Round the value of expression <var>expr</var> upwards to the nearest
-integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
-<dd><p>Round the value of expression <var>expr</var> downwards to the nearest
-integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
-<dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
-integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
-<dd><p>Compute the square root of <var>expr</var>. This is equivalent to
-&quot;(<var>expr</var>)^.5&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>not(expr)</samp>&rsquo;</dt>
-<dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
-</p>
-</dd>
-<dt> &lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
-<dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
-&quot;(<var>x</var>)^(<var>y</var>)&quot;.
-</p></dd>
-</dl>
-
-<p>Note that:
-</p>
-<p><code>*</code> works like AND
-</p>
-<p><code>+</code> works like OR
-</p>
-<p>thus
-</p><table><tr><td>&nbsp;</td><td><pre class="example">if A then B else C
-</pre></td></tr></table>
-<p>is equivalent to
-</p><table><tr><td>&nbsp;</td><td><pre class="example">A*B + not(A)*C
-</pre></td></tr></table>
-
-<p>In your C code, you can extend the list of unary and binary functions,
-and define recognized constants, so that they are available for your
-expressions.
-</p>
-<p>The evaluator also recognizes the International System number
-postfixes. If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used
-instead of powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8,
-and can be appended after another postfix or used alone. This allows
-using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
-</p>
-<p>Follows the list of available International System postfixes, with
-indication of the corresponding powers of 10 and of 2.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>y</samp>&rsquo;</dt>
-<dd><p>-24 / -80
-</p></dd>
-<dt> &lsquo;<samp>z</samp>&rsquo;</dt>
-<dd><p>-21 / -70
-</p></dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>-18 / -60
-</p></dd>
-<dt> &lsquo;<samp>f</samp>&rsquo;</dt>
-<dd><p>-15 / -50
-</p></dd>
-<dt> &lsquo;<samp>p</samp>&rsquo;</dt>
-<dd><p>-12 / -40
-</p></dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>-9 / -30
-</p></dd>
-<dt> &lsquo;<samp>u</samp>&rsquo;</dt>
-<dd><p>-6 / -20
-</p></dd>
-<dt> &lsquo;<samp>m</samp>&rsquo;</dt>
-<dd><p>-3 / -10
-</p></dd>
-<dt> &lsquo;<samp>c</samp>&rsquo;</dt>
-<dd><p>-2
-</p></dd>
-<dt> &lsquo;<samp>d</samp>&rsquo;</dt>
-<dd><p>-1
-</p></dd>
-<dt> &lsquo;<samp>h</samp>&rsquo;</dt>
-<dd><p>2
-</p></dd>
-<dt> &lsquo;<samp>k</samp>&rsquo;</dt>
-<dd><p>3 / 10
-</p></dd>
-<dt> &lsquo;<samp>K</samp>&rsquo;</dt>
-<dd><p>3 / 10
-</p></dd>
-<dt> &lsquo;<samp>M</samp>&rsquo;</dt>
-<dd><p>6 / 20
-</p></dd>
-<dt> &lsquo;<samp>G</samp>&rsquo;</dt>
-<dd><p>9 / 30
-</p></dd>
-<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
-<dd><p>12 / 40
-</p></dd>
-<dt> &lsquo;<samp>P</samp>&rsquo;</dt>
-<dd><p>15 / 40
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>18 / 50
-</p></dd>
-<dt> &lsquo;<samp>Z</samp>&rsquo;</dt>
-<dd><p>21 / 60
-</p></dd>
-<dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
-<dd><p>24 / 70
-</p></dd>
-</dl>
-
-<a name="Decoders"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Decoders">5. Decoders</a></h1>
-
-<p>Decoders are configured elements in FFmpeg which allow the decoding of
-multimedia streams.
-</p>
-<p>When you configure your FFmpeg build, all the supported native decoders
-are enabled by default. Decoders requiring an external library must be enabled
-manually via the corresponding <code>--enable-lib</code> option. You can list all
-available decoders using the configure option <code>--list-decoders</code>.
-</p>
-<p>You can disable all the decoders with the configure option
-<code>--disable-decoders</code> and selectively enable / disable single decoders
-with the options <code>--enable-decoder=<var>DECODER</var></code> /
-<code>--disable-decoder=<var>DECODER</var></code>.
-</p>
-<p>The option <code>-codecs</code> of the ff* tools will display the list of
-enabled decoders.
-</p>
-
-<a name="Video-Decoders"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Video-Decoders">6. Video Decoders</a></h1>
-
-<p>A description of some of the currently available video decoders
-follows.
-</p>
-<a name="rawvideo"></a>
-<h2 class="section"><a href="ffplay.html#toc-rawvideo">6.1 rawvideo</a></h2>
-
-<p>Rawvideo decoder.
-</p>
-<p>This decoder decodes rawvideo streams.
-</p>
-<a name="Options-1"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-Options-1">6.1.1 Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
-<dd><p>Specify the assumed field type of the input video.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>the video is assumed to be progressive (default)
-</p></dd>
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>bottom-field-first is assumed
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>top-field-first is assumed
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Demuxers"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Demuxers">7. Demuxers</a></h1>
-
-<p>Demuxers are configured elements in FFmpeg which allow to read the
-multimedia streams from a particular type of file.
-</p>
-<p>When you configure your FFmpeg build, all the supported demuxers
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-demuxers&quot;.
-</p>
-<p>You can disable all the demuxers using the configure option
-&quot;&ndash;disable-demuxers&quot;, and selectively enable a single demuxer with
-the option &quot;&ndash;enable-demuxer=<var>DEMUXER</var>&quot;, or disable it
-with the option &quot;&ndash;disable-demuxer=<var>DEMUXER</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-enabled demuxers.
-</p>
-<p>The description of some of the currently available demuxers follows.
-</p>
-<a name="image2-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-image2-1">7.1 image2</a></h2>
-
-<p>Image file demuxer.
-</p>
-<p>This demuxer reads from a list of image files specified by a pattern.
-</p>
-<p>The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
-specifies the position of the characters representing a sequential
-number in each filename matched by the pattern. If the form
-&quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
-filename is 0-padded and <var>N</var> is the total number of 0-padded
-digits representing the number. The literal character &rsquo;%&rsquo; can be
-specified in the pattern with the string &quot;%%&quot;.
-</p>
-<p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
-the file list specified by the pattern must contain a number
-inclusively contained between 0 and 4, all the following numbers must
-be sequential. This limitation may be hopefully fixed.
-</p>
-<p>The pattern may contain a suffix which is used to automatically
-determine the format of the images contained in the files.
-</p>
-<p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
-filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
-&lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
-sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
-&lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
-</p>
-<p>The size, the pixel format, and the format of each image must be the
-same for all the files in the sequence.
-</p>
-<p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
-video from the images in the file sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;,
-&lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an input framerate of 10 frames per
-second:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
-</pre></td></tr></table>
-
-<p>Note that the pattern must not necessarily contain &quot;%d&quot; or
-&quot;%0<var>N</var>d&quot;, for example to convert a single image file
-&lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
-</pre></td></tr></table>
-
-<a name="applehttp"></a>
-<h2 class="section"><a href="ffplay.html#toc-applehttp">7.2 applehttp</a></h2>
-
-<p>Apple HTTP Live Streaming demuxer.
-</p>
-<p>This demuxer presents all AVStreams from all variant streams.
-The id field is set to the bitrate variant index number. By setting
-the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
-the caller can decide which variant streams to actually receive.
-The total bitrate of the variant that the stream belongs to is
-available in a metadata key named &quot;variant_bitrate&quot;.
-</p>
-<a name="Muxers"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Muxers">8. Muxers</a></h1>
-
-<p>Muxers are configured elements in FFmpeg which allow writing
-multimedia streams to a particular type of file.
-</p>
-<p>When you configure your FFmpeg build, all the supported muxers
-are enabled by default. You can list all available muxers using the
-configure option <code>--list-muxers</code>.
-</p>
-<p>You can disable all the muxers with the configure option
-<code>--disable-muxers</code> and selectively enable / disable single muxers
-with the options <code>--enable-muxer=<var>MUXER</var></code> /
-<code>--disable-muxer=<var>MUXER</var></code>.
-</p>
-<p>The option <code>-formats</code> of the ff* tools will display the list of
-enabled muxers.
-</p>
-<p>A description of some of the currently available muxers follows.
-</p>
-<p><a name="crc"></a>
-</p><a name="crc-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-crc-1">8.1 crc</a></h2>
-
-<p>CRC (Cyclic Redundancy Check) testing format.
-</p>
-<p>This muxer computes and prints the Adler-32 CRC of all the input audio
-and video frames. By default audio frames are converted to signed
-16-bit raw audio and video frames to raw video before computing the
-CRC.
-</p>
-<p>The output of the muxer consists of a single line of the form:
-CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
-8 digits containing the CRC for all the decoded input frames.
-</p>
-<p>For example to compute the CRC of the input, and store it in the file
-&lsquo;<tt>out.crc</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
-</pre></td></tr></table>
-
-<p>You can print the CRC to stdout with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc -
-</pre></td></tr></table>
-
-<p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
-specifying the audio and video codec and format. For example to
-compute the CRC of the input audio converted to PCM unsigned 8-bit
-and the input video converted to MPEG-2 video, use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
-</pre></td></tr></table>
-
-<p>See also the <code>framecrc</code> muxer (see <a href="#framecrc">framecrc</a>).
-</p>
-<p><a name="framecrc"></a>
-</p><a name="framecrc-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-framecrc-1">8.2 framecrc</a></h2>
-
-<p>Per-frame CRC (Cyclic Redundancy Check) testing format.
-</p>
-<p>This muxer computes and prints the Adler-32 CRC for each decoded audio
-and video frame. By default audio frames are converted to signed
-16-bit raw audio and video frames to raw video before computing the
-CRC.
-</p>
-<p>The output of the muxer consists of a line for each audio and video
-frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
-<var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
-number 0-padded to 8 digits containing the CRC of the decoded frame.
-</p>
-<p>For example to compute the CRC of each decoded frame in the input, and
-store it in the file &lsquo;<tt>out.crc</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
-</pre></td></tr></table>
-
-<p>You can print the CRC of each decoded frame to stdout with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
-</pre></td></tr></table>
-
-<p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
-specifying the audio and video codec and format. For example, to
-compute the CRC of each decoded input audio frame converted to PCM
-unsigned 8-bit and of each decoded input video frame converted to
-MPEG-2 video, use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
-</pre></td></tr></table>
-
-<p>See also the <code>crc</code> muxer (see <a href="#crc">crc</a>).
-</p>
-<a name="image2"></a>
-<h2 class="section"><a href="ffplay.html#toc-image2">8.3 image2</a></h2>
-
-<p>Image file muxer.
-</p>
-<p>The image file muxer writes video frames to image files.
-</p>
-<p>The output filenames are specified by a pattern, which can be used to
-produce sequentially numbered series of files.
-The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
-specifies the position of the characters representing a numbering in
-the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
-representing the number in each filename is 0-padded to <var>N</var>
-digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
-the string &quot;%%&quot;.
-</p>
-<p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
-the file list specified will contain the number 1, all the following
-numbers will be sequential.
-</p>
-<p>The pattern may contain a suffix which is used to automatically
-determine the format of the image files to write.
-</p>
-<p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
-filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
-&lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
-The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
-form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
-etc.
-</p>
-<p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
-sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
-taking one image every second from the input video:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
-</pre></td></tr></table>
-
-<p>Note that with &lsquo;<tt>ffmpeg</tt>&rsquo;, if the format is not specified with the
-<code>-f</code> option and the output filename specifies an image file
-format, the image2 muxer is automatically selected, so the previous
-command can be written as:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
-</pre></td></tr></table>
-
-<p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
-&quot;%0<var>N</var>d&quot;, for example to create a single image file
-&lsquo;<tt>img.jpeg</tt>&rsquo; from the input video you can employ the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
-</pre></td></tr></table>
-
-<p>The image muxer supports the .Y.U.V image file format. This format is
-special in that that each image frame consists of three files, for
-each of the YUV420P components. To read or write this image file format,
-specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
-&rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
-</p>
-<a name="mpegts"></a>
-<h2 class="section"><a href="ffplay.html#toc-mpegts">8.4 mpegts</a></h2>
-
-<p>MPEG transport stream muxer.
-</p>
-<p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
-</p>
-<p>The muxer options are:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-mpegts_original_network_id <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the original_network_id (default 0x0001). This is unique identifier
-of a network in DVB. Its main use is in the unique identification of a
-service through the path Original_Network_ID, Transport_Stream_ID.
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_transport_stream_id <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the transport_stream_id (default 0x0001). This identifies a
-transponder in DVB.
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_service_id <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the service_id (default 0x0001) also known as program in DVB.
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_pmt_start_pid <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
-</p></dd>
-<dt> &lsquo;<samp>-mpegts_start_pid <var>number</var></samp>&rsquo;</dt>
-<dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
-</p></dd>
-</dl>
-
-<p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
-and <code>service_name</code>. If they are not set the default for
-<code>service_provider</code> is &quot;FFmpeg&quot; and the default for
-<code>service_name</code> is &quot;Service01&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
-     -mpegts_original_network_id 0x1122 \
-     -mpegts_transport_stream_id 0x3344 \
-     -mpegts_service_id 0x5566 \
-     -mpegts_pmt_start_pid 0x1500 \
-     -mpegts_start_pid 0x150 \
-     -metadata service_provider=&quot;Some provider&quot; \
-     -metadata service_name=&quot;Some Channel&quot; \
-     -y out.ts
-</pre></td></tr></table>
-
-<a name="null"></a>
-<h2 class="section"><a href="ffplay.html#toc-null">8.5 null</a></h2>
-
-<p>Null muxer.
-</p>
-<p>This muxer does not generate any output file, it is mainly useful for
-testing or benchmarking purposes.
-</p>
-<p>For example to benchmark decoding with &lsquo;<tt>ffmpeg</tt>&rsquo; you can use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
-</pre></td></tr></table>
-
-<p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
-file, but specifying the output file is required by the &lsquo;<tt>ffmpeg</tt>&rsquo;
-syntax.
-</p>
-<p>Alternatively you can write the command as:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
-</pre></td></tr></table>
-
-<a name="matroska"></a>
-<h2 class="section"><a href="ffplay.html#toc-matroska">8.6 matroska</a></h2>
-
-<p>Matroska container muxer.
-</p>
-<p>This muxer implements the matroska and webm container specs.
-</p>
-<p>The recognized metadata settings in this muxer are:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>title=<var>title name</var></samp>&rsquo;</dt>
-<dd><p>Name provided to a single track
-</p></dd>
-</dl>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>language=<var>language name</var></samp>&rsquo;</dt>
-<dd><p>Specifies the language of the track in the Matroska languages form
-</p></dd>
-</dl>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>stereo_mode=<var>mode</var></samp>&rsquo;</dt>
-<dd><p>Stereo 3D video layout of two views in a single video track
-</p><dl compact="compact">
-<dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
-<dd><p>video is not stereo
-</p></dd>
-<dt> &lsquo;<samp>left_right</samp>&rsquo;</dt>
-<dd><p>Both views are arranged side by side, Left-eye view is on the left
-</p></dd>
-<dt> &lsquo;<samp>bottom_top</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
-</p></dd>
-<dt> &lsquo;<samp>top_bottom</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
-</p></dd>
-<dt> &lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
-<dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
-</p></dd>
-<dt> &lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
-<dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
-</p></dd>
-<dt> &lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
-<dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
-</p></dd>
-<dt> &lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
-<dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
-</p></dd>
-<dt> &lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
-</p></dd>
-<dt> &lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
-<dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
-</p></dd>
-<dt> &lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
-<dd><p>All frames are in anaglyph format viewable through red-cyan filters
-</p></dd>
-<dt> &lsquo;<samp>right_left</samp>&rsquo;</dt>
-<dd><p>Both views are arranged side by side, Right-eye view is on the left
-</p></dd>
-<dt> &lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
-<dd><p>All frames are in anaglyph format viewable through green-magenta filters
-</p></dd>
-<dt> &lsquo;<samp>block_lr</samp>&rsquo;</dt>
-<dd><p>Both eyes laced in one Block, Left-eye view is first
-</p></dd>
-<dt> &lsquo;<samp>block_rl</samp>&rsquo;</dt>
-<dd><p>Both eyes laced in one Block, Right-eye view is first
-</p></dd>
-</dl>
-</dd>
-</dl>
-
-<p>For example a 3D WebM clip can be created using the following command line:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
-</pre></td></tr></table>
-
-<a name="Input-Devices"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Input-Devices">9. Input Devices</a></h1>
-
-<p>Input devices are configured elements in FFmpeg which allow to access
-the data coming from a multimedia device attached to your system.
-</p>
-<p>When you configure your FFmpeg build, all the supported input devices
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-indevs&quot;.
-</p>
-<p>You can disable all the input devices using the configure option
-&quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
-option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
-input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-supported input devices (amongst the demuxers).
-</p>
-<p>A description of the currently available input devices follows.
-</p>
-<a name="alsa"></a>
-<h2 class="section"><a href="ffplay.html#toc-alsa">9.1 alsa</a></h2>
-
-<p>ALSA (Advanced Linux Sound Architecture) input device.
-</p>
-<p>To enable this input device during configuration you need libasound
-installed on your system.
-</p>
-<p>This device allows capturing from an ALSA device. The name of the
-device to capture has to be an ALSA card identifier.
-</p>
-<p>An ALSA identifier has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
-</pre></td></tr></table>
-
-<p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
-</p>
-<p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
-specify card number or identifier, device number and subdevice number
-(-1 means any).
-</p>
-<p>To see the list of cards currently recognized by your system check the
-files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
-</p>
-<p>For example to capture with &lsquo;<tt>ffmpeg</tt>&rsquo; from an ALSA device with
-card id 0, you may run the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
-</pre></td></tr></table>
-
-<p>For more information see:
-<a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
-</p>
-<a name="bktr"></a>
-<h2 class="section"><a href="ffplay.html#toc-bktr">9.2 bktr</a></h2>
-
-<p>BSD video input device.
-</p>
-<a name="dv1394"></a>
-<h2 class="section"><a href="ffplay.html#toc-dv1394">9.3 dv1394</a></h2>
-
-<p>Linux DV 1394 input device.
-</p>
-<a name="fbdev"></a>
-<h2 class="section"><a href="ffplay.html#toc-fbdev">9.4 fbdev</a></h2>
-
-<p>Linux framebuffer input device.
-</p>
-<p>The Linux framebuffer is a graphic hardware-independent abstraction
-layer to show graphics on a computer monitor, typically on the
-console. It is accessed through a file device node, usually
-&lsquo;<tt>/dev/fb0</tt>&rsquo;.
-</p>
-<p>For more detailed information read the file
-Documentation/fb/framebuffer.txt included in the Linux source tree.
-</p>
-<p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
-</pre></td></tr></table>
-
-<p>You can take a single screenshot image with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
-</pre></td></tr></table>
-
-<p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
-</p>
-<a name="jack"></a>
-<h2 class="section"><a href="ffplay.html#toc-jack">9.5 jack</a></h2>
-
-<p>JACK input device.
-</p>
-<p>To enable this input device during configuration you need libjack
-installed on your system.
-</p>
-<p>A JACK input device creates one or more JACK writable clients, one for
-each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
-<var>client_name</var> is the name provided by the application, and <var>N</var>
-is a number which identifies the channel.
-Each writable client will send the acquired data to the FFmpeg input
-device.
-</p>
-<p>Once you have created one or more JACK readable clients, you need to
-connect them to one or more JACK writable clients.
-</p>
-<p>To connect or disconnect JACK clients you can use the
-&lsquo;<tt>jack_connect</tt>&rsquo; and &lsquo;<tt>jack_disconnect</tt>&rsquo; programs, or do it
-through a graphical interface, for example with &lsquo;<tt>qjackctl</tt>&rsquo;.
-</p>
-<p>To list the JACK clients and their properties you can invoke the command
-&lsquo;<tt>jack_lsp</tt>&rsquo;.
-</p>
-<p>Follows an example which shows how to capture a JACK readable client
-with &lsquo;<tt>ffmpeg</tt>&rsquo;.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
-$ ffmpeg -f jack -i ffmpeg -y out.wav
-
-# Start the sample jack_metro readable client.
-$ jack_metro -b 120 -d 0.2 -f 4000
-
-# List the current JACK clients.
-$ jack_lsp -c
-system:capture_1
-system:capture_2
-system:playback_1
-system:playback_2
-ffmpeg:input_1
-metro:120_bpm
-
-# Connect metro to the ffmpeg writable client.
-$ jack_connect metro:120_bpm ffmpeg:input_1
-</pre></td></tr></table>
-
-<p>For more information read:
-<a href="http://jackaudio.org/">http://jackaudio.org/</a>
-</p>
-<a name="libdc1394"></a>
-<h2 class="section"><a href="ffplay.html#toc-libdc1394">9.6 libdc1394</a></h2>
-
-<p>IIDC1394 input device, based on libdc1394 and libraw1394.
-</p>
-<a name="oss"></a>
-<h2 class="section"><a href="ffplay.html#toc-oss">9.7 oss</a></h2>
-
-<p>Open Sound System input device.
-</p>
-<p>The filename to provide to the input device is the device node
-representing the OSS input device, and is usually set to
-&lsquo;<tt>/dev/dsp</tt>&rsquo;.
-</p>
-<p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
-</pre></td></tr></table>
-
-<p>For more information about OSS see:
-<a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
-</p>
-<a name="sndio"></a>
-<h2 class="section"><a href="ffplay.html#toc-sndio">9.8 sndio</a></h2>
-
-<p>sndio input device.
-</p>
-<p>To enable this input device during configuration you need libsndio
-installed on your system.
-</p>
-<p>The filename to provide to the input device is the device node
-representing the sndio input device, and is usually set to
-&lsquo;<tt>/dev/audio0</tt>&rsquo;.
-</p>
-<p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
-</pre></td></tr></table>
-
-<a name="video4linux-and-video4linux2"></a>
-<h2 class="section"><a href="ffplay.html#toc-video4linux-and-video4linux2">9.9 video4linux and video4linux2</a></h2>
-
-<p>Video4Linux and Video4Linux2 input video devices.
-</p>
-<p>The name of the device to grab is a file device node, usually Linux
-systems tend to automatically create such nodes when the device
-(e.g. an USB webcam) is plugged into the system, and has a name of the
-kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
-the device.
-</p>
-<p>Video4Linux and Video4Linux2 devices only support a limited set of
-<var>width</var>x<var>height</var> sizes and framerates. You can check which are
-supported for example with the command &lsquo;<tt>dov4l</tt>&rsquo; for Video4Linux
-devices and the command &lsquo;<tt>v4l-info</tt>&rsquo; for Video4Linux2 devices.
-</p>
-<p>If the size for the device is set to 0x0, the input device will
-try to autodetect the size to use.
-Only for the video4linux2 device, if the frame rate is set to 0/0 the
-input device will use the frame rate value already set in the driver.
-</p>
-<p>Video4Linux support is deprecated since Linux 2.6.30, and will be
-dropped in later versions.
-</p>
-<p>Follow some usage examples of the video4linux devices with the ff*
-tools.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
-# to the default of 25/1.
-ffplay -s 320x240 -f video4linux /dev/video0
-
-# Grab and show the input of a video4linux2 device, autoadjust size.
-ffplay -f video4linux2 /dev/video0
-
-# Grab and record the input of a video4linux2 device, autoadjust size,
-# frame rate value defaults to 0/0 so it is read from the video4linux2
-# driver.
-ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
-</pre></td></tr></table>
-
-<a name="vfwcap"></a>
-<h2 class="section"><a href="ffplay.html#toc-vfwcap">9.10 vfwcap</a></h2>
-
-<p>VfW (Video for Windows) capture input device.
-</p>
-<p>The filename passed as input is the capture driver number, ranging from
-0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
-other filename will be interpreted as device number 0.
-</p>
-<a name="x11grab"></a>
-<h2 class="section"><a href="ffplay.html#toc-x11grab">9.11 x11grab</a></h2>
-
-<p>X11 video input device.
-</p>
-<p>This device allows to capture a region of an X11 display.
-</p>
-<p>The filename passed as input has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
-</pre></td></tr></table>
-
-<p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
-X11 display name of the screen to grab from. <var>hostname</var> can be
-ommitted, and defaults to &quot;localhost&quot;. The environment variable
-<code>DISPLAY</code> contains the default display name.
-</p>
-<p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
-area with respect to the top-left border of the X11 screen. They
-default to 0.
-</p>
-<p>Check the X11 documentation (e.g. man X) for more detailed information.
-</p>
-<p>Use the &lsquo;<tt>dpyinfo</tt>&rsquo; program for getting basic information about the
-properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
-</p>
-<p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
-
-# Grab at position 10,20.
-ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
-</pre></td></tr></table>
-
-<a name="Output-Devices"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Output-Devices">10. Output Devices</a></h1>
-
-<p>Output devices are configured elements in FFmpeg which allow to write
-multimedia data to an output device attached to your system.
-</p>
-<p>When you configure your FFmpeg build, all the supported output devices
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-outdevs&quot;.
-</p>
-<p>You can disable all the output devices using the configure option
-&quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
-option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
-input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-enabled output devices (amongst the muxers).
-</p>
-<p>A description of the currently available output devices follows.
-</p>
-<a name="alsa-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-alsa-1">10.1 alsa</a></h2>
-
-<p>ALSA (Advanced Linux Sound Architecture) output device.
-</p>
-<a name="oss-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-oss-1">10.2 oss</a></h2>
-
-<p>OSS (Open Sound System) output device.
-</p>
-<a name="sdl"></a>
-<h2 class="section"><a href="ffplay.html#toc-sdl">10.3 sdl</a></h2>
-
-<p>SDL (Simple Directmedia Layer) output device.
-</p>
-<p>This output devices allows to show a video stream in an SDL
-window. Only one SDL window is allowed per application, so you can
-have only one instance of this output device in an application.
-</p>
-<p>To enable this output device you need libsdl installed on your system
-when configuring your build.
-</p>
-<p>For more information about SDL, check:
-<a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
-</p>
-<a name="Options"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-Options">10.3.1 Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
-<dd><p>Set the SDL window title, if not specified default to the filename
-specified for the output device.
-</p>
-</dd>
-<dt> &lsquo;<samp>icon_title</samp>&rsquo;</dt>
-<dd><p>Set the name of the iconified SDL window, if not specified it is set
-to the same value of <var>window_title</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>window_size</samp>&rsquo;</dt>
-<dd><p>Set the SDL window size, can be a string of the form
-<var>width</var>x<var>height</var> or a video size abbreviation.
-If not specified it defaults to the size of the input video.
-</p></dd>
-</dl>
-
-<a name="Examples"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-Examples">10.3.2 Examples</a></h3>
-
-<p>The following command shows the &lsquo;<tt>ffmpeg</tt>&rsquo; output is an
-SDL window, forcing its size to the qcif format:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
-</pre></td></tr></table>
-
-<a name="sndio-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-sndio-1">10.4 sndio</a></h2>
-
-<p>sndio audio output device.
-</p>
-<a name="Protocols"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Protocols">11. Protocols</a></h1>
-
-<p>Protocols are configured elements in FFmpeg which allow to access
-resources which require the use of a particular protocol.
-</p>
-<p>When you configure your FFmpeg build, all the supported protocols are
-enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-protocols&quot;.
-</p>
-<p>You can disable all the protocols using the configure option
-&quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
-option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
-particular protocol using the option
-&quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
-</p>
-<p>The option &quot;-protocols&quot; of the ff* tools will display the list of
-supported protocols.
-</p>
-<p>A description of the currently available protocols follows.
-</p>
-<a name="applehttp-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-applehttp-1">11.1 applehttp</a></h2>
-
-<p>Read Apple HTTP Live Streaming compliant segmented stream as
-a uniform one. The M3U8 playlists describing the segments can be
-remote HTTP resources or local files, accessed using the standard
-file protocol.
-HTTP is default, specific protocol can be declared by specifying
-&quot;+<var>proto</var>&quot; after the applehttp URI scheme name, where <var>proto</var>
-is either &quot;file&quot; or &quot;http&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
-applehttp+http://host/path/to/remote/resource.m3u8
-applehttp+file://path/to/local/resource.m3u8
-</pre></td></tr></table>
-
-<a name="concat"></a>
-<h2 class="section"><a href="ffplay.html#toc-concat">11.2 concat</a></h2>
-
-<p>Physical concatenation protocol.
-</p>
-<p>Allow to read and seek from many resource in sequence as if they were
-a unique resource.
-</p>
-<p>A URL accepted by this protocol has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
-</pre></td></tr></table>
-
-<p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
-resource to be concatenated, each one possibly specifying a distinct
-protocol.
-</p>
-<p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
-&lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with &lsquo;<tt>ffplay</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
-</pre></td></tr></table>
-
-<p>Note that you may need to escape the character &quot;|&quot; which is special for
-many shells.
-</p>
-<a name="file"></a>
-<h2 class="section"><a href="ffplay.html#toc-file">11.3 file</a></h2>
-
-<p>File access protocol.
-</p>
-<p>Allow to read from or read to a file.
-</p>
-<p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with &lsquo;<tt>ffmpeg</tt>&rsquo;
-use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
-</pre></td></tr></table>
-
-<p>The ff* tools default to the file protocol, that is a resource
-specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
-&quot;file:FILE.mpeg&quot;.
-</p>
-<a name="gopher"></a>
-<h2 class="section"><a href="ffplay.html#toc-gopher">11.4 gopher</a></h2>
-
-<p>Gopher protocol.
-</p>
-<a name="http"></a>
-<h2 class="section"><a href="ffplay.html#toc-http">11.5 http</a></h2>
-
-<p>HTTP (Hyper Text Transfer Protocol).
-</p>
-<a name="mmst"></a>
-<h2 class="section"><a href="ffplay.html#toc-mmst">11.6 mmst</a></h2>
-
-<p>MMS (Microsoft Media Server) protocol over TCP.
-</p>
-<a name="mmsh"></a>
-<h2 class="section"><a href="ffplay.html#toc-mmsh">11.7 mmsh</a></h2>
-
-<p>MMS (Microsoft Media Server) protocol over HTTP.
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
-</pre></td></tr></table>
-
-<a name="md5"></a>
-<h2 class="section"><a href="ffplay.html#toc-md5">11.8 md5</a></h2>
-
-<p>MD5 output protocol.
-</p>
-<p>Computes the MD5 hash of the data to be written, and on close writes
-this to the designated output or stdout if none is specified. It can
-be used to test muxers without writing an actual file.
-</p>
-<p>Some examples follow.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
-ffmpeg -i input.flv -f avi -y md5:output.avi.md5
-
-# Write the MD5 hash of the encoded AVI file to stdout.
-ffmpeg -i input.flv -f avi -y md5:
-</pre></td></tr></table>
-
-<p>Note that some formats (typically MOV) require the output protocol to
-be seekable, so they will fail with the MD5 output protocol.
-</p>
-<a name="pipe"></a>
-<h2 class="section"><a href="ffplay.html#toc-pipe">11.9 pipe</a></h2>
-
-<p>UNIX pipe access protocol.
-</p>
-<p>Allow to read and write from UNIX pipes.
-</p>
-<p>The accepted syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
-</pre></td></tr></table>
-
-<p><var>number</var> is the number corresponding to the file descriptor of the
-pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
-is not specified, by default the stdout file descriptor will be used
-for writing, stdin for reading.
-</p>
-<p>For example to read from stdin with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
-# ...this is the same as...
-cat test.wav | ffmpeg -i pipe:
-</pre></td></tr></table>
-
-<p>For writing to stdout with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
-# ...this is the same as...
-ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
-</pre></td></tr></table>
-
-<p>Note that some formats (typically MOV), require the output protocol to
-be seekable, so they will fail with the pipe output protocol.
-</p>
-<a name="rtmp"></a>
-<h2 class="section"><a href="ffplay.html#toc-rtmp">11.10 rtmp</a></h2>
-
-<p>Real-Time Messaging Protocol.
-</p>
-<p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
-dia content across a TCP/IP network.
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
-</pre></td></tr></table>
-
-<p>The accepted parameters are:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>server</samp>&rsquo;</dt>
-<dd><p>The address of the RTMP server.
-</p>
-</dd>
-<dt> &lsquo;<samp>port</samp>&rsquo;</dt>
-<dd><p>The number of the TCP port to use (by default is 1935).
-</p>
-</dd>
-<dt> &lsquo;<samp>app</samp>&rsquo;</dt>
-<dd><p>It is the name of the application to access. It usually corresponds to
-the path where the application is installed on the RTMP server
-(e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.).
-</p>
-</dd>
-<dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
-<dd><p>It is the path or name of the resource to play with reference to the
-application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;.
-</p>
-</dd>
-</dl>
-
-<p>For example to read with &lsquo;<tt>ffplay</tt>&rsquo; a multimedia resource named
-&quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
-</pre></td></tr></table>
-
-<a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
-<h2 class="section"><a href="ffplay.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
-
-<p>Real-Time Messaging Protocol and its variants supported through
-librtmp.
-</p>
-<p>Requires the presence of the librtmp headers and library during
-configuration. You need to explicitely configure the build with
-&quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
-protocol.
-</p>
-<p>This protocol provides most client functions and a few server
-functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
-encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
-variants of these encrypted types (RTMPTE, RTMPTS).
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
-</pre></td></tr></table>
-
-<p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
-&quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
-<var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
-meaning as specified for the RTMP native protocol.
-<var>options</var> contains a list of space-separated options of the form
-<var>key</var>=<var>val</var>.
-</p>
-<p>See the librtmp manual page (man 3 librtmp) for more information.
-</p>
-<p>For example, to stream a file in real-time to an RTMP server using
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
-</pre></td></tr></table>
-
-<p>To play the same stream using &lsquo;<tt>ffplay</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
-</pre></td></tr></table>
-
-<a name="rtp"></a>
-<h2 class="section"><a href="ffplay.html#toc-rtp">11.12 rtp</a></h2>
-
-<p>Real-Time Protocol.
-</p>
-<a name="rtsp"></a>
-<h2 class="section"><a href="ffplay.html#toc-rtsp">11.13 rtsp</a></h2>
-
-<p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
-and muxer. The demuxer supports both normal RTSP (with data transferred
-over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
-data transferred over RDT).
-</p>
-<p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
-supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
-RTSP server, <a href="http://github.com/revmischa/rtsp-server">http://github.com/revmischa/rtsp-server</a>).
-</p>
-<p>The required syntax for a RTSP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<p><var>options</var> is a <code>&amp;</code>-separated list. The following options
-are supported:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
-<dd><p>Use UDP as lower transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
-<dd><p>Use TCP (interleaving within the RTSP control channel) as lower
-transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>multicast</samp>&rsquo;</dt>
-<dd><p>Use UDP multicast as lower transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>http</samp>&rsquo;</dt>
-<dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
-passing proxies.
-</p>
-</dd>
-<dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
-<dd><p>Accept packets only from negotiated peer address and port.
-</p></dd>
-</dl>
-
-<p>Multiple lower transport protocols may be specified, in that case they are
-tried one at a time (if the setup of one fails, the next one is tried).
-For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
-</p>
-<p>When receiving data over UDP, the demuxer tries to reorder received packets
-(since they may arrive out of order, or packets may get lost totally). In
-order for this to be enabled, a maximum delay must be specified in the
-<code>max_delay</code> field of AVFormatContext.
-</p>
-<p>When watching multi-bitrate Real-RTSP streams with &lsquo;<tt>ffplay</tt>&rsquo;, the
-streams to display can be chosen with <code>-vst</code> <var>n</var> and
-<code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
-on the fly by pressing <code>v</code> and <code>a</code>.
-</p>
-<p>Example command lines:
-</p>
-<p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
-</pre></td></tr></table>
-
-<p>To watch a stream tunneled over HTTP:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtsp://server/video.mp4?http
-</pre></td></tr></table>
-
-<p>To send a stream in realtime to a RTSP server, for others to watch:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
-</pre></td></tr></table>
-
-<a name="sap"></a>
-<h2 class="section"><a href="ffplay.html#toc-sap">11.14 sap</a></h2>
-
-<p>Session Announcement Protocol (RFC 2974). This is not technically a
-protocol handler in libavformat, it is a muxer and demuxer.
-It is used for signalling of RTP streams, by announcing the SDP for the
-streams regularly on a separate port.
-</p>
-<a name="Muxer"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-Muxer">11.14.1 Muxer</a></h3>
-
-<p>The syntax for a SAP url given to the muxer is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
-</pre></td></tr></table>
-
-<p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
-or to port 5004 if no port is specified.
-<var>options</var> is a <code>&amp;</code>-separated list. The following options
-are supported:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
-<dd><p>Specify the destination IP address for sending the announcements to.
-If omitted, the announcements are sent to the commonly used SAP
-announcement multicast address 224.2.127.254 (sap.mcast.net), or
-ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
-</p>
-</dd>
-<dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
-<dd><p>Specify the port to send the announcements on, defaults to
-9875 if not specified.
-</p>
-</dd>
-<dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
-<dd><p>Specify the time to live value for the announcements and RTP packets,
-defaults to 255.
-</p>
-</dd>
-<dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
-<dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
-default), all streams are sent on unique ports, with each stream on a
-port 2 numbers higher than the previous.
-VLC/Live555 requires this to be set to 1, to be able to receive the stream.
-The RTP stack in libavformat for receiving requires all streams to be sent
-on unique ports.
-</p></dd>
-</dl>
-
-<p>Example command lines follow.
-</p>
-<p>To broadcast a stream on the local subnet, for watching in VLC:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
-</pre></td></tr></table>
-
-<p>Similarly, for watching in ffplay:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
-</pre></td></tr></table>
-
-<p>And for watching in ffplay, over IPv6:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
-</pre></td></tr></table>
-
-<a name="Demuxer"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-Demuxer">11.14.2 Demuxer</a></h3>
-
-<p>The syntax for a SAP url given to the demuxer is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
-</pre></td></tr></table>
-
-<p><var>address</var> is the multicast address to listen for announcements on,
-if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
-is the port that is listened on, 9875 if omitted.
-</p>
-<p>The demuxers listens for announcements on the given address and port.
-Once an announcement is received, it tries to receive that particular stream.
-</p>
-<p>Example command lines follow.
-</p>
-<p>To play back the first stream announced on the normal SAP multicast address:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
-</pre></td></tr></table>
-
-<p>To play back the first stream announced on one the default IPv6 SAP multicast address:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
-</pre></td></tr></table>
-
-<a name="tcp"></a>
-<h2 class="section"><a href="ffplay.html#toc-tcp">11.15 tcp</a></h2>
-
-<p>Trasmission Control Protocol.
-</p>
-<p>The required syntax for a TCP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
-<dd><p>Listen for an incoming connection
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
-ffplay tcp://<var>hostname</var>:<var>port</var>
-</pre></td></tr></table>
-
-</dd>
-</dl>
-
-<a name="udp"></a>
-<h2 class="section"><a href="ffplay.html#toc-udp">11.16 udp</a></h2>
-
-<p>User Datagram Protocol.
-</p>
-<p>The required syntax for a UDP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<p><var>options</var> contains a list of &amp;-seperated options of the form <var>key</var>=<var>val</var>.
-Follow the list of supported options.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
-<dd><p>set the UDP buffer size in bytes
-</p>
-</dd>
-<dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
-<dd><p>override the local UDP port to bind with
-</p>
-</dd>
-<dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
-<dd><p>set the size in bytes of UDP packets
-</p>
-</dd>
-<dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
-<dd><p>explicitly allow or disallow reusing UDP sockets
-</p>
-</dd>
-<dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
-<dd><p>set the time to live value (for multicast only)
-</p>
-</dd>
-<dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
-<dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
-destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
-If the destination address isn&rsquo;t known at the start, this option can
-be specified in ff_udp_set_remote_url, too.
-This allows finding out the source address for the packets with getsockname,
-and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
-unreachable&quot; is received.
-For receiving, this gives the benefit of only receiving packets from
-the specified peer address/port.
-</p></dd>
-</dl>
-
-<p>Some usage examples of the udp protocol with &lsquo;<tt>ffmpeg</tt>&rsquo; follow.
-</p>
-<p>To stream over UDP to a remote endpoint:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
-</pre></td></tr></table>
-
-<p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
-</pre></td></tr></table>
-
-<p>To receive over UDP from a remote endpoint:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
-</pre></td></tr></table>
-
-<a name="Filtergraph-description"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Filtergraph-description">12. Filtergraph description</a></h1>
-
-<p>A filtergraph is a directed graph of connected filters. It can contain
-cycles, and there can be multiple links between a pair of
-filters. Each link has one input pad on one side connecting it to one
-filter from which it takes its input, and one output pad on the other
-side connecting it to the one filter accepting its output.
-</p>
-<p>Each filter in a filtergraph is an instance of a filter class
-registered in the application, which defines the features and the
-number of input and output pads of the filter.
-</p>
-<p>A filter with no input pads is called a &quot;source&quot;, a filter with no
-output pads is called a &quot;sink&quot;.
-</p>
-<a name="Filtergraph-syntax"></a>
-<h2 class="section"><a href="ffplay.html#toc-Filtergraph-syntax">12.1 Filtergraph syntax</a></h2>
-
-<p>A filtergraph can be represented using a textual representation, which
-is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
-tools, and by the <code>av_parse_graph()</code> function defined in
-&lsquo;<tt>libavfilter/avfiltergraph</tt>&rsquo;.
-</p>
-<p>A filterchain consists of a sequence of connected filters, each one
-connected to the previous one in the sequence. A filterchain is
-represented by a list of &quot;,&quot;-separated filter descriptions.
-</p>
-<p>A filtergraph consists of a sequence of filterchains. A sequence of
-filterchains is represented by a list of &quot;;&quot;-separated filterchain
-descriptions.
-</p>
-<p>A filter is represented by a string of the form:
-[<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
-</p>
-<p><var>filter_name</var> is the name of the filter class of which the
-described filter is an instance of, and has to be the name of one of
-the filter classes registered in the program.
-The name of the filter class is optionally followed by a string
-&quot;=<var>arguments</var>&quot;.
-</p>
-<p><var>arguments</var> is a string which contains the parameters used to
-initialize the filter instance, and are described in the filter
-descriptions below.
-</p>
-<p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
-and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
-within the quoted text; otherwise the argument string is considered
-terminated when the next special character (belonging to the set
-&quot;[]=;,&quot;) is encountered.
-</p>
-<p>The name and arguments of the filter are optionally preceded and
-followed by a list of link labels.
-A link label allows to name a link and associate it to a filter output
-or input pad. The preceding labels <var>in_link_1</var>
-... <var>in_link_N</var>, are associated to the filter input pads,
-the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
-associated to the output pads.
-</p>
-<p>When two link labels with the same name are found in the
-filtergraph, a link between the corresponding input and output pad is
-created.
-</p>
-<p>If an output pad is not labelled, it is linked by default to the first
-unlabelled input pad of the next filter in the filterchain.
-For example in the filterchain:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
-</pre></td></tr></table>
-<p>the split filter instance has two output pads, and the overlay filter
-instance two input pads. The first output pad of split is labelled
-&quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
-output pad of split is linked to the second input pad of overlay,
-which are both unlabelled.
-</p>
-<p>In a complete filterchain all the unlabelled filter input and output
-pads must be connected. A filtergraph is considered valid if all the
-filter input and output pads of all the filterchains are connected.
-</p>
-<p>Follows a BNF description for the filtergraph syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
-<var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
-<var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
-<var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
-<var>FILTER</var>           ::= [<var>LINKNAMES</var>] <var>NAME</var> [&quot;=&quot; <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
-<var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
-<var>FILTERGRAPH</var>      ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
-</pre></td></tr></table>
-
-
-<a name="Audio-Filters"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Audio-Filters">13. Audio Filters</a></h1>
-
-<p>When you configure your FFmpeg build, you can disable any of the
-existing filters using &ndash;disable-filters.
-The configure output will show the audio filters included in your
-build.
-</p>
-<p>Below is a description of the currently available audio filters.
-</p>
-<a name="anull"></a>
-<h2 class="section"><a href="ffplay.html#toc-anull">13.1 anull</a></h2>
-
-<p>Pass the audio source unchanged to the output.
-</p>
-
-<a name="Audio-Sources"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Audio-Sources">14. Audio Sources</a></h1>
-
-<p>Below is a description of the currently available audio sources.
-</p>
-<a name="anullsrc"></a>
-<h2 class="section"><a href="ffplay.html#toc-anullsrc">14.1 anullsrc</a></h2>
-
-<p>Null audio source, never return audio frames. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-</p>
-<p>It accepts as optional parameter a string of the form
-<var>sample_rate</var>:<var>channel_layout</var>.
-</p>
-<p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
-</p>
-<p><var>channel_layout</var> specify the channel layout, and can be either an
-integer or a string representing a channel layout. The default value
-of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
-</p>
-<p>Check the channel_layout_map definition in
-&lsquo;<tt>libavcodec/audioconvert.c</tt>&rsquo; for the mapping between strings and
-channel layout values.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
-anullsrc=48000:4
-
-# same as
-anullsrc=48000:mono
-</pre></td></tr></table>
-
-
-<a name="Audio-Sinks"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Audio-Sinks">15. Audio Sinks</a></h1>
-
-<p>Below is a description of the currently available audio sinks.
-</p>
-<a name="anullsink"></a>
-<h2 class="section"><a href="ffplay.html#toc-anullsink">15.1 anullsink</a></h2>
-
-<p>Null audio sink, do absolutely nothing with the input audio. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-</p>
-
-<a name="Video-Filters"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Video-Filters">16. Video Filters</a></h1>
-
-<p>When you configure your FFmpeg build, you can disable any of the
-existing filters using &ndash;disable-filters.
-The configure output will show the video filters included in your
-build.
-</p>
-<p>Below is a description of the currently available video filters.
-</p>
-<a name="blackframe"></a>
-<h2 class="section"><a href="ffplay.html#toc-blackframe">16.1 blackframe</a></h2>
-
-<p>Detect frames that are (almost) completely black. Can be useful to
-detect chapter transitions or commercials. Output lines consist of
-the frame number of the detected frame, the percentage of blackness,
-the position in the file if known or -1 and the timestamp in seconds.
-</p>
-<p>In order to display the output lines, you need to set the loglevel at
-least to the AV_LOG_INFO value.
-</p>
-<p>The filter accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
-</pre></td></tr></table>
-
-<p><var>amount</var> is the percentage of the pixels that have to be below the
-threshold, and defaults to 98.
-</p>
-<p><var>threshold</var> is the threshold below which a pixel value is
-considered black, and defaults to 32.
-</p>
-<a name="copy"></a>
-<h2 class="section"><a href="ffplay.html#toc-copy">16.2 copy</a></h2>
-
-<p>Copy the input source unchanged to the output. Mainly useful for
-testing purposes.
-</p>
-<a name="crop"></a>
-<h2 class="section"><a href="ffplay.html#toc-crop">16.3 crop</a></h2>
-
-<p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
-</p>
-<p>The parameters are expressions containing the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), PHI (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
-each new frame.
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output (cropped) width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>the number of input frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>the position in the file of the input frame, NAN if unknown
-</p>
-</dd>
-<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
-<dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
-</p>
-</dd>
-</dl>
-
-<p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
-the width and height of the output (cropped) video. They are
-evaluated just at the configuration of the filter.
-</p>
-<p>The default value of <var>out_w</var> is &quot;in_w&quot;, and the default value of
-<var>out_h</var> is &quot;in_h&quot;.
-</p>
-<p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
-and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
-cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
-evaluated after <var>out_w</var> and <var>out_h</var>.
-</p>
-<p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
-position of the top-left corner of the output (non-cropped) area. They
-are evaluated for each frame. If the evaluated value is not valid, it
-is approximated to the nearest valid value.
-</p>
-<p>The default value of <var>x</var> is &quot;(in_w-out_w)/2&quot;, and the default
-value for <var>y</var> is &quot;(in_h-out_h)/2&quot;, which set the cropped area at
-the center of the input image.
-</p>
-<p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
-for <var>y</var> may depend on <var>x</var>.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># crop the central input area with size 100x100
-crop=100:100
-
-# crop the central input area with size 2/3 of the input video
-&quot;crop=2/3*in_w:2/3*in_h&quot;
-
-# crop the input video central square
-crop=in_h
-
-# delimit the rectangle with the top-left corner placed at position
-# 100:100 and the right-bottom corner corresponding to the right-bottom
-# corner of the input image.
-crop=in_w-100:in_h-100:100:100
-
-# crop 10 pixels from the left and right borders, and 20 pixels from
-# the top and bottom borders
-&quot;crop=in_w-2*10:in_h-2*20&quot;
-
-# keep only the bottom right quarter of the input image
-&quot;crop=in_w/2:in_h/2:in_w/2:in_h/2&quot;
-
-# crop height for getting Greek harmony
-&quot;crop=in_w:1/PHI*in_w&quot;
-
-# trembling effect
-&quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)&quot;
-
-# erratic camera effect depending on timestamp
-&quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
-
-# set x depending on the value of y
-&quot;crop=in_w/2:in_h/2:y:10+10*sin(n/10)&quot;
-</pre></td></tr></table>
-
-<a name="cropdetect"></a>
-<h2 class="section"><a href="ffplay.html#toc-cropdetect">16.4 cropdetect</a></h2>
-
-<p>Auto-detect crop size.
-</p>
-<p>Calculate necessary cropping parameters and prints the recommended
-parameters through the logging system. The detected dimensions
-correspond to the non-black area of the input video.
-</p>
-<p>It accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
-<dd><p>Threshold, which can be optionally specified from nothing (0) to
-everything (255), defaults to 24.
-</p>
-</dd>
-<dt> &lsquo;<samp>round</samp>&rsquo;</dt>
-<dd><p>Value which the width/height should be divisible by, defaults to
-16. The offset is automatically adjusted to center the video. Use 2 to
-get only even dimensions (needed for 4:2:2 video). 16 is best when
-encoding to most video codecs.
-</p>
-</dd>
-<dt> &lsquo;<samp>reset</samp>&rsquo;</dt>
-<dd><p>Counter that determines after how many frames cropdetect will reset
-the previously detected largest video area and start over to detect
-the current optimal crop area. Defaults to 0.
-</p>
-<p>This can be useful when channel logos distort the video area. 0
-indicates never reset and return the largest area encountered during
-playback.
-</p></dd>
-</dl>
-
-<a name="drawbox"></a>
-<h2 class="section"><a href="ffplay.html#toc-drawbox">16.5 drawbox</a></h2>
-
-<p>Draw a colored box on the input image.
-</p>
-<p>It accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>Specify the top left corner coordinates of the box. Default to 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd><p>Specify the width and height of the box, if 0 they are interpreted as
-the input width and height. Default to 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd><p>Specify the color of the box to write, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-</p></dd>
-</dl>
-
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># draw a black box around the edge of the input image
-drawbox
-
-# draw a box with color red and an opacity of 50%
-drawbox=10:20:200:60:red@0.5&quot;
-</pre></td></tr></table>
-
-<a name="drawtext"></a>
-<h2 class="section"><a href="ffplay.html#toc-drawtext">16.6 drawtext</a></h2>
-
-<p>Draw text string or text from specified file on top of video using the
-libfreetype library.
-</p>
-<p>To enable compilation of this filter you need to configure FFmpeg with
-<code>--enable-libfreetype</code>.
-</p>
-<p>The filter also recognizes strftime() sequences in the provided text
-and expands them accordingly. Check the documentation of strftime().
-</p>
-<p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
-separated by &quot;:&quot;.
-</p>
-<p>The description of the accepted parameters follows.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
-<dd><p>The font file to be used for drawing text. Path must be included.
-This parameter is mandatory.
-</p>
-</dd>
-<dt> &lsquo;<samp>text</samp>&rsquo;</dt>
-<dd><p>The text string to be drawn. The text must be a sequence of UTF-8
-encoded characters.
-This parameter is mandatory if no file is specified with the parameter
-<var>textfile</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
-<dd><p>A text file containing text to be drawn. The text must be a sequence
-of UTF-8 encoded characters.
-</p>
-<p>This parameter is mandatory if no text string is specified with the
-parameter <var>text</var>.
-</p>
-<p>If both text and textfile are specified, an error is thrown.
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>The offsets where text will be drawn within the video frame.
-Relative to the top/left border of the output image.
-</p>
-<p>The default value of <var>x</var> and <var>y</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
-<dd><p>The font size to be used for drawing text.
-The default value of <var>fontsize</var> is 16.
-</p>
-</dd>
-<dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing fonts.
-Either a string (e.g. &quot;red&quot;) or in 0xRRGGBB[AA] format
-(e.g. &quot;0xff000033&quot;), possibly followed by an alpha specifier.
-The default value of <var>fontcolor</var> is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing box around text.
-Either a string (e.g. &quot;yellow&quot;) or in 0xRRGGBB[AA] format
-(e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
-The default value of <var>boxcolor</var> is &quot;white&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>box</samp>&rsquo;</dt>
-<dd><p>Used to draw a box around text using background color.
-Value should be either 1 (enable) or 0 (disable).
-The default value of <var>box</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>shadowx, shadowy</samp>&rsquo;</dt>
-<dd><p>The x and y offsets for the text shadow position with respect to the
-position of the text. They can be either positive or negative
-values. Default value for both is &quot;0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing a shadow behind the drawn text.  It
-can be a color name (e.g. &quot;yellow&quot;) or a string in the 0xRRGGBB[AA]
-form (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
-The default value of <var>shadowcolor</var> is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
-<dd><p>Flags to be used for loading the fonts.
-</p>
-<p>The flags map the corresponding flags supported by libfreetype, and are
-a combination of the following values:
-</p><dl compact="compact">
-<dt> <var>default</var></dt>
-<dt> <var>no_scale</var></dt>
-<dt> <var>no_hinting</var></dt>
-<dt> <var>render</var></dt>
-<dt> <var>no_bitmap</var></dt>
-<dt> <var>vertical_layout</var></dt>
-<dt> <var>force_autohint</var></dt>
-<dt> <var>crop_bitmap</var></dt>
-<dt> <var>pedantic</var></dt>
-<dt> <var>ignore_global_advance_width</var></dt>
-<dt> <var>no_recurse</var></dt>
-<dt> <var>ignore_transform</var></dt>
-<dt> <var>monochrome</var></dt>
-<dt> <var>linear_design</var></dt>
-<dt> <var>no_autohint</var></dt>
-<dt> <var>end table</var></dt>
-</dl>
-
-<p>Default value is &quot;render&quot;.
-</p>
-<p>For more information consult the documentation for the FT_LOAD_*
-libfreetype flags.
-</p>
-</dd>
-<dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
-<dd><p>The size in number of spaces to use for rendering the tab.
-Default value is 4.
-</p></dd>
-</dl>
-
-<p>For example the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
-</pre></td></tr></table>
-
-<p>will draw &quot;Test Text&quot; with font FreeSerif, using the default values
-for the optional parameters.
-</p>
-<p>The command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
-          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
-</pre></td></tr></table>
-
-<p>will draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
-and y=50 (counting from the top-left corner of the screen), text is
-yellow with a red box around it. Both the text and the box have an
-opacity of 20%.
-</p>
-<p>Note that the double quotes are not necessary if spaces are not used
-within the parameter list.
-</p>
-<p>For more information about libfreetype, check:
-<a href="http://www.freetype.org/">http://www.freetype.org/</a>.
-</p>
-<a name="fade"></a>
-<h2 class="section"><a href="ffplay.html#toc-fade">16.7 fade</a></h2>
-
-<p>Apply fade-in/out effect to input video.
-</p>
-<p>It accepts the parameters:
-<var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
-</p>
-<p><var>type</var> specifies if the effect type, can be either &quot;in&quot; for
-fade-in, or &quot;out&quot; for a fade-out effect.
-</p>
-<p><var>start_frame</var> specifies the number of the start frame for starting
-to apply the fade effect.
-</p>
-<p><var>nb_frames</var> specifies the number of frames for which the fade
-effect has to last. At the end of the fade-in effect the output video
-will have the same intensity as the input video, at the end of the
-fade-out transition the output video will be completely black.
-</p>
-<p>A few usage examples follow, usable too as test scenarios.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># fade in first 30 frames of video
-fade=in:0:30
-
-# fade out last 45 frames of a 200-frame video
-fade=out:155:45
-
-# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
-fade=in:0:25, fade=out:975:25
-
-# make first 5 frames black, then fade in from frame 5-24
-fade=in:5:20
-</pre></td></tr></table>
-
-<a name="fieldorder"></a>
-<h2 class="section"><a href="ffplay.html#toc-fieldorder">16.8 fieldorder</a></h2>
-
-<p>Transform the field order of the input video.
-</p>
-<p>It accepts one parameter which specifies the required field order that
-the input interlaced video will be transformed to. The parameter can
-assume one of the following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0 or bff</samp>&rsquo;</dt>
-<dd><p>output bottom field first
-</p></dd>
-<dt> &lsquo;<samp>1 or tff</samp>&rsquo;</dt>
-<dd><p>output top field first
-</p></dd>
-</dl>
-
-<p>Default value is &quot;tff&quot;.
-</p>
-<p>Transformation is achieved by shifting the picture content up or down
-by one line, and filling the remaining line with appropriate picture content.
-This method is consistent with most broadcast field order converters.
-</p>
-<p>If the input video is not flagged as being interlaced, or it is already
-flagged as being of the required output field order then this filter does
-not alter the incoming video.
-</p>
-<p>This filter is very useful when converting to or from PAL DV material,
-which is bottom field first.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
-</pre></td></tr></table>
-
-<a name="fifo"></a>
-<h2 class="section"><a href="ffplay.html#toc-fifo">16.9 fifo</a></h2>
-
-<p>Buffer input images and send them when they are requested.
-</p>
-<p>This filter is mainly useful when auto-inserted by the libavfilter
-framework.
-</p>
-<p>The filter does not take parameters.
-</p>
-<a name="format"></a>
-<h2 class="section"><a href="ffplay.html#toc-format">16.10 format</a></h2>
-
-<p>Convert the input video to one of the specified pixel formats.
-Libavfilter will try to pick one that is supported for the input to
-the next filter.
-</p>
-<p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
-for example &quot;yuv420p:monow:rgb24&quot;.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># convert the input video to the format &quot;yuv420p&quot;
-format=yuv420p
-
-# convert the input video to any of the formats in the list
-format=yuv420p:yuv444p:yuv410p
-</pre></td></tr></table>
-
-<p><a name="frei0r"></a>
-</p><a name="frei0r-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-frei0r-1">16.11 frei0r</a></h2>
-
-<p>Apply a frei0r effect to the input video.
-</p>
-<p>To enable compilation of this filter you need to install the frei0r
-header and configure FFmpeg with &ndash;enable-frei0r.
-</p>
-<p>The filter supports the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
-</pre></td></tr></table>
-
-<p><var>filter_name</var> is the name to the frei0r effect to load. If the
-environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
-is searched in each one of the directories specified by the colon
-separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
-paths, which are in this order: &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;,
-&lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;, &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
-</p>
-<p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
-for the frei0r effect.
-</p>
-<p>A frei0r effect parameter can be a boolean (whose values are specified
-with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
-<var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
-numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
-description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
-<var>X</var> and <var>Y</var> being float numbers) and a string.
-</p>
-<p>The number and kind of parameters depend on the loaded effect. If an
-effect parameter is not specified the default value is set.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
-frei0r=distort0r:0.5:0.01
-
-# apply the colordistance effect, takes a color as first parameter
-frei0r=colordistance:0.2/0.3/0.4
-frei0r=colordistance:violet
-frei0r=colordistance:0x112233
-
-# apply the perspective effect, specify the top left and top right
-# image positions
-frei0r=perspective:0.2/0.2:0.8/0.2
-</pre></td></tr></table>
-
-<p>For more information see:
-<a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
-</p>
-<a name="gradfun"></a>
-<h2 class="section"><a href="ffplay.html#toc-gradfun">16.12 gradfun</a></h2>
-
-<p>Fix the banding artifacts that are sometimes introduced into nearly flat
-regions by truncation to 8bit colordepth.
-Interpolate the gradients that should go where the bands are, and
-dither them.
-</p>
-<p>This filter is designed for playback only.  Do not use it prior to
-lossy compression, because compression tends to lose the dither and
-bring back the bands.
-</p>
-<p>The filter takes two optional parameters, separated by &rsquo;:&rsquo;:
-<var>strength</var>:<var>radius</var>
-</p>
-<p><var>strength</var> is the maximum amount by which the filter will change
-any one pixel. Also the threshold for detecting nearly flat
-regions. Acceptable values range from .51 to 255, default value is
-1.2, out-of-range values will be clipped to the valid range.
-</p>
-<p><var>radius</var> is the neighborhood to fit the gradient to. A larger
-radius makes for smoother gradients, but also prevents the filter from
-modifying the pixels near detailed regions. Acceptable values are
-8-32, default value is 16, out-of-range values will be clipped to the
-valid range.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># default parameters
-gradfun=1.2:16
-
-# omitting radius
-gradfun=1.2
-</pre></td></tr></table>
-
-<a name="hflip"></a>
-<h2 class="section"><a href="ffplay.html#toc-hflip">16.13 hflip</a></h2>
-
-<p>Flip the input video horizontally.
-</p>
-<p>For example to horizontally flip the video in input with
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
-</pre></td></tr></table>
-
-<a name="hqdn3d"></a>
-<h2 class="section"><a href="ffplay.html#toc-hqdn3d">16.14 hqdn3d</a></h2>
-
-<p>High precision/quality 3d denoise filter. This filter aims to reduce
-image noise producing smooth images and making still images really
-still. It should enhance compressibility.
-</p>
-<p>It accepts the following optional parameters:
-<var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
-<dd><p>a non-negative float number which specifies spatial luma strength,
-defaults to 4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
-<dd><p>a non-negative float number which specifies spatial chroma strength,
-defaults to 3.0*<var>luma_spatial</var>/4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
-<dd><p>a float number which specifies luma temporal strength, defaults to
-6.0*<var>luma_spatial</var>/4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
-<dd><p>a float number which specifies chroma temporal strength, defaults to
-<var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
-</p></dd>
-</dl>
-
-<a name="mp"></a>
-<h2 class="section"><a href="ffplay.html#toc-mp">16.15 mp</a></h2>
-
-<p>Apply an MPlayer filter to the input video.
-</p>
-<p>This filter provides a wrapper around most of the filters of
-MPlayer/MEncoder.
-</p>
-<p>This wrapper is considered experimental. Some of the wrapped filters
-may not work properly and we may drop support for them, as they will
-be implemented natively into FFmpeg. Thus you should avoid
-depending on them when writing portable scripts.
-</p>
-<p>The filters accepts the parameters:
-<var>filter_name</var>[:=]<var>filter_params</var>
-</p>
-<p><var>filter_name</var> is the name of a supported MPlayer filter,
-<var>filter_params</var> is a string containing the parameters accepted by
-the named filter.
-</p>
-<p>The list of the currently supported filters follows:
-</p><dl compact="compact">
-<dt> <var>2xsai</var></dt>
-<dt> <var>blackframe</var></dt>
-<dt> <var>boxblur</var></dt>
-<dt> <var>cropdetect</var></dt>
-<dt> <var>decimate</var></dt>
-<dt> <var>delogo</var></dt>
-<dt> <var>denoise3d</var></dt>
-<dt> <var>detc</var></dt>
-<dt> <var>dint</var></dt>
-<dt> <var>divtc</var></dt>
-<dt> <var>down3dright</var></dt>
-<dt> <var>dsize</var></dt>
-<dt> <var>eq2</var></dt>
-<dt> <var>eq</var></dt>
-<dt> <var>field</var></dt>
-<dt> <var>fil</var></dt>
-<dt> <var>fixpts</var></dt>
-<dt> <var>framestep</var></dt>
-<dt> <var>fspp</var></dt>
-<dt> <var>geq</var></dt>
-<dt> <var>gradfun</var></dt>
-<dt> <var>harddup</var></dt>
-<dt> <var>hqdn3d</var></dt>
-<dt> <var>hue</var></dt>
-<dt> <var>il</var></dt>
-<dt> <var>ilpack</var></dt>
-<dt> <var>ivtc</var></dt>
-<dt> <var>kerndeint</var></dt>
-<dt> <var>mcdeint</var></dt>
-<dt> <var>mirror</var></dt>
-<dt> <var>noise</var></dt>
-<dt> <var>ow</var></dt>
-<dt> <var>palette</var></dt>
-<dt> <var>perspective</var></dt>
-<dt> <var>phase</var></dt>
-<dt> <var>pp7</var></dt>
-<dt> <var>pullup</var></dt>
-<dt> <var>qp</var></dt>
-<dt> <var>rectangle</var></dt>
-<dt> <var>remove-logo</var></dt>
-<dt> <var>rgbtest</var></dt>
-<dt> <var>rotate</var></dt>
-<dt> <var>sab</var></dt>
-<dt> <var>screenshot</var></dt>
-<dt> <var>smartblur</var></dt>
-<dt> <var>softpulldown</var></dt>
-<dt> <var>softskip</var></dt>
-<dt> <var>spp</var></dt>
-<dt> <var>swapuv</var></dt>
-<dt> <var>telecine</var></dt>
-<dt> <var>test</var></dt>
-<dt> <var>tile</var></dt>
-<dt> <var>tinterlace</var></dt>
-<dt> <var>unsharp</var></dt>
-<dt> <var>uspp</var></dt>
-<dt> <var>yuvcsp</var></dt>
-<dt> <var>yvu9</var></dt>
-</dl>
-
-<p>The parameter syntax and behavior for the listed filters are the same
-of the corresponding MPlayer filters. For detailed instructions check
-the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
-mp=delogo=200:200:80:20:1
-
-# adjust gamma, brightness, contrast
-mp=eq2=1.0:2:0.5
-
-# tweak hue and saturation
-mp=hue=100:-10
-</pre></td></tr></table>
-
-<p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
-</p>
-<a name="noformat"></a>
-<h2 class="section"><a href="ffplay.html#toc-noformat">16.16 noformat</a></h2>
-
-<p>Force libavfilter not to use any of the specified pixel formats for the
-input to the next filter.
-</p>
-<p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
-for example &quot;yuv420p:monow:rgb24&quot;.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># force libavfilter to use a format different from &quot;yuv420p&quot; for the
-# input to the vflip filter
-noformat=yuv420p,vflip
-
-# convert the input video to any of the formats not contained in the list
-noformat=yuv420p:yuv444p:yuv410p
-</pre></td></tr></table>
-
-<a name="null-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-null-1">16.17 null</a></h2>
-
-<p>Pass the video source unchanged to the output.
-</p>
-<a name="ocv"></a>
-<h2 class="section"><a href="ffplay.html#toc-ocv">16.18 ocv</a></h2>
-
-<p>Apply video transform using libopencv.
-</p>
-<p>To enable this filter install libopencv library and headers and
-configure FFmpeg with &ndash;enable-libopencv.
-</p>
-<p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
-</p>
-<p><var>filter_name</var> is the name of the libopencv filter to apply.
-</p>
-<p><var>filter_params</var> specifies the parameters to pass to the libopencv
-filter. If not specified the default values are assumed.
-</p>
-<p>Refer to the official libopencv documentation for more precise
-informations:
-<a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
-</p>
-<p>Follows the list of supported libopencv filters.
-</p>
-<p><a name="dilate"></a>
-</p><a name="dilate-1"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-dilate-1">16.18.1 dilate</a></h3>
-
-<p>Dilate an image by using a specific structuring element.
-This filter corresponds to the libopencv function <code>cvDilate</code>.
-</p>
-<p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
-</p>
-<p><var>struct_el</var> represents a structuring element, and has the syntax:
-<var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
-</p>
-<p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
-the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
-point, and <var>shape</var> the shape for the structuring element, and
-can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
-</p>
-<p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
-string of the form &quot;=<var>filename</var>&quot;. The file with name
-<var>filename</var> is assumed to represent a binary image, with each
-printable character corresponding to a bright pixel. When a custom
-<var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
-or columns and rows of the read file are assumed instead.
-</p>
-<p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
-</p>
-<p><var>nb_iterations</var> specifies the number of times the transform is
-applied to the image, and defaults to 1.
-</p>
-<p>Follow some example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
-ocv=dilate
-
-# dilate using a structuring element with a 5x5 cross, iterate two times
-ocv=dilate=5x5+2x2/cross:2
-
-# read the shape from the file diamond.shape, iterate two times
-# the file diamond.shape may contain a pattern of characters like this:
-#   *
-#  ***
-# *****
-#  ***
-#   *
-# the specified cols and rows are ignored (but not the anchor point coordinates)
-ocv=0x0+2x2/custom=diamond.shape:2
-</pre></td></tr></table>
-
-<a name="erode"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-erode">16.18.2 erode</a></h3>
-
-<p>Erode an image by using a specific structuring element.
-This filter corresponds to the libopencv function <code>cvErode</code>.
-</p>
-<p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
-with the same meaning and use of those of the dilate filter
-(see <a href="#dilate">dilate</a>).
-</p>
-<a name="smooth"></a>
-<h3 class="subsection"><a href="ffplay.html#toc-smooth">16.18.3 smooth</a></h3>
-
-<p>Smooth the input video.
-</p>
-<p>The filter takes the following parameters:
-<var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
-</p>
-<p><var>type</var> is the type of smooth filter to apply, and can be one of
-the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
-&quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
-</p>
-<p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
-parameters whose meanings depend on smooth type. <var>param1</var> and
-<var>param2</var> accept integer positive values or 0, <var>param3</var> and
-<var>param4</var> accept float values.
-</p>
-<p>The default value for <var>param1</var> is 3, the default value for the
-other parameters is 0.
-</p>
-<p>These parameters correspond to the parameters assigned to the
-libopencv function <code>cvSmooth</code>.
-</p>
-<a name="overlay"></a>
-<h2 class="section"><a href="ffplay.html#toc-overlay">16.19 overlay</a></h2>
-
-<p>Overlay one video on top of another.
-</p>
-<p>It takes two inputs and one output, the first input is the &quot;main&quot;
-video on which the second input is overlayed.
-</p>
-<p>It accepts the parameters: <var>x</var>:<var>y</var>.
-</p>
-<p><var>x</var> is the x coordinate of the overlayed video on the main video,
-<var>y</var> is the y coordinate. The parameters are expressions containing
-the following parameters:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>main_w, main_h</samp>&rsquo;</dt>
-<dd><p>main input width and height
-</p>
-</dd>
-<dt> &lsquo;<samp>W, H</samp>&rsquo;</dt>
-<dd><p>same as <var>main_w</var> and <var>main_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>overlay_w, overlay_h</samp>&rsquo;</dt>
-<dd><p>overlay input width and height
-</p>
-</dd>
-<dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
-<dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
-</p></dd>
-</dl>
-
-<p>Be aware that frames are taken from each input video in timestamp
-order, hence, if their initial timestamps differ, it is a a good idea
-to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
-have them begin in the same zero timestamp, as it does the example for
-the <var>movie</var> filter.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
-# corner of the main video.
-overlay=main_w-overlay_w-10:main_h-overlay_h-10
-
-# insert a transparent PNG logo in the bottom left corner of the input
-movie=logo.png [logo];
-[in][logo] overlay=10:main_h-overlay_h-10 [out]
-
-# insert 2 different transparent PNG logos (second logo on bottom
-# right corner):
-movie=logo1.png [logo1];
-movie=logo2.png [logo2];
-[in][logo1]       overlay=10:H-h-10 [in+logo1];
-[in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
-
-# add a transparent color layer on top of the main video,
-# WxH specifies the size of the main input to the overlay filter
-color=red.3:WxH [over]; [in][over] overlay [out]
-</pre></td></tr></table>
-
-<p>You can chain togheter more overlays but the efficiency of such
-approach is yet to be tested.
-</p>
-<a name="pad"></a>
-<h2 class="section"><a href="ffplay.html#toc-pad">16.20 pad</a></h2>
-
-<p>Add paddings to the input image, and places the original input at the
-given coordinates <var>x</var>, <var>y</var>.
-</p>
-<p>It accepts the following parameters:
-<var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
-</p>
-<p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
-expressions containing the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input video width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output width and heigth, that is the size of the padded area as
-specified by the <var>width</var> and <var>height</var> expressions
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
-expressions, or NAN if not yet specified
-</p>
-</dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
-<dd><p>horizontal and vertical chroma subsample values. For example for the
-pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
-</p></dd>
-</dl>
-
-<p>Follows the description of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd>
-<p>Specify the size of the output image with the paddings added. If the
-value for <var>width</var> or <var>height</var> is 0, the corresponding input size
-is used for the output.
-</p>
-<p>The <var>width</var> expression can reference the value set by the
-<var>height</var> expression, and viceversa.
-</p>
-<p>The default value of <var>width</var> and <var>height</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd>
-<p>Specify the offsets where to place the input image in the padded area
-with respect to the top/left border of the output image.
-</p>
-<p>The <var>x</var> expression can reference the value set by the <var>y</var>
-expression, and viceversa.
-</p>
-<p>The default value of <var>x</var> and <var>y</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd>
-<p>Specify the color of the padded area, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-</p>
-<p>The default value of <var>color</var> is &quot;black&quot;.
-</p>
-</dd>
-</dl>
-
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># Add paddings with color &quot;violet&quot; to the input video. Output video
-# size is 640x480, the top-left corner of the input video is placed at
-# column 0, row 40.
-pad=640:480:0:40:violet
-
-# pad the input to get an output with dimensions increased bt 3/2,
-# and put the input video at the center of the padded area
-pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
-
-# pad the input to get a squared output with size equal to the maximum
-# value between the input width and height, and put the input video at
-# the center of the padded area
-pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
-
-# pad the input to get a final w/h ratio of 16:9
-pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
-
-# double output size and put the input video in the bottom-right
-# corner of the output padded area
-pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
-</pre></td></tr></table>
-
-<a name="pixdesctest"></a>
-<h2 class="section"><a href="ffplay.html#toc-pixdesctest">16.21 pixdesctest</a></h2>
-
-<p>Pixel format descriptor test filter, mainly useful for internal
-testing. The output video should be equal to the input video.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
-</pre></td></tr></table>
-
-<p>can be used to test the monowhite pixel format descriptor definition.
-</p>
-<a name="scale"></a>
-<h2 class="section"><a href="ffplay.html#toc-scale">16.22 scale</a></h2>
-
-<p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
-</p>
-<p>The parameters <var>width</var> and <var>height</var> are expressions containing
-the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output (cropped) width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
-<dd><p>horizontal and vertical chroma subsample values. For example for the
-pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
-</p></dd>
-</dl>
-
-<p>If the input image format is different from the format requested by
-the next filter, the scale filter will convert the input to the
-requested format.
-</p>
-<p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
-size is used for the output.
-</p>
-<p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
-use, for the respective output size, a value that maintains the aspect
-ratio of the input image.
-</p>
-<p>The default value of <var>width</var> and <var>height</var> is 0.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># scale the input video to a size of 200x100.
-scale=200:100
-
-# scale the input to 2x
-scale=2*iw:2*ih
-# the above is the same as
-scale=2*in_w:2*in_h
-
-# scale the input to half size
-scale=iw/2:ih/2
-
-# increase the width, and set the height to the same size
-scale=3/2*iw:ow
-
-# seek for Greek harmony
-scale=iw:1/PHI*iw
-scale=ih*PHI:ih
-
-# increase the height, and set the width to 3/2 of the height
-scale=3/2*oh:3/5*ih
-
-# increase the size, but make the size a multiple of the chroma
-scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
-
-# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
-scale='min(500\, iw*3/2):-1'
-</pre></td></tr></table>
-
-<a name="select"></a>
-<h2 class="section"><a href="ffplay.html#toc-select">16.23 select</a></h2>
-<p>Select frames to pass in output.
-</p>
-<p>It accepts in input an expression, which is evaluated for each input
-frame. If the expression is evaluated to a non-zero value, the frame
-is selected and passed to the output, otherwise it is discarded.
-</p>
-<p>The expression can contain the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
-<dd><p>Greek PI
-</p>
-</dd>
-<dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
-<dd><p>golden ratio
-</p>
-</dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Euler number
-</p>
-</dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the filtered frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the selected frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the last selected frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
-<dd><p>timebase of the input timestamps
-</p>
-</dd>
-<dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
-<dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in <var>TB</var> units, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
-<dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in seconds, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the previously filtered video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the last previously filtered video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
-<dd><p>the PTS of the last previously selected video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the first video frame in the video, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
-<dd><p>the time of the first video frame in the video, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>pict_type</samp>&rsquo;</dt>
-<dd><p>the picture type of the filtered frame, can assume one of the following
-values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>PICT_TYPE_I</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_P</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_B</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_S</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_SI</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_SP</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_BI</samp>&rsquo;</dt>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>interlace_type</samp>&rsquo;</dt>
-<dd><p>the frame interlace type, can assume one of the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>INTERLACE_TYPE_P</samp>&rsquo;</dt>
-<dd><p>the frame is progressive (not interlaced)
-</p></dd>
-<dt> &lsquo;<samp>INTERLACE_TYPE_T</samp>&rsquo;</dt>
-<dd><p>the frame is top-field-first
-</p></dd>
-<dt> &lsquo;<samp>INTERLACE_TYPE_B</samp>&rsquo;</dt>
-<dd><p>the frame is bottom-field-first
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>key</samp>&rsquo;</dt>
-<dd><p>1 if the filtered frame is a key-frame, 0 otherwise
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>the position in the file of the filtered frame, -1 if the information
-is not available (e.g. for synthetic video)
-</p></dd>
-</dl>
-
-<p>The default value of the select expression is &quot;1&quot;.
-</p>
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># select all frames in input
-select
-
-# the above is the same as:
-select=1
-
-# skip all frames:
-select=0
-
-# select only I-frames
-select='eq(pict_type\,PICT_TYPE_I)'
-
-# select one frame every 100
-select='not(mod(n\,100))'
-
-# select only frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)'
-
-# select only I frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
-
-# select frames with a minimum distance of 10 seconds
-select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
-</pre></td></tr></table>
-
-<p><a name="setdar"></a>
-</p><a name="setdar-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-setdar-1">16.24 setdar</a></h2>
-
-<p>Set the Display Aspect Ratio for the filter output video.
-</p>
-<p>This is done by changing the specified Sample (aka Pixel) Aspect
-Ratio, according to the following equation:
-<em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
-</p>
-<p>Keep in mind that this filter does not modify the pixel dimensions of
-the video frame. Also the display aspect ratio set by this filter may
-be changed by later filters in the filterchain, e.g. in case of
-scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is applied.
-</p>
-<p>The filter accepts a parameter string which represents the wanted
-display aspect ratio.
-The parameter can be a floating point number string, or an expression
-of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio.
-If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
-</p>
-<p>For example to change the display aspect ratio to 16:9, specify:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">setdar=16:9
-# the above is equivalent to
-setdar=1.77777
-</pre></td></tr></table>
-
-<p>See also the &quot;setsar&quot; filter documentation (see <a href="#setsar">setsar</a>).
-</p>
-<a name="setpts"></a>
-<h2 class="section"><a href="ffplay.html#toc-setpts">16.25 setpts</a></h2>
-
-<p>Change the PTS (presentation timestamp) of the input video frames.
-</p>
-<p>Accept in input an expression evaluated through the eval API, which
-can contain the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
-<dd><p>the presentation timestamp in input
-</p>
-</dd>
-<dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
-<dd><p>Greek PI
-</p>
-</dd>
-<dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
-<dd><p>golden ratio
-</p>
-</dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Euler number
-</p>
-</dd>
-<dt> &lsquo;<samp>N</samp>&rsquo;</dt>
-<dd><p>the count of the input frame, starting from 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
-<dd><p>the PTS of the first video frame
-</p>
-</dd>
-<dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
-<dd><p>tell if the current frame is interlaced
-</p>
-</dd>
-<dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
-<dd><p>original position in the file of the frame, or undefined if undefined
-for the current frame
-</p>
-</dd>
-<dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
-<dd><p>previous input PTS
-</p>
-</dd>
-<dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
-<dd><p>previous output PTS
-</p>
-</dd>
-</dl>
-
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># start counting PTS from zero
-setpts=PTS-STARTPTS
-
-# fast motion
-setpts=0.5*PTS
-
-# slow motion
-setpts=2.0*PTS
-
-# fixed rate 25 fps
-setpts=N/(25*TB)
-
-# fixed rate 25 fps with some jitter
-setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
-</pre></td></tr></table>
-
-<p><a name="setsar"></a>
-</p><a name="setsar-1"></a>
-<h2 class="section"><a href="ffplay.html#toc-setsar-1">16.26 setsar</a></h2>
-
-<p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
-</p>
-<p>Note that as a consequence of the application of this filter, the
-output display aspect ratio will change according to the following
-equation:
-<em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
-</p>
-<p>Keep in mind that the sample aspect ratio set by this filter may be
-changed by later filters in the filterchain, e.g. if another &quot;setsar&quot;
-or a &quot;setdar&quot; filter is applied.
-</p>
-<p>The filter accepts a parameter string which represents the wanted
-sample aspect ratio.
-The parameter can be a floating point number string, or an expression
-of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio.
-If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
-</p>
-<p>For example to change the sample aspect ratio to 10:11, specify:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">setsar=10:11
-</pre></td></tr></table>
-
-<a name="settb"></a>
-<h2 class="section"><a href="ffplay.html#toc-settb">16.27 settb</a></h2>
-
-<p>Set the timebase to use for the output frames timestamps.
-It is mainly useful for testing timebase configuration.
-</p>
-<p>It accepts in input an arithmetic expression representing a rational.
-The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;, &quot;AVTB&quot; (the
-default timebase), and &quot;intb&quot; (the input timebase).
-</p>
-<p>The default value for the input is &quot;intb&quot;.
-</p>
-<p>Follow some examples.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># set the timebase to 1/25
-settb=1/25
-
-# set the timebase to 1/10
-settb=0.1
-
-#set the timebase to 1001/1000
-settb=1+0.001
-
-#set the timebase to 2*intb
-settb=2*intb
-
-#set the default timebase value
-settb=AVTB
-</pre></td></tr></table>
-
-<a name="showinfo"></a>
-<h2 class="section"><a href="ffplay.html#toc-showinfo">16.28 showinfo</a></h2>
-
-<p>Show a line containing various information for each input video frame.
-The input video is not modified.
-</p>
-<p>The shown line contains a sequence of key/value pairs of the form
-<var>key</var>:<var>value</var>.
-</p>
-<p>A description of each shown parameter follows:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>sequential number of the input frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
-<dd><p>Presentation TimeStamp of the input frame, expressed as a number of
-time base units. The time base unit depends on the filter input pad.
-</p>
-</dd>
-<dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
-<dd><p>Presentation TimeStamp of the input frame, expressed as a number of
-seconds
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>position of the frame in the input stream, -1 if this information in
-unavailable and/or meanigless (for example in case of synthetic video)
-</p>
-</dd>
-<dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
-<dd><p>pixel format name
-</p>
-</dd>
-<dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
-<dd><p>sample aspect ratio of the input frame, expressed in the form
-<var>num</var>/<var>den</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>s</samp>&rsquo;</dt>
-<dd><p>size of the input frame, expressed in the form
-<var>width</var>x<var>height</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>i</samp>&rsquo;</dt>
-<dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
-for bottom field first)
-</p>
-</dd>
-<dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
-<dd><p>1 if the frame is a key frame, 0 otherwise
-</p>
-</dd>
-<dt> &lsquo;<samp>type</samp>&rsquo;</dt>
-<dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
-P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
-Check also the documentation of the <code>AVPictureType</code> enum and of
-the <code>av_get_picture_type_char</code> function defined in
-&lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
-</p>
-</dd>
-<dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
-<dd><p>Adler-32 checksum of all the planes of the input frame
-</p>
-</dd>
-<dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
-<dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
-&quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
-</p></dd>
-</dl>
-
-<a name="slicify"></a>
-<h2 class="section"><a href="ffplay.html#toc-slicify">16.29 slicify</a></h2>
-
-<p>Pass the images of input video on to next video filter as multiple
-slices.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;slicify=32&quot; out.avi
-</pre></td></tr></table>
-
-<p>The filter accepts the slice height as parameter. If the parameter is
-not specified it will use the default value of 16.
-</p>
-<p>Adding this in the beginning of filter chains should make filtering
-faster due to better use of the memory cache.
-</p>
-<a name="split"></a>
-<h2 class="section"><a href="ffplay.html#toc-split">16.30 split</a></h2>
-
-<p>Pass on the input video to two outputs. Both outputs are identical to
-the input video.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
-[splitout1] crop=100:100:0:0    [cropout];
-[splitout2] pad=200:200:100:100 [padout];
-</pre></td></tr></table>
-
-<p>will create two separate outputs from the same input, one cropped and
-one padded.
-</p>
-<a name="transpose"></a>
-<h2 class="section"><a href="ffplay.html#toc-transpose">16.31 transpose</a></h2>
-
-<p>Transpose rows with columns in the input video and optionally flip it.
-</p>
-<p>It accepts a parameter representing an integer, which can assume the
-values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
-. . -&gt;  . .
-l.r     R.r
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees clockwise, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
-. . -&gt;  . .
-l.r     r.R
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees counterclockwise, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
-. . -&gt;  . .
-l.r     L.l
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
-. . -&gt;  . .
-l.r     l.L
-</pre></td></tr></table>
-</dd>
-</dl>
-
-<a name="unsharp"></a>
-<h2 class="section"><a href="ffplay.html#toc-unsharp">16.32 unsharp</a></h2>
-
-<p>Sharpen or blur the input video.
-</p>
-<p>It accepts the following parameters:
-<var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>
-</p>
-<p>Negative values for the amount will blur the input video, while positive
-values will sharpen. All parameters are optional and default to the
-equivalent of the string &rsquo;5:5:1.0:0:0:0.0&rsquo;.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>luma_msize_x</samp>&rsquo;</dt>
-<dd><p>Set the luma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_msize_y</samp>&rsquo;</dt>
-<dd><p>Set the luma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
-<dd><p>Set the luma effect strength. It can be a float number between -2.0
-and 5.0, default value is 1.0.
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_msize_x</samp>&rsquo;</dt>
-<dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
-and 13, default value is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_msize_y</samp>&rsquo;</dt>
-<dd><p>Set the chroma matrix vertical size. It can be an integer between 3
-and 13, default value is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
-<dd><p>Set the chroma effect strength. It can be a float number between -2.0
-and 5.0, default value is 0.0.
-</p>
-</dd>
-</dl>
-
-<table><tr><td>&nbsp;</td><td><pre class="example"># Strong luma sharpen effect parameters
-unsharp=7:7:2.5
-
-# Strong blur of both luma and chroma parameters
-unsharp=7:7:-2:7:7:-2
-
-# Use the default values with <code>ffmpeg</code>
-./ffmpeg -i in.avi -vf &quot;unsharp&quot; out.mp4
-</pre></td></tr></table>
-
-<a name="vflip"></a>
-<h2 class="section"><a href="ffplay.html#toc-vflip">16.33 vflip</a></h2>
-
-<p>Flip the input video vertically.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
-</pre></td></tr></table>
-
-<a name="yadif"></a>
-<h2 class="section"><a href="ffplay.html#toc-yadif">16.34 yadif</a></h2>
-
-<p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
-filter&quot;).
-</p>
-<p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>.
-</p>
-<p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
-following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>output 1 frame for each frame
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>output 1 frame for each field
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>like 0 but skips spatial interlacing check
-</p></dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>like 1 but skips spatial interlacing check
-</p></dd>
-</dl>
-
-<p>Default value is 0.
-</p>
-<p><var>parity</var> specifies the picture field parity assumed for the input
-interlaced video, accepts one of the following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>assume bottom field first
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>assume top field first
-</p></dd>
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>enable automatic detection
-</p></dd>
-</dl>
-
-<p>Default value is -1.
-If interlacing is unknown or decoder does not export this information,
-top field first will be assumed.
-</p>
-
-<a name="Video-Sources"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Video-Sources">17. Video Sources</a></h1>
-
-<p>Below is a description of the currently available video sources.
-</p>
-<a name="buffer"></a>
-<h2 class="section"><a href="ffplay.html#toc-buffer">17.1 buffer</a></h2>
-
-<p>Buffer video frames, and make them available to the filter chain.
-</p>
-<p>This source is mainly intended for a programmatic use, in particular
-through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
-</p>
-<p>It accepts the following parameters:
-<var>width</var>:<var>height</var>:<var>pix_fmt_string</var>:<var>timebase_num</var>:<var>timebase_den</var>:<var>sample_aspect_ratio_num</var>:<var>sample_aspect_ratio.den</var>:<var>scale_params</var>
-</p>
-<p>All the parameters but <var>scale_params</var> need to be explicitely
-defined.
-</p>
-<p>Follows the list of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd><p>Specify the width and height of the buffered video frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>pix_fmt_string</samp>&rsquo;</dt>
-<dd><p>A string representing the pixel format of the buffered video frames.
-It may be a number corresponding to a pixel format, or a pixel format
-name.
-</p>
-</dd>
-<dt> &lsquo;<samp>timebase_num, timebase_den</samp>&rsquo;</dt>
-<dd><p>Specify numerator and denomitor of the timebase assumed by the
-timestamps of the buffered frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>&rsquo;</dt>
-<dd><p>Specify numerator and denominator of the sample aspect ratio assumed
-by the video frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>scale_params</samp>&rsquo;</dt>
-<dd><p>Specify the optional parameters to be used for the scale filter which
-is automatically inserted when an input change is detected in the
-input size or format.
-</p></dd>
-</dl>
-
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
-</pre></td></tr></table>
-
-<p>will instruct the source to accept video frames with size 320x240 and
-with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
-square pixels (1:1 sample aspect ratio).
-Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
-(check the enum PixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
-this example corresponds to:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:6:1:24:1:1
-</pre></td></tr></table>
-
-<a name="color"></a>
-<h2 class="section"><a href="ffplay.html#toc-color">17.2 color</a></h2>
-
-<p>Provide an uniformly colored input.
-</p>
-<p>It accepts the following parameters:
-<var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
-</p>
-<p>Follows the description of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd><p>Specify the color of the source. It can be the name of a color (case
-insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
-alpha specifier. The default value is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
-<dd><p>Specify the size of the sourced video, it may be a string of the form
-<var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
-default value is &quot;320x240&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
-<dd><p>Specify the frame rate of the sourced video, as the number of frames
-generated per second. It has to be a string in the format
-<var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
-number or a valid video frame rate abbreviation. The default value is
-&quot;25&quot;.
-</p>
-</dd>
-</dl>
-
-<p>For example the following graph description will generate a red source
-with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
-frames per second, which will be overlayed over the source connected
-to the pad with identifier &quot;in&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">&quot;color=red@0.2:qcif:10 [color]; [in][color] overlay [out]&quot;
-</pre></td></tr></table>
-
-<a name="movie"></a>
-<h2 class="section"><a href="ffplay.html#toc-movie">17.3 movie</a></h2>
-
-<p>Read a video stream from a movie container.
-</p>
-<p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
-<var>movie_name</var> is the name of the resource to read (not necessarily
-a file but also a device or a stream accessed through some protocol),
-and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
-pairs, separated by &quot;:&quot;.
-</p>
-<p>The description of the accepted options follows.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
-<dd><p>Specifies the format assumed for the movie to read, and can be either
-the name of a container or an input device. If not specified the
-format is guessed from <var>movie_name</var> or by probing.
-</p>
-</dd>
-<dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
-<dd><p>Specifies the seek point in seconds, the frames will be output
-starting from this seek point, the parameter is evaluated with
-<code>av_strtod</code> so the numerical value may be suffixed by an IS
-postfix. Default value is &quot;0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
-<dd><p>Specifies the index of the video stream to read. If the value is -1,
-the best suited video stream will be automatically selected. Default
-value is &quot;-1&quot;.
-</p>
-</dd>
-</dl>
-
-<p>This filter allows to overlay a second video on top of main input of
-a filtergraph as shown in this graph:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
-                                    ^
-                                    |
-movie --&gt; scale--&gt; deltapts1 -------+
-</pre></td></tr></table>
-
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
-# on top of the input labelled as &quot;in&quot;.
-movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-# read from a video4linux2 device, and overlay it on top of the input
-# labelled as &quot;in&quot;
-movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-</pre></td></tr></table>
-
-<a name="nullsrc"></a>
-<h2 class="section"><a href="ffplay.html#toc-nullsrc">17.4 nullsrc</a></h2>
-
-<p>Null video source, never return images. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-</p>
-<p>It accepts as optional parameter a string of the form
-<var>width</var>:<var>height</var>:<var>timebase</var>.
-</p>
-<p><var>width</var> and <var>height</var> specify the size of the configured
-source. The default values of <var>width</var> and <var>height</var> are
-respectively 352 and 288 (corresponding to the CIF size format).
-</p>
-<p><var>timebase</var> specifies an arithmetic expression representing a
-timebase. The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;,
-&quot;AVTB&quot; (the default timebase), and defaults to the value &quot;AVTB&quot;.
-</p>
-<a name="frei0r_005fsrc"></a>
-<h2 class="section"><a href="ffplay.html#toc-frei0r_005fsrc">17.5 frei0r_src</a></h2>
-
-<p>Provide a frei0r source.
-</p>
-<p>To enable compilation of this filter you need to install the frei0r
-header and configure FFmpeg with &ndash;enable-frei0r.
-</p>
-<p>The source supports the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
-</pre></td></tr></table>
-
-<p><var>size</var> is the size of the video to generate, may be a string of the
-form <var>width</var>x<var>height</var> or a frame size abbreviation.
-<var>rate</var> is the rate of the video to generate, may be a string of
-the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
-<var>src_name</var> is the name to the frei0r source to load. For more
-information regarding frei0r and how to set the parameters read the
-section &quot;frei0r&quot; (see <a href="#frei0r">frei0r</a>) in the description of the video
-filters.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
-# which is overlayed on the overlay filter main input
-frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
-</pre></td></tr></table>
-
-
-<a name="Video-Sinks"></a>
-<h1 class="chapter"><a href="ffplay.html#toc-Video-Sinks">18. Video Sinks</a></h1>
-
-<p>Below is a description of the currently available video sinks.
-</p>
-<a name="nullsink"></a>
-<h2 class="section"><a href="ffplay.html#toc-nullsink">18.1 nullsink</a></h2>
-
-<p>Null video sink, do absolutely nothing with the input video. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-</p>
-
-
-
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/doc/ffprobe.html b/ffmpeg 0.7/doc/ffprobe.html
deleted file mode 100644 (file)
index a0f7417..0000000
+++ /dev/null
@@ -1,1212 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>ffprobe Documentation</title>
-
-<meta name="description" content="ffprobe Documentation">
-<meta name="keywords" content="ffprobe Documentation">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">ffprobe Documentation</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
-  <li><a name="toc-Description" href="#Description">2. Description</a></li>
-  <li><a name="toc-Options" href="#Options">3. Options</a>
-  <ul class="toc">
-    <li><a name="toc-Generic-options" href="#Generic-options">3.1 Generic options</a></li>
-    <li><a name="toc-Main-options" href="#Main-options">3.2 Main options</a></li>
-  </ul></li>
-  <li><a name="toc-Decoders" href="#Decoders">4. Decoders</a></li>
-  <li><a name="toc-Video-Decoders" href="#Video-Decoders">5. Video Decoders</a>
-  <ul class="toc">
-    <li><a name="toc-rawvideo" href="#rawvideo">5.1 rawvideo</a>
-    <ul class="toc">
-      <li><a name="toc-Options-1" href="#Options-1">5.1.1 Options</a></li>
-    </ul>
-</li>
-  </ul></li>
-  <li><a name="toc-Demuxers" href="#Demuxers">6. Demuxers</a>
-  <ul class="toc">
-    <li><a name="toc-image2" href="#image2">6.1 image2</a></li>
-    <li><a name="toc-applehttp-1" href="#applehttp-1">6.2 applehttp</a></li>
-  </ul></li>
-  <li><a name="toc-Protocols" href="#Protocols">7. Protocols</a>
-  <ul class="toc">
-    <li><a name="toc-applehttp" href="#applehttp">7.1 applehttp</a></li>
-    <li><a name="toc-concat" href="#concat">7.2 concat</a></li>
-    <li><a name="toc-file" href="#file">7.3 file</a></li>
-    <li><a name="toc-gopher" href="#gopher">7.4 gopher</a></li>
-    <li><a name="toc-http" href="#http">7.5 http</a></li>
-    <li><a name="toc-mmst" href="#mmst">7.6 mmst</a></li>
-    <li><a name="toc-mmsh" href="#mmsh">7.7 mmsh</a></li>
-    <li><a name="toc-md5" href="#md5">7.8 md5</a></li>
-    <li><a name="toc-pipe" href="#pipe">7.9 pipe</a></li>
-    <li><a name="toc-rtmp" href="#rtmp">7.10 rtmp</a></li>
-    <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">7.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
-    <li><a name="toc-rtp" href="#rtp">7.12 rtp</a></li>
-    <li><a name="toc-rtsp" href="#rtsp">7.13 rtsp</a></li>
-    <li><a name="toc-sap" href="#sap">7.14 sap</a>
-    <ul class="toc">
-      <li><a name="toc-Muxer" href="#Muxer">7.14.1 Muxer</a></li>
-      <li><a name="toc-Demuxer" href="#Demuxer">7.14.2 Demuxer</a></li>
-    </ul></li>
-    <li><a name="toc-tcp" href="#tcp">7.15 tcp</a></li>
-    <li><a name="toc-udp" href="#udp">7.16 udp</a></li>
-  </ul></li>
-  <li><a name="toc-Input-Devices" href="#Input-Devices">8. Input Devices</a>
-  <ul class="toc">
-    <li><a name="toc-alsa" href="#alsa">8.1 alsa</a></li>
-    <li><a name="toc-bktr" href="#bktr">8.2 bktr</a></li>
-    <li><a name="toc-dv1394" href="#dv1394">8.3 dv1394</a></li>
-    <li><a name="toc-fbdev" href="#fbdev">8.4 fbdev</a></li>
-    <li><a name="toc-jack" href="#jack">8.5 jack</a></li>
-    <li><a name="toc-libdc1394" href="#libdc1394">8.6 libdc1394</a></li>
-    <li><a name="toc-oss" href="#oss">8.7 oss</a></li>
-    <li><a name="toc-sndio" href="#sndio">8.8 sndio</a></li>
-    <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">8.9 video4linux and video4linux2</a></li>
-    <li><a name="toc-vfwcap" href="#vfwcap">8.10 vfwcap</a></li>
-    <li><a name="toc-x11grab" href="#x11grab">8.11 x11grab</a></li>
-  </ul>
-</li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="Synopsis"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Synopsis">1. Synopsis</a></h1>
-
-<p>The generic syntax is:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffprobe [options] [&lsquo;<tt>input_file</tt>&rsquo;]
-</pre></td></tr></table>
-
-<a name="Description"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Description">2. Description</a></h1>
-
-<p>ffprobe gathers information from multimedia streams and prints it in
-human- and machine-readable fashion.
-</p>
-<p>For example it can be used to check the format of the container used
-by a multimedia stream and the format and type of each media stream
-contained in it.
-</p>
-<p>If a filename is specified in input, ffprobe will try to open and
-probe the file content. If the file cannot be opened or recognized as
-a multimedia file, a positive exit code is returned.
-</p>
-<p>ffprobe may be employed both as a standalone application or in
-combination with a textual filter, which may perform more
-sophisticated processing, e.g. statistical processing or plotting.
-</p>
-<p>Options are used to list some of the formats supported by ffprobe or
-for specifying which information to display, and for setting how
-ffprobe will show it.
-</p>
-<p>ffprobe output is designed to be easily parsable by a textual filter,
-and consists of one or more sections of the form:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[SECTION]
-key1=val1
-...
-keyN=valN
-[/SECTION]
-</pre></td></tr></table>
-
-<p>Metadata tags stored in the container or in the streams are recognized
-and printed in the corresponding &quot;FORMAT&quot; or &quot;STREAM&quot; section, and
-are prefixed by the string &quot;TAG:&quot;.
-</p>
-
-<a name="Options"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Options">3. Options</a></h1>
-
-<p>All the numerical options, if not specified otherwise, accept in input
-a string representing a number, which may contain one of the
-International System number postfixes, for example &rsquo;K&rsquo;, &rsquo;M&rsquo;, &rsquo;G&rsquo;.
-If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used instead of
-powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8, and can be
-appended after another postfix or used alone. This allows using for
-example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
-</p>
-<p>Options which do not take arguments are boolean options, and set the
-corresponding value to true. They can be set to false by prefixing
-with &quot;no&quot; the option name, for example using &quot;-nofoo&quot; in the
-commandline will set to false the boolean option with name &quot;foo&quot;.
-</p>
-<a name="Generic-options"></a>
-<h2 class="section"><a href="ffprobe.html#toc-Generic-options">3.1 Generic options</a></h2>
-
-<p>These options are shared amongst the ff* tools.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
-<dd><p>Show license.
-</p>
-</dd>
-<dt> &lsquo;<samp>-h, -?, -help, --help</samp>&rsquo;</dt>
-<dd><p>Show help.
-</p>
-</dd>
-<dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
-<dd><p>Show version.
-</p>
-</dd>
-<dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
-<dd><p>Show available formats.
-</p>
-<p>The fields preceding the format names have the following meanings:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Decoding available
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Encoding available
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
-<dd><p>Show available codecs.
-</p>
-<p>The fields preceding the codec names have the following meanings:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Decoding available
-</p></dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Encoding available
-</p></dd>
-<dt> &lsquo;<samp>V/A/S</samp>&rsquo;</dt>
-<dd><p>Video/audio/subtitle codec
-</p></dd>
-<dt> &lsquo;<samp>S</samp>&rsquo;</dt>
-<dd><p>Codec supports slices
-</p></dd>
-<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
-<dd><p>Codec supports direct rendering
-</p></dd>
-<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
-<dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
-<dd><p>Show available bitstream filters.
-</p>
-</dd>
-<dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
-<dd><p>Show available protocols.
-</p>
-</dd>
-<dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
-<dd><p>Show available libavfilter filters.
-</p>
-</dd>
-<dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
-<dd><p>Show available pixel formats.
-</p>
-</dd>
-<dt> &lsquo;<samp>-loglevel <var>loglevel</var></samp>&rsquo;</dt>
-<dd><p>Set the logging level used by the library.
-<var>loglevel</var> is a number or a string containing one of the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>error</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>info</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
-</dl>
-
-<p>By default the program logs to stderr, if coloring is supported by the
-terminal, colors are used to mark errors and warnings. Log coloring
-can be disabled setting the environment variable
-<code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
-the environment variable <code>FFMPEG_FORCE_COLOR</code>.
-The use of the environment variable <code>NO_COLOR</code> is deprecated and
-will be dropped in a following FFmpeg version.
-</p>
-</dd>
-</dl>
-
-<a name="Main-options"></a>
-<h2 class="section"><a href="ffprobe.html#toc-Main-options">3.2 Main options</a></h2>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>-f <var>format</var></samp>&rsquo;</dt>
-<dd><p>Force format to use.
-</p>
-</dd>
-<dt> &lsquo;<samp>-unit</samp>&rsquo;</dt>
-<dd><p>Show the unit of the displayed values.
-</p>
-</dd>
-<dt> &lsquo;<samp>-prefix</samp>&rsquo;</dt>
-<dd><p>Use SI prefixes for the displayed values.
-Unless the &quot;-byte_binary_prefix&quot; option is used all the prefixes
-are decimal.
-</p>
-</dd>
-<dt> &lsquo;<samp>-byte_binary_prefix</samp>&rsquo;</dt>
-<dd><p>Force the use of binary prefixes for byte values.
-</p>
-</dd>
-<dt> &lsquo;<samp>-sexagesimal</samp>&rsquo;</dt>
-<dd><p>Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
-</p>
-</dd>
-<dt> &lsquo;<samp>-pretty</samp>&rsquo;</dt>
-<dd><p>Prettify the format of the displayed values, it corresponds to the
-options &quot;-unit -prefix -byte_binary_prefix -sexagesimal&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>-show_format</samp>&rsquo;</dt>
-<dd><p>Show information about the container format of the input multimedia
-stream.
-</p>
-<p>All the container format information is printed within a section with
-name &quot;FORMAT&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>-show_packets</samp>&rsquo;</dt>
-<dd><p>Show information about each packet contained in the input multimedia
-stream.
-</p>
-<p>The information for each single packet is printed within a dedicated
-section with name &quot;PACKET&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>-show_streams</samp>&rsquo;</dt>
-<dd><p>Show information about each media stream contained in the input
-multimedia stream.
-</p>
-<p>Each media stream information is printed within a dedicated section
-with name &quot;STREAM&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>-i <var>input_file</var></samp>&rsquo;</dt>
-<dd><p>Read <var>input_file</var>.
-</p>
-</dd>
-</dl>
-
-<a name="Decoders"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Decoders">4. Decoders</a></h1>
-
-<p>Decoders are configured elements in FFmpeg which allow the decoding of
-multimedia streams.
-</p>
-<p>When you configure your FFmpeg build, all the supported native decoders
-are enabled by default. Decoders requiring an external library must be enabled
-manually via the corresponding <code>--enable-lib</code> option. You can list all
-available decoders using the configure option <code>--list-decoders</code>.
-</p>
-<p>You can disable all the decoders with the configure option
-<code>--disable-decoders</code> and selectively enable / disable single decoders
-with the options <code>--enable-decoder=<var>DECODER</var></code> /
-<code>--disable-decoder=<var>DECODER</var></code>.
-</p>
-<p>The option <code>-codecs</code> of the ff* tools will display the list of
-enabled decoders.
-</p>
-
-<a name="Video-Decoders"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Video-Decoders">5. Video Decoders</a></h1>
-
-<p>A description of some of the currently available video decoders
-follows.
-</p>
-<a name="rawvideo"></a>
-<h2 class="section"><a href="ffprobe.html#toc-rawvideo">5.1 rawvideo</a></h2>
-
-<p>Rawvideo decoder.
-</p>
-<p>This decoder decodes rawvideo streams.
-</p>
-<a name="Options-1"></a>
-<h3 class="subsection"><a href="ffprobe.html#toc-Options-1">5.1.1 Options</a></h3>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
-<dd><p>Specify the assumed field type of the input video.
-</p><dl compact="compact">
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>the video is assumed to be progressive (default)
-</p></dd>
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>bottom-field-first is assumed
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>top-field-first is assumed
-</p></dd>
-</dl>
-
-</dd>
-</dl>
-
-<a name="Demuxers"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Demuxers">6. Demuxers</a></h1>
-
-<p>Demuxers are configured elements in FFmpeg which allow to read the
-multimedia streams from a particular type of file.
-</p>
-<p>When you configure your FFmpeg build, all the supported demuxers
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-demuxers&quot;.
-</p>
-<p>You can disable all the demuxers using the configure option
-&quot;&ndash;disable-demuxers&quot;, and selectively enable a single demuxer with
-the option &quot;&ndash;enable-demuxer=<var>DEMUXER</var>&quot;, or disable it
-with the option &quot;&ndash;disable-demuxer=<var>DEMUXER</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-enabled demuxers.
-</p>
-<p>The description of some of the currently available demuxers follows.
-</p>
-<a name="image2"></a>
-<h2 class="section"><a href="ffprobe.html#toc-image2">6.1 image2</a></h2>
-
-<p>Image file demuxer.
-</p>
-<p>This demuxer reads from a list of image files specified by a pattern.
-</p>
-<p>The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
-specifies the position of the characters representing a sequential
-number in each filename matched by the pattern. If the form
-&quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
-filename is 0-padded and <var>N</var> is the total number of 0-padded
-digits representing the number. The literal character &rsquo;%&rsquo; can be
-specified in the pattern with the string &quot;%%&quot;.
-</p>
-<p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
-the file list specified by the pattern must contain a number
-inclusively contained between 0 and 4, all the following numbers must
-be sequential. This limitation may be hopefully fixed.
-</p>
-<p>The pattern may contain a suffix which is used to automatically
-determine the format of the images contained in the files.
-</p>
-<p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
-filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
-&lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
-sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
-&lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
-</p>
-<p>The size, the pixel format, and the format of each image must be the
-same for all the files in the sequence.
-</p>
-<p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
-video from the images in the file sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;,
-&lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an input framerate of 10 frames per
-second:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
-</pre></td></tr></table>
-
-<p>Note that the pattern must not necessarily contain &quot;%d&quot; or
-&quot;%0<var>N</var>d&quot;, for example to convert a single image file
-&lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
-</pre></td></tr></table>
-
-<a name="applehttp-1"></a>
-<h2 class="section"><a href="ffprobe.html#toc-applehttp-1">6.2 applehttp</a></h2>
-
-<p>Apple HTTP Live Streaming demuxer.
-</p>
-<p>This demuxer presents all AVStreams from all variant streams.
-The id field is set to the bitrate variant index number. By setting
-the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
-the caller can decide which variant streams to actually receive.
-The total bitrate of the variant that the stream belongs to is
-available in a metadata key named &quot;variant_bitrate&quot;.
-</p>
-<a name="Protocols"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Protocols">7. Protocols</a></h1>
-
-<p>Protocols are configured elements in FFmpeg which allow to access
-resources which require the use of a particular protocol.
-</p>
-<p>When you configure your FFmpeg build, all the supported protocols are
-enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-protocols&quot;.
-</p>
-<p>You can disable all the protocols using the configure option
-&quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
-option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
-particular protocol using the option
-&quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
-</p>
-<p>The option &quot;-protocols&quot; of the ff* tools will display the list of
-supported protocols.
-</p>
-<p>A description of the currently available protocols follows.
-</p>
-<a name="applehttp"></a>
-<h2 class="section"><a href="ffprobe.html#toc-applehttp">7.1 applehttp</a></h2>
-
-<p>Read Apple HTTP Live Streaming compliant segmented stream as
-a uniform one. The M3U8 playlists describing the segments can be
-remote HTTP resources or local files, accessed using the standard
-file protocol.
-HTTP is default, specific protocol can be declared by specifying
-&quot;+<var>proto</var>&quot; after the applehttp URI scheme name, where <var>proto</var>
-is either &quot;file&quot; or &quot;http&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
-applehttp+http://host/path/to/remote/resource.m3u8
-applehttp+file://path/to/local/resource.m3u8
-</pre></td></tr></table>
-
-<a name="concat"></a>
-<h2 class="section"><a href="ffprobe.html#toc-concat">7.2 concat</a></h2>
-
-<p>Physical concatenation protocol.
-</p>
-<p>Allow to read and seek from many resource in sequence as if they were
-a unique resource.
-</p>
-<p>A URL accepted by this protocol has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
-</pre></td></tr></table>
-
-<p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
-resource to be concatenated, each one possibly specifying a distinct
-protocol.
-</p>
-<p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
-&lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with &lsquo;<tt>ffplay</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
-</pre></td></tr></table>
-
-<p>Note that you may need to escape the character &quot;|&quot; which is special for
-many shells.
-</p>
-<a name="file"></a>
-<h2 class="section"><a href="ffprobe.html#toc-file">7.3 file</a></h2>
-
-<p>File access protocol.
-</p>
-<p>Allow to read from or read to a file.
-</p>
-<p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with &lsquo;<tt>ffmpeg</tt>&rsquo;
-use the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
-</pre></td></tr></table>
-
-<p>The ff* tools default to the file protocol, that is a resource
-specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
-&quot;file:FILE.mpeg&quot;.
-</p>
-<a name="gopher"></a>
-<h2 class="section"><a href="ffprobe.html#toc-gopher">7.4 gopher</a></h2>
-
-<p>Gopher protocol.
-</p>
-<a name="http"></a>
-<h2 class="section"><a href="ffprobe.html#toc-http">7.5 http</a></h2>
-
-<p>HTTP (Hyper Text Transfer Protocol).
-</p>
-<a name="mmst"></a>
-<h2 class="section"><a href="ffprobe.html#toc-mmst">7.6 mmst</a></h2>
-
-<p>MMS (Microsoft Media Server) protocol over TCP.
-</p>
-<a name="mmsh"></a>
-<h2 class="section"><a href="ffprobe.html#toc-mmsh">7.7 mmsh</a></h2>
-
-<p>MMS (Microsoft Media Server) protocol over HTTP.
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
-</pre></td></tr></table>
-
-<a name="md5"></a>
-<h2 class="section"><a href="ffprobe.html#toc-md5">7.8 md5</a></h2>
-
-<p>MD5 output protocol.
-</p>
-<p>Computes the MD5 hash of the data to be written, and on close writes
-this to the designated output or stdout if none is specified. It can
-be used to test muxers without writing an actual file.
-</p>
-<p>Some examples follow.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
-ffmpeg -i input.flv -f avi -y md5:output.avi.md5
-
-# Write the MD5 hash of the encoded AVI file to stdout.
-ffmpeg -i input.flv -f avi -y md5:
-</pre></td></tr></table>
-
-<p>Note that some formats (typically MOV) require the output protocol to
-be seekable, so they will fail with the MD5 output protocol.
-</p>
-<a name="pipe"></a>
-<h2 class="section"><a href="ffprobe.html#toc-pipe">7.9 pipe</a></h2>
-
-<p>UNIX pipe access protocol.
-</p>
-<p>Allow to read and write from UNIX pipes.
-</p>
-<p>The accepted syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
-</pre></td></tr></table>
-
-<p><var>number</var> is the number corresponding to the file descriptor of the
-pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
-is not specified, by default the stdout file descriptor will be used
-for writing, stdin for reading.
-</p>
-<p>For example to read from stdin with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
-# ...this is the same as...
-cat test.wav | ffmpeg -i pipe:
-</pre></td></tr></table>
-
-<p>For writing to stdout with &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
-# ...this is the same as...
-ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
-</pre></td></tr></table>
-
-<p>Note that some formats (typically MOV), require the output protocol to
-be seekable, so they will fail with the pipe output protocol.
-</p>
-<a name="rtmp"></a>
-<h2 class="section"><a href="ffprobe.html#toc-rtmp">7.10 rtmp</a></h2>
-
-<p>Real-Time Messaging Protocol.
-</p>
-<p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
-dia content across a TCP/IP network.
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
-</pre></td></tr></table>
-
-<p>The accepted parameters are:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>server</samp>&rsquo;</dt>
-<dd><p>The address of the RTMP server.
-</p>
-</dd>
-<dt> &lsquo;<samp>port</samp>&rsquo;</dt>
-<dd><p>The number of the TCP port to use (by default is 1935).
-</p>
-</dd>
-<dt> &lsquo;<samp>app</samp>&rsquo;</dt>
-<dd><p>It is the name of the application to access. It usually corresponds to
-the path where the application is installed on the RTMP server
-(e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.).
-</p>
-</dd>
-<dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
-<dd><p>It is the path or name of the resource to play with reference to the
-application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;.
-</p>
-</dd>
-</dl>
-
-<p>For example to read with &lsquo;<tt>ffplay</tt>&rsquo; a multimedia resource named
-&quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
-</pre></td></tr></table>
-
-<a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
-<h2 class="section"><a href="ffprobe.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">7.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
-
-<p>Real-Time Messaging Protocol and its variants supported through
-librtmp.
-</p>
-<p>Requires the presence of the librtmp headers and library during
-configuration. You need to explicitely configure the build with
-&quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
-protocol.
-</p>
-<p>This protocol provides most client functions and a few server
-functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
-encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
-variants of these encrypted types (RTMPTE, RTMPTS).
-</p>
-<p>The required syntax is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
-</pre></td></tr></table>
-
-<p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
-&quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
-<var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
-meaning as specified for the RTMP native protocol.
-<var>options</var> contains a list of space-separated options of the form
-<var>key</var>=<var>val</var>.
-</p>
-<p>See the librtmp manual page (man 3 librtmp) for more information.
-</p>
-<p>For example, to stream a file in real-time to an RTMP server using
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
-</pre></td></tr></table>
-
-<p>To play the same stream using &lsquo;<tt>ffplay</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
-</pre></td></tr></table>
-
-<a name="rtp"></a>
-<h2 class="section"><a href="ffprobe.html#toc-rtp">7.12 rtp</a></h2>
-
-<p>Real-Time Protocol.
-</p>
-<a name="rtsp"></a>
-<h2 class="section"><a href="ffprobe.html#toc-rtsp">7.13 rtsp</a></h2>
-
-<p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
-and muxer. The demuxer supports both normal RTSP (with data transferred
-over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
-data transferred over RDT).
-</p>
-<p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
-supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
-RTSP server, <a href="http://github.com/revmischa/rtsp-server">http://github.com/revmischa/rtsp-server</a>).
-</p>
-<p>The required syntax for a RTSP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<p><var>options</var> is a <code>&amp;</code>-separated list. The following options
-are supported:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
-<dd><p>Use UDP as lower transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
-<dd><p>Use TCP (interleaving within the RTSP control channel) as lower
-transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>multicast</samp>&rsquo;</dt>
-<dd><p>Use UDP multicast as lower transport protocol.
-</p>
-</dd>
-<dt> &lsquo;<samp>http</samp>&rsquo;</dt>
-<dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
-passing proxies.
-</p>
-</dd>
-<dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
-<dd><p>Accept packets only from negotiated peer address and port.
-</p></dd>
-</dl>
-
-<p>Multiple lower transport protocols may be specified, in that case they are
-tried one at a time (if the setup of one fails, the next one is tried).
-For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
-</p>
-<p>When receiving data over UDP, the demuxer tries to reorder received packets
-(since they may arrive out of order, or packets may get lost totally). In
-order for this to be enabled, a maximum delay must be specified in the
-<code>max_delay</code> field of AVFormatContext.
-</p>
-<p>When watching multi-bitrate Real-RTSP streams with &lsquo;<tt>ffplay</tt>&rsquo;, the
-streams to display can be chosen with <code>-vst</code> <var>n</var> and
-<code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
-on the fly by pressing <code>v</code> and <code>a</code>.
-</p>
-<p>Example command lines:
-</p>
-<p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
-</pre></td></tr></table>
-
-<p>To watch a stream tunneled over HTTP:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtsp://server/video.mp4?http
-</pre></td></tr></table>
-
-<p>To send a stream in realtime to a RTSP server, for others to watch:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
-</pre></td></tr></table>
-
-<a name="sap"></a>
-<h2 class="section"><a href="ffprobe.html#toc-sap">7.14 sap</a></h2>
-
-<p>Session Announcement Protocol (RFC 2974). This is not technically a
-protocol handler in libavformat, it is a muxer and demuxer.
-It is used for signalling of RTP streams, by announcing the SDP for the
-streams regularly on a separate port.
-</p>
-<a name="Muxer"></a>
-<h3 class="subsection"><a href="ffprobe.html#toc-Muxer">7.14.1 Muxer</a></h3>
-
-<p>The syntax for a SAP url given to the muxer is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
-</pre></td></tr></table>
-
-<p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
-or to port 5004 if no port is specified.
-<var>options</var> is a <code>&amp;</code>-separated list. The following options
-are supported:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
-<dd><p>Specify the destination IP address for sending the announcements to.
-If omitted, the announcements are sent to the commonly used SAP
-announcement multicast address 224.2.127.254 (sap.mcast.net), or
-ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
-</p>
-</dd>
-<dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
-<dd><p>Specify the port to send the announcements on, defaults to
-9875 if not specified.
-</p>
-</dd>
-<dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
-<dd><p>Specify the time to live value for the announcements and RTP packets,
-defaults to 255.
-</p>
-</dd>
-<dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
-<dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
-default), all streams are sent on unique ports, with each stream on a
-port 2 numbers higher than the previous.
-VLC/Live555 requires this to be set to 1, to be able to receive the stream.
-The RTP stack in libavformat for receiving requires all streams to be sent
-on unique ports.
-</p></dd>
-</dl>
-
-<p>Example command lines follow.
-</p>
-<p>To broadcast a stream on the local subnet, for watching in VLC:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
-</pre></td></tr></table>
-
-<p>Similarly, for watching in ffplay:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
-</pre></td></tr></table>
-
-<p>And for watching in ffplay, over IPv6:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
-</pre></td></tr></table>
-
-<a name="Demuxer"></a>
-<h3 class="subsection"><a href="ffprobe.html#toc-Demuxer">7.14.2 Demuxer</a></h3>
-
-<p>The syntax for a SAP url given to the demuxer is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
-</pre></td></tr></table>
-
-<p><var>address</var> is the multicast address to listen for announcements on,
-if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
-is the port that is listened on, 9875 if omitted.
-</p>
-<p>The demuxers listens for announcements on the given address and port.
-Once an announcement is received, it tries to receive that particular stream.
-</p>
-<p>Example command lines follow.
-</p>
-<p>To play back the first stream announced on the normal SAP multicast address:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
-</pre></td></tr></table>
-
-<p>To play back the first stream announced on one the default IPv6 SAP multicast address:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
-</pre></td></tr></table>
-
-<a name="tcp"></a>
-<h2 class="section"><a href="ffprobe.html#toc-tcp">7.15 tcp</a></h2>
-
-<p>Trasmission Control Protocol.
-</p>
-<p>The required syntax for a TCP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
-<dd><p>Listen for an incoming connection
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
-ffplay tcp://<var>hostname</var>:<var>port</var>
-</pre></td></tr></table>
-
-</dd>
-</dl>
-
-<a name="udp"></a>
-<h2 class="section"><a href="ffprobe.html#toc-udp">7.16 udp</a></h2>
-
-<p>User Datagram Protocol.
-</p>
-<p>The required syntax for a UDP url is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
-</pre></td></tr></table>
-
-<p><var>options</var> contains a list of &amp;-seperated options of the form <var>key</var>=<var>val</var>.
-Follow the list of supported options.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
-<dd><p>set the UDP buffer size in bytes
-</p>
-</dd>
-<dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
-<dd><p>override the local UDP port to bind with
-</p>
-</dd>
-<dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
-<dd><p>set the size in bytes of UDP packets
-</p>
-</dd>
-<dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
-<dd><p>explicitly allow or disallow reusing UDP sockets
-</p>
-</dd>
-<dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
-<dd><p>set the time to live value (for multicast only)
-</p>
-</dd>
-<dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
-<dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
-destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
-If the destination address isn&rsquo;t known at the start, this option can
-be specified in ff_udp_set_remote_url, too.
-This allows finding out the source address for the packets with getsockname,
-and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
-unreachable&quot; is received.
-For receiving, this gives the benefit of only receiving packets from
-the specified peer address/port.
-</p></dd>
-</dl>
-
-<p>Some usage examples of the udp protocol with &lsquo;<tt>ffmpeg</tt>&rsquo; follow.
-</p>
-<p>To stream over UDP to a remote endpoint:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
-</pre></td></tr></table>
-
-<p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
-</pre></td></tr></table>
-
-<p>To receive over UDP from a remote endpoint:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
-</pre></td></tr></table>
-
-<a name="Input-Devices"></a>
-<h1 class="chapter"><a href="ffprobe.html#toc-Input-Devices">8. Input Devices</a></h1>
-
-<p>Input devices are configured elements in FFmpeg which allow to access
-the data coming from a multimedia device attached to your system.
-</p>
-<p>When you configure your FFmpeg build, all the supported input devices
-are enabled by default. You can list all available ones using the
-configure option &quot;&ndash;list-indevs&quot;.
-</p>
-<p>You can disable all the input devices using the configure option
-&quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
-option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
-input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
-</p>
-<p>The option &quot;-formats&quot; of the ff* tools will display the list of
-supported input devices (amongst the demuxers).
-</p>
-<p>A description of the currently available input devices follows.
-</p>
-<a name="alsa"></a>
-<h2 class="section"><a href="ffprobe.html#toc-alsa">8.1 alsa</a></h2>
-
-<p>ALSA (Advanced Linux Sound Architecture) input device.
-</p>
-<p>To enable this input device during configuration you need libasound
-installed on your system.
-</p>
-<p>This device allows capturing from an ALSA device. The name of the
-device to capture has to be an ALSA card identifier.
-</p>
-<p>An ALSA identifier has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
-</pre></td></tr></table>
-
-<p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
-</p>
-<p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
-specify card number or identifier, device number and subdevice number
-(-1 means any).
-</p>
-<p>To see the list of cards currently recognized by your system check the
-files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
-</p>
-<p>For example to capture with &lsquo;<tt>ffmpeg</tt>&rsquo; from an ALSA device with
-card id 0, you may run the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
-</pre></td></tr></table>
-
-<p>For more information see:
-<a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
-</p>
-<a name="bktr"></a>
-<h2 class="section"><a href="ffprobe.html#toc-bktr">8.2 bktr</a></h2>
-
-<p>BSD video input device.
-</p>
-<a name="dv1394"></a>
-<h2 class="section"><a href="ffprobe.html#toc-dv1394">8.3 dv1394</a></h2>
-
-<p>Linux DV 1394 input device.
-</p>
-<a name="fbdev"></a>
-<h2 class="section"><a href="ffprobe.html#toc-fbdev">8.4 fbdev</a></h2>
-
-<p>Linux framebuffer input device.
-</p>
-<p>The Linux framebuffer is a graphic hardware-independent abstraction
-layer to show graphics on a computer monitor, typically on the
-console. It is accessed through a file device node, usually
-&lsquo;<tt>/dev/fb0</tt>&rsquo;.
-</p>
-<p>For more detailed information read the file
-Documentation/fb/framebuffer.txt included in the Linux source tree.
-</p>
-<p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
-</pre></td></tr></table>
-
-<p>You can take a single screenshot image with the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
-</pre></td></tr></table>
-
-<p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
-</p>
-<a name="jack"></a>
-<h2 class="section"><a href="ffprobe.html#toc-jack">8.5 jack</a></h2>
-
-<p>JACK input device.
-</p>
-<p>To enable this input device during configuration you need libjack
-installed on your system.
-</p>
-<p>A JACK input device creates one or more JACK writable clients, one for
-each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
-<var>client_name</var> is the name provided by the application, and <var>N</var>
-is a number which identifies the channel.
-Each writable client will send the acquired data to the FFmpeg input
-device.
-</p>
-<p>Once you have created one or more JACK readable clients, you need to
-connect them to one or more JACK writable clients.
-</p>
-<p>To connect or disconnect JACK clients you can use the
-&lsquo;<tt>jack_connect</tt>&rsquo; and &lsquo;<tt>jack_disconnect</tt>&rsquo; programs, or do it
-through a graphical interface, for example with &lsquo;<tt>qjackctl</tt>&rsquo;.
-</p>
-<p>To list the JACK clients and their properties you can invoke the command
-&lsquo;<tt>jack_lsp</tt>&rsquo;.
-</p>
-<p>Follows an example which shows how to capture a JACK readable client
-with &lsquo;<tt>ffmpeg</tt>&rsquo;.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
-$ ffmpeg -f jack -i ffmpeg -y out.wav
-
-# Start the sample jack_metro readable client.
-$ jack_metro -b 120 -d 0.2 -f 4000
-
-# List the current JACK clients.
-$ jack_lsp -c
-system:capture_1
-system:capture_2
-system:playback_1
-system:playback_2
-ffmpeg:input_1
-metro:120_bpm
-
-# Connect metro to the ffmpeg writable client.
-$ jack_connect metro:120_bpm ffmpeg:input_1
-</pre></td></tr></table>
-
-<p>For more information read:
-<a href="http://jackaudio.org/">http://jackaudio.org/</a>
-</p>
-<a name="libdc1394"></a>
-<h2 class="section"><a href="ffprobe.html#toc-libdc1394">8.6 libdc1394</a></h2>
-
-<p>IIDC1394 input device, based on libdc1394 and libraw1394.
-</p>
-<a name="oss"></a>
-<h2 class="section"><a href="ffprobe.html#toc-oss">8.7 oss</a></h2>
-
-<p>Open Sound System input device.
-</p>
-<p>The filename to provide to the input device is the device node
-representing the OSS input device, and is usually set to
-&lsquo;<tt>/dev/dsp</tt>&rsquo;.
-</p>
-<p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
-</pre></td></tr></table>
-
-<p>For more information about OSS see:
-<a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
-</p>
-<a name="sndio"></a>
-<h2 class="section"><a href="ffprobe.html#toc-sndio">8.8 sndio</a></h2>
-
-<p>sndio input device.
-</p>
-<p>To enable this input device during configuration you need libsndio
-installed on your system.
-</p>
-<p>The filename to provide to the input device is the device node
-representing the sndio input device, and is usually set to
-&lsquo;<tt>/dev/audio0</tt>&rsquo;.
-</p>
-<p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
-command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
-</pre></td></tr></table>
-
-<a name="video4linux-and-video4linux2"></a>
-<h2 class="section"><a href="ffprobe.html#toc-video4linux-and-video4linux2">8.9 video4linux and video4linux2</a></h2>
-
-<p>Video4Linux and Video4Linux2 input video devices.
-</p>
-<p>The name of the device to grab is a file device node, usually Linux
-systems tend to automatically create such nodes when the device
-(e.g. an USB webcam) is plugged into the system, and has a name of the
-kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
-the device.
-</p>
-<p>Video4Linux and Video4Linux2 devices only support a limited set of
-<var>width</var>x<var>height</var> sizes and framerates. You can check which are
-supported for example with the command &lsquo;<tt>dov4l</tt>&rsquo; for Video4Linux
-devices and the command &lsquo;<tt>v4l-info</tt>&rsquo; for Video4Linux2 devices.
-</p>
-<p>If the size for the device is set to 0x0, the input device will
-try to autodetect the size to use.
-Only for the video4linux2 device, if the frame rate is set to 0/0 the
-input device will use the frame rate value already set in the driver.
-</p>
-<p>Video4Linux support is deprecated since Linux 2.6.30, and will be
-dropped in later versions.
-</p>
-<p>Follow some usage examples of the video4linux devices with the ff*
-tools.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
-# to the default of 25/1.
-ffplay -s 320x240 -f video4linux /dev/video0
-
-# Grab and show the input of a video4linux2 device, autoadjust size.
-ffplay -f video4linux2 /dev/video0
-
-# Grab and record the input of a video4linux2 device, autoadjust size,
-# frame rate value defaults to 0/0 so it is read from the video4linux2
-# driver.
-ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
-</pre></td></tr></table>
-
-<a name="vfwcap"></a>
-<h2 class="section"><a href="ffprobe.html#toc-vfwcap">8.10 vfwcap</a></h2>
-
-<p>VfW (Video for Windows) capture input device.
-</p>
-<p>The filename passed as input is the capture driver number, ranging from
-0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
-other filename will be interpreted as device number 0.
-</p>
-<a name="x11grab"></a>
-<h2 class="section"><a href="ffprobe.html#toc-x11grab">8.11 x11grab</a></h2>
-
-<p>X11 video input device.
-</p>
-<p>This device allows to capture a region of an X11 display.
-</p>
-<p>The filename passed as input has the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
-</pre></td></tr></table>
-
-<p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
-X11 display name of the screen to grab from. <var>hostname</var> can be
-ommitted, and defaults to &quot;localhost&quot;. The environment variable
-<code>DISPLAY</code> contains the default display name.
-</p>
-<p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
-area with respect to the top-left border of the X11 screen. They
-default to 0.
-</p>
-<p>Check the X11 documentation (e.g. man X) for more detailed information.
-</p>
-<p>Use the &lsquo;<tt>dpyinfo</tt>&rsquo; program for getting basic information about the
-properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
-</p>
-<p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
-
-# Grab at position 10,20.
-ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
-</pre></td></tr></table>
-
-
-
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/doc/general.html b/ffmpeg 0.7/doc/general.html
deleted file mode 100644 (file)
index defdf3f..0000000
+++ /dev/null
@@ -1,1010 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>General Documentation</title>
-
-<meta name="description" content="General Documentation">
-<meta name="keywords" content="General Documentation">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">General Documentation</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-external-libraries" href="#external-libraries">1. external libraries</a>
-  <ul class="toc">
-    <li><a name="toc-OpenCORE-AMR" href="#OpenCORE-AMR">1.1 OpenCORE AMR</a></li>
-  </ul></li>
-  <li><a name="toc-Supported-File-Formats-and-Codecs" href="#Supported-File-Formats-and-Codecs">2. Supported File Formats and Codecs</a>
-  <ul class="toc">
-    <li><a name="toc-File-Formats" href="#File-Formats">2.1 File Formats</a></li>
-    <li><a name="toc-Image-Formats" href="#Image-Formats">2.2 Image Formats</a></li>
-    <li><a name="toc-Video-Codecs" href="#Video-Codecs">2.3 Video Codecs</a></li>
-    <li><a name="toc-Audio-Codecs" href="#Audio-Codecs">2.4 Audio Codecs</a></li>
-    <li><a name="toc-Subtitle-Formats" href="#Subtitle-Formats">2.5 Subtitle Formats</a></li>
-    <li><a name="toc-Network-Protocols" href="#Network-Protocols">2.6 Network Protocols</a></li>
-    <li><a name="toc-Input_002fOutput-Devices" href="#Input_002fOutput-Devices">2.7 Input/Output Devices</a></li>
-  </ul></li>
-  <li><a name="toc-Platform-Specific-information" href="#Platform-Specific-information">3. Platform Specific information</a>
-  <ul class="toc">
-    <li><a name="toc-DOS" href="#DOS">3.1 DOS</a></li>
-    <li><a name="toc-OS_002f2" href="#OS_002f2">3.2 OS/2</a></li>
-    <li><a name="toc-Unix_002dlike" href="#Unix_002dlike">3.3 Unix-like</a>
-    <ul class="toc">
-      <li><a name="toc-BSD" href="#BSD">3.3.1 BSD</a></li>
-      <li><a name="toc-_0028Open_0029Solaris" href="#g_t_0028Open_0029Solaris">3.3.2 (Open)Solaris</a></li>
-      <li><a name="toc-Darwin-_0028MacOS-X_002c-iPhone_0029" href="#Darwin-_0028MacOS-X_002c-iPhone_0029">3.3.3 Darwin (MacOS X, iPhone)</a></li>
-    </ul></li>
-    <li><a name="toc-Windows" href="#Windows">3.4 Windows</a>
-    <ul class="toc">
-      <li><a name="toc-Native-Windows-compilation" href="#Native-Windows-compilation">3.4.1 Native Windows compilation</a></li>
-      <li><a name="toc-Microsoft-Visual-C_002b_002b-compatibility" href="#Microsoft-Visual-C_002b_002b-compatibility">3.4.2 Microsoft Visual C++ compatibility</a>
-      <ul class="toc">
-        <li><a name="toc-Using-static-libraries" href="#Using-static-libraries">3.4.2.1 Using static libraries</a></li>
-        <li><a name="toc-Using-shared-libraries" href="#Using-shared-libraries">3.4.2.2 Using shared libraries</a></li>
-      </ul></li>
-      <li><a name="toc-Cross-compilation-for-Windows-with-Linux" href="#Cross-compilation-for-Windows-with-Linux">3.4.3 Cross compilation for Windows with Linux</a></li>
-      <li><a name="toc-Compilation-under-Cygwin" href="#Compilation-under-Cygwin">3.4.4 Compilation under Cygwin</a></li>
-      <li><a name="toc-Crosscompilation-for-Windows-under-Cygwin" href="#Crosscompilation-for-Windows-under-Cygwin">3.4.5 Crosscompilation for Windows under Cygwin</a></li>
-    </ul>
-</li>
-  </ul>
-</li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="external-libraries"></a>
-<h1 class="chapter"><a href="general.html#toc-external-libraries">1. external libraries</a></h1>
-
-<p>FFmpeg can be hooked up with a number of external libraries to add support
-for more formats. None of them are used by default, their use has to be
-explicitly requested by passing the appropriate flags to &lsquo;<tt>./configure</tt>&rsquo;.
-</p>
-<a name="OpenCORE-AMR"></a>
-<h2 class="section"><a href="general.html#toc-OpenCORE-AMR">1.1 OpenCORE AMR</a></h2>
-
-<p>FFmpeg can make use of the OpenCORE libraries for AMR-NB
-decoding/encoding and AMR-WB decoding.
-</p>
-<p>Go to <a href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the instructions for
-installing the libraries. Then pass <code>--enable-libopencore-amrnb</code> and/or
-<code>--enable-libopencore-amrwb</code> to configure to enable the libraries.
-</p>
-<p>Note that OpenCORE is under the Apache License 2.0 (see
-<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a> for details), which is
-incompatible with the LGPL version 2.1 and GPL version 2. You have to
-upgrade FFmpeg&rsquo;s license to LGPL version 3 (or if you have enabled
-GPL components, GPL version 3) to use it.
-</p>
-
-<a name="Supported-File-Formats-and-Codecs"></a>
-<h1 class="chapter"><a href="general.html#toc-Supported-File-Formats-and-Codecs">2. Supported File Formats and Codecs</a></h1>
-
-<p>You can use the <code>-formats</code> and <code>-codecs</code> options to have an exhaustive list.
-</p>
-<a name="File-Formats"></a>
-<h2 class="section"><a href="general.html#toc-File-Formats">2.1 File Formats</a></h2>
-
-<p>FFmpeg supports the following file formats through the <code>libavformat</code>
-library:
-</p>
-<table>
-<tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
-<tr><td width="40%">4xm</td><td width="10%"></td><td width="10%">X</td><td width="40%">4X Technologies format, used in some games.</td></tr>
-<tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Adobe Filmstrip</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Audio IFF (AIFF)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">American Laser Games MM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in games like Mad Dog McCree.</td></tr>
-<tr><td width="40%">3GPP AMR</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ASF</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">AVISynth</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">AVS</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by the Creature Shock game.</td></tr>
-<tr><td width="40%">Beam Software SIFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio and video format used in some games by Beam Software.</td></tr>
-<tr><td width="40%">Bethesda Softworks VID</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some games from Bethesda Softworks.</td></tr>
-<tr><td width="40%">Bink</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by many games.</td></tr>
-<tr><td width="40%">Bitmap Brothers JV</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Z and Z95 games.</td></tr>
-<tr><td width="40%">Brute Force &amp; Ignorance</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Flash Traffic: City of Angels.</td></tr>
-<tr><td width="40%">Interplay C93</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Cyberia from Interplay.</td></tr>
-<tr><td width="40%">Delphine Software International CIN</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by Delphine Software games.</td></tr>
-<tr><td width="40%">CD+G</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video format used by CD+G karaoke disks</td></tr>
-<tr><td width="40%">Core Audio Format</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Apple Core Audio Format</td></tr>
-<tr><td width="40%">CRC testing format</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">Creative Voice</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Created for the Sound Blaster Pro.</td></tr>
-<tr><td width="40%">CRYO APC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in some games by CRYO Interactive Entertainment.</td></tr>
-<tr><td width="40%">D-Cinema audio</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">DFA</td><td width="10%"></td><td width="10%">X</td><td width="40%">This format is used in Chronomaster game</td></tr>
-<tr><td width="40%">DV video</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">DXA</td><td width="10%"></td><td width="10%">X</td><td width="40%">This format is used in the non-Windows version of the Feeble Files
-         game and different game cutscenes repacked for use with ScummVM.</td></tr>
-<tr><td width="40%">Electronic Arts cdata</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Electronic Arts Multimedia</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various EA games; files have extensions like WVE and UV2.</td></tr>
-<tr><td width="40%">FFM (FFserver live feed)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Flash (SWF)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Flash 9 (AVM2)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Only embedded audio is decoded.</td></tr>
-<tr><td width="40%">FLI/FLC/FLX animation</td><td width="10%"></td><td width="10%">X</td><td width="40%">.fli/.flc files</td></tr>
-<tr><td width="40%">Flash Video (FLV)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Macromedia Flash video files</td></tr>
-<tr><td width="40%">framecrc testing format</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">FunCom ISS</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in various games from FunCom like The Longest Journey.</td></tr>
-<tr><td width="40%">GIF Animation</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td><td width="40%">General eXchange Format SMPTE 360M, used by Thomson Grass Valley
-         playout servers.</td></tr>
-<tr><td width="40%">id Quake II CIN video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">id RoQ</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Quake III, Jedi Knight 2, other computer games.</td></tr>
-<tr><td width="40%">IEC61937 encapsulation</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">IFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Interchange File Format</td></tr>
-<tr><td width="40%">Interplay MVE</td><td width="10%"></td><td width="10%">X</td><td width="40%">Format used in various Interplay computer games.</td></tr>
-<tr><td width="40%">IV8</td><td width="10%"></td><td width="10%">X</td><td width="40%">A format generated by IndigoVision 8000 video server.</td></tr>
-<tr><td width="40%">IVF (On2)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">A format used by libvpx</td></tr>
-<tr><td width="40%">LMLM4</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by Linux Media Labs MPEG-4 PCI boards</td></tr>
-<tr><td width="40%">LXF</td><td width="10%"></td><td width="10%">X</td><td width="40%">VR native stream format, used by Leitch/Harris&rsquo; video servers.</td></tr>
-<tr><td width="40%">Matroska</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Matroska audio</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">FFmpeg metadata</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Metadata in text format.</td></tr>
-<tr><td width="40%">MAXIS XA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sim City 3000; file extension .xa.</td></tr>
-<tr><td width="40%">MD Studio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Mobotix .mxg</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Motion Pixels MVI</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MOV/QuickTime/MP4</td><td width="10%">X</td><td width="10%">X</td><td width="40%">3GP, 3GP2, PSP, iPod variants supported</td></tr>
-<tr><td width="40%">MP2</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">MP3</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-1 System</td><td width="10%">X</td><td width="10%">X</td><td width="40%">muxed audio and video, VCD format supported</td></tr>
-<tr><td width="40%">MPEG-PS (program stream)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">also known as <code>VOB</code> file, SVCD and DVD format supported</td></tr>
-<tr><td width="40%">MPEG-TS (transport stream)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">also known as DVB Transport Stream</td></tr>
-<tr><td width="40%">MPEG-4</td><td width="10%">X</td><td width="10%">X</td><td width="40%">MPEG-4 is a variant of QuickTime.</td></tr>
-<tr><td width="40%">MIME multipart JPEG</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">MSN TCP webcam</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by MSN Messenger webcam streams.</td></tr>
-<tr><td width="40%">MTV</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Musepack</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Material eXchange Format (MXF)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">SMPTE 377M, used by D-Cinema, broadcast industry.</td></tr>
-<tr><td width="40%">Material eXchange Format (MXF), D-10 Mapping</td><td width="10%">X</td><td width="10%">X</td><td width="40%">SMPTE 386M, D-10/IMX Mapping.</td></tr>
-<tr><td width="40%">NC camera feed</td><td width="10%"></td><td width="10%">X</td><td width="40%">NC (AVIP NC4600) camera streams</td></tr>
-<tr><td width="40%">NTT TwinVQ (VQF)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Nippon Telegraph and Telephone Corporation TwinVQ.</td></tr>
-<tr><td width="40%">Nullsoft Streaming Video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">NuppelVideo</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">NUT</td><td width="10%">X</td><td width="10%">X</td><td width="40%">NUT Open Container Format</td></tr>
-<tr><td width="40%">Ogg</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Playstation Portable PMP</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">TechnoTrend PVA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used by TechnoTrend DVB PCI boards.</td></tr>
-<tr><td width="40%">QCP</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw ADTS (AAC)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw Chinese AVS video</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw CRI ADX</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw Dirac</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw DNxHD</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw DTS</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw E-AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw FLAC</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw GSM</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw H.263</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw H.264</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw Ingenient MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw MLP</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw MPEG</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw MPEG-1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw MPEG-2</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw MPEG-4</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw NULL</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">raw video</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw id RoQ</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">raw Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw TrueHD</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM signed 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM unsigned 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM floating-point 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM floating-point 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM floating-point 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">raw PCM floating-point 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">RDT</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">REDCODE R3D</td><td width="10%"></td><td width="10%">X</td><td width="40%">File format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.</td></tr>
-<tr><td width="40%">RealMedia</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Redirector</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Renderware TeXture Dictionary</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">RL2</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio and video format used in some games by Entertainment Software Partners.</td></tr>
-<tr><td width="40%">RPL/ARMovie</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Lego Mindstorms RSO</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">RTMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Output is performed by publishing stream to RTMP server</td></tr>
-<tr><td width="40%">RTP</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">RTSP</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">SAP</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">SDP</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Sega FILM/CPK</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in many Sega Saturn console games.</td></tr>
-<tr><td width="40%">Sierra SOL</td><td width="10%"></td><td width="10%">X</td><td width="40%">.sol files used in Sierra Online games.</td></tr>
-<tr><td width="40%">Sierra VMD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra CD-ROM games.</td></tr>
-<tr><td width="40%">Smacker</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used by many games.</td></tr>
-<tr><td width="40%">Sony OpenMG (OMA)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Audio format used in Sony Sonic Stage and Sony Vegas.</td></tr>
-<tr><td width="40%">Sony PlayStation STR</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Sony Wave64 (W64)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">SoX native format</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">SUN AU format</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Text files</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">THP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used on the Nintendo GameCube.</td></tr>
-<tr><td width="40%">Tiertex Limited SEQ</td><td width="10%"></td><td width="10%">X</td><td width="40%">Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.</td></tr>
-<tr><td width="40%">True Audio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">VC-1 test bitstream</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">WavPack</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">WebM</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Televison (WTV)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Wing Commander III movie</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in Origin&rsquo;s Wing Commander III computer game.</td></tr>
-<tr><td width="40%">Westwood Studios audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in Westwood Studios games.</td></tr>
-<tr><td width="40%">Westwood Studios VQA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in Westwood Studios games.</td></tr>
-<tr><td width="40%">xWMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft audio container used by XAudio 2.</td></tr>
-<tr><td width="40%">YUV4MPEG pipe</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Psygnosis YOP</td><td width="10%"></td><td width="10%">X</td></tr>
-</table>
-
-<p><code>X</code> means that encoding (resp. decoding) is supported.
-</p>
-<a name="Image-Formats"></a>
-<h2 class="section"><a href="general.html#toc-Image-Formats">2.2 Image Formats</a></h2>
-
-<p>FFmpeg can read and write images for each frame of a video sequence. The
-following image formats are supported:
-</p>
-<table>
-<tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
-<tr><td width="40%">.Y.U.V</td><td width="10%">X</td><td width="10%">X</td><td width="40%">one raw file per component</td></tr>
-<tr><td width="40%">animated GIF</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Only uncompressed GIFs are generated.</td></tr>
-<tr><td width="40%">BMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft BMP image</td></tr>
-<tr><td width="40%">DPX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Digital Picture Exchange</td></tr>
-<tr><td width="40%">JPEG</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Progressive JPEG is not supported.</td></tr>
-<tr><td width="40%">JPEG 2000</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">JPEG-LS</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">LJPEG</td><td width="10%">X</td><td width="10%"></td><td width="40%">Lossless JPEG</td></tr>
-<tr><td width="40%">PAM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PAM is a PNM extension with alpha support.</td></tr>
-<tr><td width="40%">PBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable BitMap image</td></tr>
-<tr><td width="40%">PCX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PC Paintbrush</td></tr>
-<tr><td width="40%">PGM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable GrayMap image</td></tr>
-<tr><td width="40%">PGMYUV</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PGM with U and V components in YUV 4:2:0</td></tr>
-<tr><td width="40%">PIC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Pictor/PC Paint</td></tr>
-<tr><td width="40%">PNG</td><td width="10%">X</td><td width="10%">X</td><td width="40%">2/4 bpp not supported yet</td></tr>
-<tr><td width="40%">PPM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable PixelMap image</td></tr>
-<tr><td width="40%">PTX</td><td width="10%"></td><td width="10%">X</td><td width="40%">V.Flash PTX format</td></tr>
-<tr><td width="40%">SGI</td><td width="10%">X</td><td width="10%">X</td><td width="40%">SGI RGB image format</td></tr>
-<tr><td width="40%">Sun Rasterfile</td><td width="10%"></td><td width="10%">X</td><td width="40%">Sun RAS image format</td></tr>
-<tr><td width="40%">TIFF</td><td width="10%">X</td><td width="10%">X</td><td width="40%">YUV, JPEG and some extension is not supported yet.</td></tr>
-<tr><td width="40%">Truevision Targa</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Targa (.TGA) image format</td></tr>
-</table>
-
-<p><code>X</code> means that encoding (resp. decoding) is supported.
-</p>
-<p><code>E</code> means that support is provided through an external library.
-</p>
-<a name="Video-Codecs"></a>
-<h2 class="section"><a href="general.html#toc-Video-Codecs">2.3 Video Codecs</a></h2>
-
-<table>
-<tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
-<tr><td width="40%">4X Movie</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in certain computer games.</td></tr>
-<tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">8SVX exponential</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">8SVX fibonacci</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">A64 multicolor</td><td width="10%">X</td><td width="10%"></td><td width="40%">Creates video suitable to be played on a commodore 64 (multicolor mode).</td></tr>
-<tr><td width="40%">American Laser Games MM</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in games like Mad Dog McCree.</td></tr>
-<tr><td width="40%">AMV Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Chinese MP3 players.</td></tr>
-<tr><td width="40%">ANSI/ASCII art</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Apple MJPEG-B</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Apple QuickDraw</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: qdrw</td></tr>
-<tr><td width="40%">Asus v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV1</td></tr>
-<tr><td width="40%">Asus v2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV2</td></tr>
-<tr><td width="40%">ATI VCR1</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR1</td></tr>
-<tr><td width="40%">ATI VCR2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR2</td></tr>
-<tr><td width="40%">Auravision Aura</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Auravision Aura 2</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Autodesk Animator Flic video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Autodesk RLE</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: AASC</td></tr>
-<tr><td width="40%">AVS (Audio Video Standard) video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video encoding used by the Creature Shock game.</td></tr>
-<tr><td width="40%">Beam Software VB</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Bethesda VID video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some games from Bethesda Softworks.</td></tr>
-<tr><td width="40%">Bink Video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Bitmap Brothers JV video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Brute Force &amp; Ignorance</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Flash Traffic: City of Angels.</td></tr>
-<tr><td width="40%">C93 video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Cyberia game.</td></tr>
-<tr><td width="40%">CamStudio</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CSCD</td></tr>
-<tr><td width="40%">CD+G</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video codec for CD+G karaoke disks</td></tr>
-<tr><td width="40%">Chinese AVS video</td><td width="10%">E</td><td width="10%">X</td><td width="40%">AVS1-P2, JiZhun profile, encoding through external library libxavs</td></tr>
-<tr><td width="40%">Delphine Software International CIN video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Delphine Software International games.</td></tr>
-<tr><td width="40%">Cinepak</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Cirrus Logic AccuPak</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CLJR</td></tr>
-<tr><td width="40%">Creative YUV (CYUV)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">DFA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Chronomaster game.</td></tr>
-<tr><td width="40%">Dirac</td><td width="10%">E</td><td width="10%">E</td><td width="40%">supported through external libdirac/libschroedinger libraries</td></tr>
-<tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">DNxHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">aka SMPTE VC3</td></tr>
-<tr><td width="40%">Duck TrueMotion 1.0</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: DUCK</td></tr>
-<tr><td width="40%">Duck TrueMotion 2.0</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: TM20</td></tr>
-<tr><td width="40%">DV (Digital Video)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Feeble Files/ScummVM DXA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec originally used in Feeble Files game.</td></tr>
-<tr><td width="40%">Electronic Arts CMV video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in NHL 95 game.</td></tr>
-<tr><td width="40%">Electronic Arts Madcow video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Electronic Arts TGV video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Electronic Arts TGQ video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Electronic Arts TQI video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Escape 124</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">FFmpeg video codec #1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental lossless codec (fourcc: FFV1)</td></tr>
-<tr><td width="40%">Flash Screen Video v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: FSV1</td></tr>
-<tr><td width="40%">Flash Screen Video v2</td><td width="10%">X</td></tr>
-<tr><td width="40%">Flash Video (FLV)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Sorenson H.263 used in Flash</td></tr>
-<tr><td width="40%">Fraps</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">H.263 / H.263-1996</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">H.263+ / H.263-1998 / H.263 version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libx264</td></tr>
-<tr><td width="40%">H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)</td><td width="10%">E</td><td width="10%">X</td></tr>
-<tr><td width="40%">HuffYUV</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">HuffYUV FFmpeg variant</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">IBM Ultimotion</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: ULTI</td></tr>
-<tr><td width="40%">id Cinematic video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Quake II.</td></tr>
-<tr><td width="40%">id RoQ video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Quake III, Jedi Knight 2, other computer games.</td></tr>
-<tr><td width="40%">IFF ILBM</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF interlaved bitmap</td></tr>
-<tr><td width="40%">IFF ByteRun1</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF run length encoded bitmap</td></tr>
-<tr><td width="40%">Intel H.263</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Intel Indeo 2</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Intel Indeo 3</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Intel Indeo 5</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Interplay C93</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in the game Cyberia from Interplay.</td></tr>
-<tr><td width="40%">Interplay MVE video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Interplay .MVE files.</td></tr>
-<tr><td width="40%">Karl Morton&rsquo;s video codec</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Worms games.</td></tr>
-<tr><td width="40%">Kega Game Video (KGV1)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Kega emulator screen capture codec.</td></tr>
-<tr><td width="40%">Lagarith</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">LCL (LossLess Codec Library) MSZH</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">LCL (LossLess Codec Library) ZLIB</td><td width="10%">E</td><td width="10%">E</td></tr>
-<tr><td width="40%">LOCO</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">lossless MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Microsoft RLE</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Microsoft Video 1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Mimic</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in MSN Messenger Webcam streams.</td></tr>
-<tr><td width="40%">Miro VideoXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VIXL</td></tr>
-<tr><td width="40%">MJPEG (Motion JPEG)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Mobotix MxPEG video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Motion Pixels video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-1 video</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-1/2 video XvMC (X-Video Motion Compensation)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-1/2 video (VDPAU acceleration)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-2 video</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-4 part 2</td><td width="10%">X</td><td width="10%">X
-    &nbsp;libxvidcore can be used alternatively for encoding.</td></tr>
-<tr><td width="40%">MPEG-4 part 2 Microsoft variant version 1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-4 part 2 Microsoft variant version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">MPEG-4 part 2 Microsoft variant version 3</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Nintendo Gamecube THP video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">NuppelVideo/RTjpeg</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video encoding used in NuppelVideo files.</td></tr>
-<tr><td width="40%">On2 VP3</td><td width="10%"></td><td width="10%">X</td><td width="40%">still experimental</td></tr>
-<tr><td width="40%">On2 VP5</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP50</td></tr>
-<tr><td width="40%">On2 VP6</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP60,VP61,VP62</td></tr>
-<tr><td width="40%">VP8</td><td width="10%">E</td><td width="10%">X</td><td width="40%">fourcc: VP80, encoding supported through external library libvpx</td></tr>
-<tr><td width="40%">planar RGB</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: 8BPS</td></tr>
-<tr><td width="40%">Q-team QPEG</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourccs: QPEG, Q1.0, Q1.1</td></tr>
-<tr><td width="40%">QuickTime 8BPS video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">QuickTime Animation (RLE) video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: &rsquo;rle &rsquo;</td></tr>
-<tr><td width="40%">QuickTime Graphics (SMC)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: &rsquo;smc &rsquo;</td></tr>
-<tr><td width="40%">QuickTime video (RPZA)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: rpza</td></tr>
-<tr><td width="40%">R10K AJA Kona 10-bit RGB Codec</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">R210 Quicktime Uncompressed RGB 10-bit</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Raw Video</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">RealVideo 1.0</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">RealVideo 2.0</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">RealVideo 3.0</td><td width="10%"></td><td width="10%">X</td><td width="40%">still far from ideal</td></tr>
-<tr><td width="40%">RealVideo 4.0</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Renderware TXD (TeXture Dictionary)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Texture dictionaries used by the Renderware Engine.</td></tr>
-<tr><td width="40%">RL2 video</td><td width="10%"></td><td width="10%">X</td><td width="40%">used in some games by Entertainment Software Partners</td></tr>
-<tr><td width="40%">Sierra VMD video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra VMD files.</td></tr>
-<tr><td width="40%">Smacker video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Video encoding used in Smacker.</td></tr>
-<tr><td width="40%">SMPTE VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Snow</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental wavelet codec (fourcc: SNOW)</td></tr>
-<tr><td width="40%">Sony PlayStation MDEC (Motion DECoder)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Sorenson Vector Quantizer 1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: SVQ1</td></tr>
-<tr><td width="40%">Sorenson Vector Quantizer 3</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SVQ3</td></tr>
-<tr><td width="40%">Sunplus JPEG (SP5X)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SP5X</td></tr>
-<tr><td width="40%">TechSmith Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: TSCC</td></tr>
-<tr><td width="40%">Theora</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libtheora</td></tr>
-<tr><td width="40%">Tiertex Limited SEQ video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in DOS CD-ROM FlashBack game.</td></tr>
-<tr><td width="40%">V210 Quicktime Uncompressed 4:2:2 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">VMware Screen Codec / VMware Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in videos captured by VMware.</td></tr>
-<tr><td width="40%">Westwood Studios VQA (Vector Quantized Animation) video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Video 7</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Video 8</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Video 9</td><td width="10%"></td><td width="10%">X</td><td width="40%">not completely working</td></tr>
-<tr><td width="40%">Wing Commander III / Xan</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Wing Commander III .MVE files.</td></tr>
-<tr><td width="40%">Wing Commander IV / Xan</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Wing Commander IV.</td></tr>
-<tr><td width="40%">Winnov WNV1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">WMV7</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">YAMAHA SMAF</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Psygnosis YOP Video</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ZLIB</td><td width="10%">X</td><td width="10%">X</td><td width="40%">part of LCL, encoder experimental</td></tr>
-<tr><td width="40%">Zip Motion Blocks Video</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Encoder works only in PAL8.</td></tr>
-</table>
-
-<p><code>X</code> means that encoding (resp. decoding) is supported.
-</p>
-<p><code>E</code> means that support is provided through an external library.
-</p>
-<a name="Audio-Codecs"></a>
-<h2 class="section"><a href="general.html#toc-Audio-Codecs">2.4 Audio Codecs</a></h2>
-
-<table>
-<tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
-<tr><td width="40%">8SVX audio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">AAC</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libfaac and libvo-aacenc</td></tr>
-<tr><td width="40%">AC-3</td><td width="10%">IX</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM 4X Movie</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM CDROM XA</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Creative Technology</td><td width="10%"></td><td width="10%">X</td><td width="40%">16 -&gt; 4, 8 -&gt; 4, 8 -&gt; 3, 8 -&gt; 2</td></tr>
-<tr><td width="40%">ADPCM Electronic Arts</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various EA titles.</td></tr>
-<tr><td width="40%">ADPCM Electronic Arts Maxis CDROM XS</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sim City 3000.</td></tr>
-<tr><td width="40%">ADPCM Electronic Arts R1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Electronic Arts R2</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Electronic Arts R3</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Electronic Arts XAS</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM G.722</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM G.726</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA AMV</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in AMV files</td></tr>
-<tr><td width="40%">ADPCM IMA Electronic Arts EACS</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA Electronic Arts SEAD</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA Funcom</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA QuickTime</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA Loki SDL MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM IMA Westwood</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM ISS IMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in FunCom games.</td></tr>
-<tr><td width="40%">ADPCM IMA Duck DK3</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some Sega Saturn console games.</td></tr>
-<tr><td width="40%">ADPCM IMA Duck DK4</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in some Sega Saturn console games.</td></tr>
-<tr><td width="40%">ADPCM Microsoft</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM MS IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Nintendo Gamecube THP</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM QT IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM SEGA CRI ADX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Sega Dreamcast games.</td></tr>
-<tr><td width="40%">ADPCM Shockwave Flash</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM SMJPEG IMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in certain Loki game ports.</td></tr>
-<tr><td width="40%">ADPCM Sound Blaster Pro 2-bit</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Sound Blaster Pro 2.6-bit</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Sound Blaster Pro 4-bit</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">ADPCM Westwood Studios IMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Westwood Studios games like Command and Conquer.</td></tr>
-<tr><td width="40%">ADPCM Yamaha</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">AMR-NB</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libopencore-amrnb</td></tr>
-<tr><td width="40%">AMR-WB</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libvo-amrwbenc</td></tr>
-<tr><td width="40%">Apple lossless audio</td><td width="10%">X</td><td width="10%">X</td><td width="40%">QuickTime fourcc &rsquo;alac&rsquo;</td></tr>
-<tr><td width="40%">Atrac 1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Atrac 3</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Bink Audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Bink and Smacker files in many games.</td></tr>
-<tr><td width="40%">CELT (Opus)</td><td width="10%"></td><td width="10%">E</td><td width="40%">decoding supported through external library libcelt</td></tr>
-<tr><td width="40%">Delphine Software International CIN audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Codec used in Delphine Software International games.</td></tr>
-<tr><td width="40%">COOK</td><td width="10%"></td><td width="10%">X</td><td width="40%">All versions except 5.1 are supported.</td></tr>
-<tr><td width="40%">DCA (DTS Coherent Acoustics)</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">DPCM id RoQ</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Used in Quake III, Jedi Knight 2, other computer games.</td></tr>
-<tr><td width="40%">DPCM Interplay</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in various Interplay computer games.</td></tr>
-<tr><td width="40%">DPCM Sierra Online</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra Online game audio files.</td></tr>
-<tr><td width="40%">DPCM Sol</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">DPCM Xan</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Origin&rsquo;s Wing Commander IV AVI files.</td></tr>
-<tr><td width="40%">DSP Group TrueSpeech</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">DV audio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Enhanced AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">FLAC (Free Lossless Audio Codec)</td><td width="10%">X</td><td width="10%">IX</td></tr>
-<tr><td width="40%">GSM</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libgsm</td></tr>
-<tr><td width="40%">GSM Microsoft variant</td><td width="10%">E</td><td width="10%">X</td><td width="40%">encoding supported through external library libgsm</td></tr>
-<tr><td width="40%">IMC (Intel Music Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 3:1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 6:1</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">MLP (Meridian Lossless Packing)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in DVD-Audio discs.</td></tr>
-<tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Only versions 3.97-3.99 are supported.</td></tr>
-<tr><td width="40%">MP1 (MPEG audio layer 1)</td><td width="10%"></td><td width="10%">IX</td></tr>
-<tr><td width="40%">MP2 (MPEG audio layer 2)</td><td width="10%">IX</td><td width="10%">IX</td></tr>
-<tr><td width="40%">MP3 (MPEG audio layer 3)</td><td width="10%">E</td><td width="10%">IX</td><td width="40%">encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported</td></tr>
-<tr><td width="40%">MPEG-4 Audio Lossless Coding (ALS)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Musepack SV7</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Nellymoser Asao</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM 16-bit little-endian planar</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM 32-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM 32-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM 64-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM 64-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM D-Cinema audio signed 24-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM signed 16/20/24-bit big-endian in MPEG-TS</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM unsigned 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">PCM Zork</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">QCELP / PureVoice</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">QDesign Music Codec 2</td><td width="10%"></td><td width="10%">X</td><td width="40%">There are still some distortions.</td></tr>
-<tr><td width="40%">RealAudio 1.0 (14.4K)</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Real 14400 bit/s codec</td></tr>
-<tr><td width="40%">RealAudio 2.0 (28.8K)</td><td width="10%"></td><td width="10%">X</td><td width="40%">Real 28800 bit/s codec</td></tr>
-<tr><td width="40%">RealAudio 3.0 (dnet)</td><td width="10%">IX</td><td width="10%">X</td><td width="40%">Real low bitrate AC-3 codec</td></tr>
-<tr><td width="40%">RealAudio SIPR / ACELP.NET</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Sierra VMD audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Sierra VMD files.</td></tr>
-<tr><td width="40%">Smacker audio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">SMPTE 302M AES3 audio</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Sonic</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
-<tr><td width="40%">Sonic lossless</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
-<tr><td width="40%">Speex</td><td width="10%"></td><td width="10%">E</td><td width="40%">supported through external library libspeex</td></tr>
-<tr><td width="40%">True Audio (TTA)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">TrueHD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in HD-DVD and Blu-Ray discs.</td></tr>
-<tr><td width="40%">TwinVQ (VQF flavor)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Vorbis</td><td width="10%">E</td><td width="10%">X</td><td width="40%">A native but very primitive encoder exists.</td></tr>
-<tr><td width="40%">WavPack</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Westwood Audio (SND1)</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Audio 1</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Audio 2</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Audio Pro</td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">Windows Media Audio Voice</td><td width="10%"></td><td width="10%">X</td></tr>
-</table>
-
-<p><code>X</code> means that encoding (resp. decoding) is supported.
-</p>
-<p><code>E</code> means that support is provided through an external library.
-</p>
-<p><code>I</code> means that an integer-only version is available, too (ensures high
-performance on systems without hardware floating point support).
-</p>
-<a name="Subtitle-Formats"></a>
-<h2 class="section"><a href="general.html#toc-Subtitle-Formats">2.5 Subtitle Formats</a></h2>
-
-<table>
-<tr><td width="40%">Name</td><td width="10%">Muxing</td><td width="10%">Demuxing</td><td width="10%">Encoding</td><td width="10%">Decoding</td></tr>
-<tr><td width="40%">SSA/ASS</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">DVB</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">DVD</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">MicroDVD</td><td width="10%">X</td><td width="10%">X</td><td width="10%"></td><td width="10%"></td></tr>
-<tr><td width="40%">PGS</td><td width="10%"></td><td width="10%"></td><td width="10%"></td><td width="10%">X</td></tr>
-<tr><td width="40%">SubRip (SRT)</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">XSUB</td><td width="10%"></td><td width="10%"></td><td width="10%">X</td><td width="10%">X</td></tr>
-</table>
-
-<p><code>X</code> means that the feature is supported.
-</p>
-<a name="Network-Protocols"></a>
-<h2 class="section"><a href="general.html#toc-Network-Protocols">2.6 Network Protocols</a></h2>
-
-<table>
-<tr><td width="40%">Name</td><td width="10%">Support</td></tr>
-<tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%">X</td></tr>
-<tr><td width="40%">file</td><td width="10%">X</td></tr>
-<tr><td width="40%">Gopher</td><td width="10%">X</td></tr>
-<tr><td width="40%">HTTP</td><td width="10%">X</td></tr>
-<tr><td width="40%">MMS</td><td width="10%">X</td></tr>
-<tr><td width="40%">pipe</td><td width="10%">X</td></tr>
-<tr><td width="40%">RTP</td><td width="10%">X</td></tr>
-<tr><td width="40%">TCP</td><td width="10%">X</td></tr>
-<tr><td width="40%">UDP</td><td width="10%">X</td></tr>
-</table>
-
-<p><code>X</code> means that the protocol is supported.
-</p>
-
-<a name="Input_002fOutput-Devices"></a>
-<h2 class="section"><a href="general.html#toc-Input_002fOutput-Devices">2.7 Input/Output Devices</a></h2>
-
-<table>
-<tr><td width="40%">Name</td><td width="10%">Input</td><td width="10%">Output</td></tr>
-<tr><td width="40%">ALSA</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">BKTR</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">DV1394</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">JACK</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">LIBDC1394</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">OSS</td><td width="10%">X</td><td width="10%">X</td></tr>
-<tr><td width="40%">Video4Linux</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">Video4Linux2</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">VfW capture</td><td width="10%">X</td><td width="10%"></td></tr>
-<tr><td width="40%">X11 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
-</table>
-
-<p><code>X</code> means that input/output is supported.
-</p>
-
-<a name="Platform-Specific-information"></a>
-<h1 class="chapter"><a href="general.html#toc-Platform-Specific-information">3. Platform Specific information</a></h1>
-
-<a name="DOS"></a>
-<h2 class="section"><a href="general.html#toc-DOS">3.1 DOS</a></h2>
-
-<p>Using a cross-compiler is preferred for various reasons.
-</p>
-<a name="OS_002f2"></a>
-<h2 class="section"><a href="general.html#toc-OS_002f2">3.2 OS/2</a></h2>
-
-<p>For information about compiling FFmpeg on OS/2 see
-<a href="http://www.edm2.com/index.php/FFmpeg">http://www.edm2.com/index.php/FFmpeg</a>.
-</p>
-<a name="Unix_002dlike"></a>
-<h2 class="section"><a href="general.html#toc-Unix_002dlike">3.3 Unix-like</a></h2>
-
-<p>Some parts of FFmpeg cannot be built with version 2.15 of the GNU
-assembler which is still provided by a few AMD64 distributions. To
-make sure your compiler really uses the required version of gas
-after a binutils upgrade, run:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">$(gcc -print-prog-name=as) --version
-</pre></td></tr></table>
-
-<p>If not, then you should install a different compiler that has no
-hard-coded path to gas. In the worst case pass <code>--disable-asm</code>
-to configure.
-</p>
-<a name="BSD"></a>
-<h3 class="subsection"><a href="general.html#toc-BSD">3.3.1 BSD</a></h3>
-
-<p>BSD make will not build FFmpeg, you need to install and use GNU Make
-(&lsquo;<tt>gmake</tt>&rsquo;).
-</p>
-<a name="g_t_0028Open_0029Solaris"></a>
-<h3 class="subsection"><a href="general.html#toc-_0028Open_0029Solaris">3.3.2 (Open)Solaris</a></h3>
-
-<p>GNU Make is required to build FFmpeg, so you have to invoke (&lsquo;<tt>gmake</tt>&rsquo;),
-standard Solaris Make will not work. When building with a non-c99 front-end
-(gcc, generic suncc) add either <code>--extra-libs=/usr/lib/values-xpg6.o</code>
-or <code>--extra-libs=/usr/lib/64/values-xpg6.o</code> to the configure options
-since the libc is not c99-compliant by default. The probes performed by
-configure may raise an exception leading to the death of configure itself
-due to a bug in the system shell. Simply invoke a different shell such as
-bash directly to work around this:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">bash ./configure
-</pre></td></tr></table>
-
-<a name="Darwin-_0028MacOS-X_002c-iPhone_0029"></a>
-<h3 class="subsection"><a href="general.html#toc-Darwin-_0028MacOS-X_002c-iPhone_0029">3.3.3 Darwin (MacOS X, iPhone)</a></h3>
-
-<p>MacOS X on PowerPC or ARM (iPhone) requires a preprocessor from
-<a href="http://github.com/yuvi/gas-preprocessor">http://github.com/yuvi/gas-preprocessor</a> to build the optimized
-assembler functions. Just download the Perl script and put it somewhere
-in your PATH, FFmpeg&rsquo;s configure will pick it up automatically.
-</p>
-<a name="Windows"></a>
-<h2 class="section"><a href="general.html#toc-Windows">3.4 Windows</a></h2>
-
-<p>To get help and instructions for building FFmpeg under Windows, check out
-the FFmpeg Windows Help Forum at
-<a href="http://ffmpeg.arrozcru.org/">http://ffmpeg.arrozcru.org/</a>.
-</p>
-<a name="Native-Windows-compilation"></a>
-<h3 class="subsection"><a href="general.html#toc-Native-Windows-compilation">3.4.1 Native Windows compilation</a></h3>
-
-<p>FFmpeg can be built to run natively on Windows using the MinGW tools. Install
-the latest versions of MSYS and MinGW from <a href="http://www.mingw.org/">http://www.mingw.org/</a>.
-You can find detailed installation
-instructions in the download section and the FAQ.
-</p>
-<p>FFmpeg does not build out-of-the-box with the packages the automated MinGW
-installer provides. It also requires coreutils to be installed and many other
-packages updated to the latest version. The minimum version for some packages
-are listed below:
-</p>
-<ul>
-<li> bash 3.1
-</li><li> msys-make 3.81-2 (note: not mingw32-make)
-</li><li> w32api 3.13
-</li><li> mingw-runtime 3.15
-</li></ul>
-
-<p>FFmpeg automatically passes <code>-fno-common</code> to the compiler to work around
-a GCC bug (see <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216</a>).
-</p>
-<p>Notes:
-</p>
-<ul>
-<li> Building natively using MSYS can be sped up by disabling implicit rules
-in the Makefile by calling <code>make -r</code> instead of plain <code>make</code>. This
-speed up is close to non-existent for normal one-off builds and is only
-noticeable when running make for a second time (for example in
-<code>make install</code>).
-
-</li><li> In order to compile FFplay, you must have the MinGW development library
-of SDL. Get it from <a href="http://www.libsdl.org">http://www.libsdl.org</a>.
-Edit the &lsquo;<tt>bin/sdl-config</tt>&rsquo; script so that it points to the correct prefix
-where SDL was installed. Verify that &lsquo;<tt>sdl-config</tt>&rsquo; can be launched from
-the MSYS command line.
-
-</li><li> By using <code>./configure --enable-shared</code> when configuring FFmpeg,
-you can build libavutil, libavcodec and libavformat as DLLs.
-
-</li></ul>
-
-<a name="Microsoft-Visual-C_002b_002b-compatibility"></a>
-<h3 class="subsection"><a href="general.html#toc-Microsoft-Visual-C_002b_002b-compatibility">3.4.2 Microsoft Visual C++ compatibility</a></h3>
-
-<p>As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
-want to use the libav* libraries in your own applications, you can still
-compile those applications using MSVC++. But the libav* libraries you link
-to <em>must</em> be built with MinGW. However, you will not be able to debug
-inside the libav* libraries, since MSVC++ does not recognize the debug
-symbols generated by GCC.
-We strongly recommend you to move over from MSVC++ to MinGW tools.
-</p>
-<p>This description of how to use the FFmpeg libraries with MSVC++ is based on
-Microsoft Visual C++ 2005 Express Edition. If you have a different version,
-you might have to modify the procedures slightly.
-</p>
-<a name="Using-static-libraries"></a>
-<h4 class="subsubsection"><a href="general.html#toc-Using-static-libraries">3.4.2.1 Using static libraries</a></h4>
-
-<p>Assuming you have just built and installed FFmpeg in &lsquo;<tt>/usr/local</tt>&rsquo;.
-</p>
-<ol>
-<li> Create a new console application (&quot;File / New / Project&quot;) and then
-select &quot;Win32 Console Application&quot;. On the appropriate page of the
-Application Wizard, uncheck the &quot;Precompiled headers&quot; option.
-
-</li><li> Write the source code for your application, or, for testing, just
-copy the code from an existing sample application into the source file
-that MSVC++ has already created for you. For example, you can copy
-&lsquo;<tt>libavformat/output-example.c</tt>&rsquo; from the FFmpeg distribution.
-
-</li><li> Open the &quot;Project / Properties&quot; dialog box. In the &quot;Configuration&quot;
-combo box, select &quot;All Configurations&quot; so that the changes you make will
-affect both debug and release builds. In the tree view on the left hand
-side, select &quot;C/C++ / General&quot;, then edit the &quot;Additional Include
-Directories&quot; setting to contain the path where the FFmpeg includes were
-installed (i.e. &lsquo;<tt>c:\msys\1.0\local\include</tt>&rsquo;).
-Do not add MinGW&rsquo;s include directory here, or the include files will
-conflict with MSVC&rsquo;s.
-
-</li><li> Still in the &quot;Project / Properties&quot; dialog box, select
-&quot;Linker / General&quot; from the tree view and edit the
-&quot;Additional Library Directories&quot; setting to contain the &lsquo;<tt>lib</tt>&rsquo;
-directory where FFmpeg was installed (i.e. &lsquo;<tt>c:\msys\1.0\local\lib</tt>&rsquo;),
-the directory where MinGW libs are installed (i.e. &lsquo;<tt>c:\mingw\lib</tt>&rsquo;),
-and the directory where MinGW&rsquo;s GCC libs are installed
-(i.e. &lsquo;<tt>C:\mingw\lib\gcc\mingw32\4.2.1-sjlj</tt>&rsquo;). Then select
-&quot;Linker / Input&quot; from the tree view, and add the files &lsquo;<tt>libavformat.a</tt>&rsquo;,
-&lsquo;<tt>libavcodec.a</tt>&rsquo;, &lsquo;<tt>libavutil.a</tt>&rsquo;, &lsquo;<tt>libmingwex.a</tt>&rsquo;,
-&lsquo;<tt>libgcc.a</tt>&rsquo;, and any other libraries you used (i.e. &lsquo;<tt>libz.a</tt>&rsquo;)
-to the end of &quot;Additional Dependencies&quot;.
-
-</li><li> Now, select &quot;C/C++ / Code Generation&quot; from the tree view. Select
-&quot;Debug&quot; in the &quot;Configuration&quot; combo box. Make sure that &quot;Runtime
-Library&quot; is set to &quot;Multi-threaded Debug DLL&quot;. Then, select &quot;Release&quot; in
-the &quot;Configuration&quot; combo box and make sure that &quot;Runtime Library&quot; is
-set to &quot;Multi-threaded DLL&quot;.
-
-</li><li> Click &quot;OK&quot; to close the &quot;Project / Properties&quot; dialog box.
-
-</li><li> MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
-Get msinttypes from <a href="http://code.google.com/p/msinttypes/downloads/list">http://code.google.com/p/msinttypes/downloads/list</a>
-and install it in MSVC++&rsquo;s include directory
-(i.e. &lsquo;<tt>C:\Program Files\Microsoft Visual Studio 8\VC\include</tt>&rsquo;).
-
-</li><li> MSVC++ also does not understand the <code>inline</code> keyword used by
-FFmpeg, so you must add this line before <code>#include</code>ing libav*:
-<table><tr><td>&nbsp;</td><td><pre class="example">#define inline _inline
-</pre></td></tr></table>
-
-</li><li> Build your application, everything should work.
-
-</li></ol>
-
-<a name="Using-shared-libraries"></a>
-<h4 class="subsubsection"><a href="general.html#toc-Using-shared-libraries">3.4.2.2 Using shared libraries</a></h4>
-
-<p>This is how to create DLL and LIB files that are compatible with MSVC++:
-</p>
-<ol>
-<li> Add a call to &lsquo;<tt>vcvars32.bat</tt>&rsquo; (which sets up the environment
-variables for the Visual C++ tools) as the first line of &lsquo;<tt>msys.bat</tt>&rsquo;.
-The standard location for &lsquo;<tt>vcvars32.bat</tt>&rsquo; is
-&lsquo;<tt>C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat</tt>&rsquo;,
-and the standard location for &lsquo;<tt>msys.bat</tt>&rsquo; is &lsquo;<tt>C:\msys\1.0\msys.bat</tt>&rsquo;.
-If this corresponds to your setup, add the following line as the first line
-of &lsquo;<tt>msys.bat</tt>&rsquo;:
-
-<table><tr><td>&nbsp;</td><td><pre class="example">call &quot;C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat&quot;
-</pre></td></tr></table>
-
-<p>Alternatively, you may start the &lsquo;<tt>Visual Studio 2005 Command Prompt</tt>&rsquo;,
-and run &lsquo;<tt>c:\msys\1.0\msys.bat</tt>&rsquo; from there.
-</p>
-</li><li> Within the MSYS shell, run <code>lib.exe</code>. If you get a help message
-from &lsquo;<tt>Microsoft (R) Library Manager</tt>&rsquo;, this means your environment
-variables are set up correctly, the &lsquo;<tt>Microsoft (R) Library Manager</tt>&rsquo;
-is on the path and will be used by FFmpeg to create
-MSVC++-compatible import libraries.
-
-</li><li> Build FFmpeg with
-
-<table><tr><td>&nbsp;</td><td><pre class="example">./configure --enable-shared --enable-memalign-hack
-make
-make install
-</pre></td></tr></table>
-
-<p>Your install path (&lsquo;<tt>/usr/local/</tt>&rsquo; by default) should now have the
-necessary DLL and LIB files under the &lsquo;<tt>bin</tt>&rsquo; directory.
-</p>
-</li></ol>
-
-<p>To use those files with MSVC++, do the same as you would do with
-the static libraries, as described above. But in Step 4,
-you should only need to add the directory where the LIB files are installed
-(i.e. &lsquo;<tt>c:\msys\usr\local\bin</tt>&rsquo;). This is not a typo, the LIB files are
-installed in the &lsquo;<tt>bin</tt>&rsquo; directory. And instead of adding the static
-libraries (&lsquo;<tt>libxxx.a</tt>&rsquo; files) you should add the MSVC import libraries
-(&lsquo;<tt>avcodec.lib</tt>&rsquo;, &lsquo;<tt>avformat.lib</tt>&rsquo;, and
-&lsquo;<tt>avutil.lib</tt>&rsquo;). Note that you should not use the GCC import
-libraries (&lsquo;<tt>libxxx.dll.a</tt>&rsquo; files), as these will give you undefined
-reference errors. There should be no need for &lsquo;<tt>libmingwex.a</tt>&rsquo;,
-&lsquo;<tt>libgcc.a</tt>&rsquo;, and &lsquo;<tt>wsock32.lib</tt>&rsquo;, nor any other external library
-statically linked into the DLLs. The &lsquo;<tt>bin</tt>&rsquo; directory contains a bunch
-of DLL files, but the ones that are actually used to run your application
-are the ones with a major version number in their filenames
-(i.e. &lsquo;<tt>avcodec-51.dll</tt>&rsquo;).
-</p>
-<p>FFmpeg headers do not declare global data for Windows DLLs through the usual
-dllexport/dllimport interface. Such data will be exported properly while
-building, but to use them in your MSVC++ code you will have to edit the
-appropriate headers and mark the data as dllimport. For example, in
-libavutil/pixdesc.h you should have:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-</pre></td></tr></table>
-
-<p>Note that using import libraries created by dlltool requires
-the linker optimization option to be set to
-&quot;References: Keep Unreferenced Data (/OPT:NOREF)&quot;, otherwise
-the resulting binaries will fail during runtime. This isn&rsquo;t
-required when using import libraries generated by lib.exe.
-</p>
-<a name="Cross-compilation-for-Windows-with-Linux"></a>
-<h3 class="subsection"><a href="general.html#toc-Cross-compilation-for-Windows-with-Linux">3.4.3 Cross compilation for Windows with Linux</a></h3>
-
-<p>You must use the MinGW cross compilation tools available at
-<a href="http://www.mingw.org/">http://www.mingw.org/</a>.
-</p>
-<p>Then configure FFmpeg with the following options:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
-</pre></td></tr></table>
-<p>(you can change the cross-prefix according to the prefix chosen for the
-MinGW tools).
-</p>
-<p>Then you can easily test FFmpeg with Wine
-(<a href="http://www.winehq.com/">http://www.winehq.com/</a>).
-</p>
-<a name="Compilation-under-Cygwin"></a>
-<h3 class="subsection"><a href="general.html#toc-Compilation-under-Cygwin">3.4.4 Compilation under Cygwin</a></h3>
-
-<p>Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
-llrint() in its C library.
-</p>
-<p>Install your Cygwin with all the &quot;Base&quot; packages, plus the
-following &quot;Devel&quot; ones:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">binutils, gcc4-core, make, git, mingw-runtime, texi2html
-</pre></td></tr></table>
-
-<p>And the following &quot;Utils&quot; one:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">diffutils
-</pre></td></tr></table>
-
-<p>Then run
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./configure --enable-static --disable-shared
-</pre></td></tr></table>
-
-<p>to make a static build.
-</p>
-<p>The current <code>gcc4-core</code> package is buggy and needs this flag to build
-shared libraries:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
-</pre></td></tr></table>
-
-<p>If you want to build FFmpeg with additional libraries, download Cygwin
-&quot;Devel&quot; packages for Ogg and Vorbis from any Cygwin packages repository:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">libogg-devel, libvorbis-devel
-</pre></td></tr></table>
-
-<p>These library packages are only available from Cygwin Ports
-(<a href="http://sourceware.org/cygwinports/">http://sourceware.org/cygwinports/</a>) :
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
-libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
-libxvidcore-devel
-</pre></td></tr></table>
-
-<p>The recommendation for libnut and x264 is to build them from source by
-yourself, as they evolve too quickly for Cygwin Ports to be up to date.
-</p>
-<p>Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means
-of the <code>libgetaddrinfo-devel</code> package, available at Cygwin Ports.
-</p>
-<a name="Crosscompilation-for-Windows-under-Cygwin"></a>
-<h3 class="subsection"><a href="general.html#toc-Crosscompilation-for-Windows-under-Cygwin">3.4.5 Crosscompilation for Windows under Cygwin</a></h3>
-
-<p>With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
-</p>
-<p>Just install your Cygwin as explained before, plus these additional
-&quot;Devel&quot; packages:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">gcc-mingw-core, mingw-runtime, mingw-zlib
-</pre></td></tr></table>
-
-<p>and add some special flags to your configure invocation.
-</p>
-<p>For a static build run
-</p><table><tr><td>&nbsp;</td><td><pre class="example">./configure --target-os=mingw32 --enable-memalign-hack --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
-</pre></td></tr></table>
-
-<p>and for a build with shared libraries
-</p><table><tr><td>&nbsp;</td><td><pre class="example">./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
-</pre></td></tr></table>
-
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/doc/libavfilter.html b/ffmpeg 0.7/doc/libavfilter.html
deleted file mode 100644 (file)
index f6a0885..0000000
+++ /dev/null
@@ -1,2212 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
-<html>
-<!-- Created on June 10, 2011 by texi2html 1.82
-texi2html was written by: 
-            Lionel Cons <Lionel.Cons@cern.ch> (original author)
-            Karl Berry  <karl@freefriends.org>
-            Olaf Bachmann <obachman@mathematik.uni-kl.de>
-            and many others.
-Maintained by: Many creative people.
-Send bugs and suggestions to <texi2html-bug@nongnu.org>
--->
-<head>
-<title>Libavfilter Documentation</title>
-
-<meta name="description" content="Libavfilter Documentation">
-<meta name="keywords" content="Libavfilter Documentation">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2html 1.82">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.roman {font-family:serif; font-weight:normal;}
-span.sansserif {font-family:sans-serif; font-weight:normal;}
-ul.toc {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
-
-<a name="SEC_Top"></a>
-<h1 class="settitle">Libavfilter Documentation</h1>
-
-<a name="SEC_Contents"></a>
-<h1>Table of Contents</h1>
-<div class="contents">
-
-<ul class="toc">
-  <li><a name="toc-Introduction" href="#Introduction">1. Introduction</a></li>
-  <li><a name="toc-Tutorial" href="#Tutorial">2. Tutorial</a></li>
-  <li><a name="toc-graph2dot" href="#graph2dot">3. graph2dot</a></li>
-  <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">4. Filtergraph description</a>
-  <ul class="toc">
-    <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">4.1 Filtergraph syntax</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Filters" href="#Audio-Filters">5. Audio Filters</a>
-  <ul class="toc">
-    <li><a name="toc-anull" href="#anull">5.1 anull</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Sources" href="#Audio-Sources">6. Audio Sources</a>
-  <ul class="toc">
-    <li><a name="toc-anullsrc" href="#anullsrc">6.1 anullsrc</a></li>
-  </ul></li>
-  <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">7. Audio Sinks</a>
-  <ul class="toc">
-    <li><a name="toc-anullsink" href="#anullsink">7.1 anullsink</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Filters" href="#Video-Filters">8. Video Filters</a>
-  <ul class="toc">
-    <li><a name="toc-blackframe" href="#blackframe">8.1 blackframe</a></li>
-    <li><a name="toc-copy" href="#copy">8.2 copy</a></li>
-    <li><a name="toc-crop" href="#crop">8.3 crop</a></li>
-    <li><a name="toc-cropdetect" href="#cropdetect">8.4 cropdetect</a></li>
-    <li><a name="toc-drawbox" href="#drawbox">8.5 drawbox</a></li>
-    <li><a name="toc-drawtext" href="#drawtext">8.6 drawtext</a></li>
-    <li><a name="toc-fade" href="#fade">8.7 fade</a></li>
-    <li><a name="toc-fieldorder" href="#fieldorder">8.8 fieldorder</a></li>
-    <li><a name="toc-fifo" href="#fifo">8.9 fifo</a></li>
-    <li><a name="toc-format" href="#format">8.10 format</a></li>
-    <li><a name="toc-frei0r-1" href="#frei0r-1">8.11 frei0r</a></li>
-    <li><a name="toc-gradfun" href="#gradfun">8.12 gradfun</a></li>
-    <li><a name="toc-hflip" href="#hflip">8.13 hflip</a></li>
-    <li><a name="toc-hqdn3d" href="#hqdn3d">8.14 hqdn3d</a></li>
-    <li><a name="toc-mp" href="#mp">8.15 mp</a></li>
-    <li><a name="toc-noformat" href="#noformat">8.16 noformat</a></li>
-    <li><a name="toc-null" href="#null">8.17 null</a></li>
-    <li><a name="toc-ocv" href="#ocv">8.18 ocv</a>
-    <ul class="toc">
-      <li><a name="toc-dilate-1" href="#dilate-1">8.18.1 dilate</a></li>
-      <li><a name="toc-erode" href="#erode">8.18.2 erode</a></li>
-      <li><a name="toc-smooth" href="#smooth">8.18.3 smooth</a></li>
-    </ul></li>
-    <li><a name="toc-overlay" href="#overlay">8.19 overlay</a></li>
-    <li><a name="toc-pad" href="#pad">8.20 pad</a></li>
-    <li><a name="toc-pixdesctest" href="#pixdesctest">8.21 pixdesctest</a></li>
-    <li><a name="toc-scale" href="#scale">8.22 scale</a></li>
-    <li><a name="toc-select" href="#select">8.23 select</a></li>
-    <li><a name="toc-setdar-1" href="#setdar-1">8.24 setdar</a></li>
-    <li><a name="toc-setpts" href="#setpts">8.25 setpts</a></li>
-    <li><a name="toc-setsar-1" href="#setsar-1">8.26 setsar</a></li>
-    <li><a name="toc-settb" href="#settb">8.27 settb</a></li>
-    <li><a name="toc-showinfo" href="#showinfo">8.28 showinfo</a></li>
-    <li><a name="toc-slicify" href="#slicify">8.29 slicify</a></li>
-    <li><a name="toc-split" href="#split">8.30 split</a></li>
-    <li><a name="toc-transpose" href="#transpose">8.31 transpose</a></li>
-    <li><a name="toc-unsharp" href="#unsharp">8.32 unsharp</a></li>
-    <li><a name="toc-vflip" href="#vflip">8.33 vflip</a></li>
-    <li><a name="toc-yadif" href="#yadif">8.34 yadif</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Sources" href="#Video-Sources">9. Video Sources</a>
-  <ul class="toc">
-    <li><a name="toc-buffer" href="#buffer">9.1 buffer</a></li>
-    <li><a name="toc-color" href="#color">9.2 color</a></li>
-    <li><a name="toc-movie" href="#movie">9.3 movie</a></li>
-    <li><a name="toc-nullsrc" href="#nullsrc">9.4 nullsrc</a></li>
-    <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">9.5 frei0r_src</a></li>
-  </ul></li>
-  <li><a name="toc-Video-Sinks" href="#Video-Sinks">10. Video Sinks</a>
-  <ul class="toc">
-    <li><a name="toc-nullsink" href="#nullsink">10.1 nullsink</a></li>
-  </ul>
-</li>
-</ul>
-</div>
-
-<hr size="1">
-<a name="Introduction"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Introduction">1. Introduction</a></h1>
-
-<p>Libavfilter is the filtering API of FFmpeg. It is the substitute of the
-now deprecated &rsquo;vhooks&rsquo; and started as a Google Summer of Code project.
-</p>
-<p>Integrating libavfilter into the main FFmpeg repository is a work in
-progress. If you wish to try the unfinished development code of
-libavfilter then check it out from the libavfilter repository into
-some directory of your choice by:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">   svn checkout svn://svn.ffmpeg.org/soc/libavfilter
-</pre></td></tr></table>
-
-<p>And then read the README file in the top directory to learn how to
-integrate it into ffmpeg and ffplay.
-</p>
-<p>But note that there may still be serious bugs in the code and its API
-and ABI should not be considered stable yet!
-</p>
-<a name="Tutorial"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Tutorial">2. Tutorial</a></h1>
-
-<p>In libavfilter, it is possible for filters to have multiple inputs and
-multiple outputs.
-To illustrate the sorts of things that are possible, we can
-use a complex filter graph. For example, the following one:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">input --&gt; split --&gt; fifo -----------------------&gt; overlay --&gt; output
-            |                                        ^
-            |                                        |
-            +------&gt; fifo --&gt; crop --&gt; vflip --------+
-</pre></td></tr></table>
-
-<p>splits the stream in two streams, sends one stream through the crop filter
-and the vflip filter before merging it back with the other stream by
-overlaying it on top. You can use the following command to achieve this:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -s 240x320 -vf &quot;[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
-</pre></td></tr></table>
-
-<p>where input_video.avi has a vertical resolution of 480 pixels. The
-result will be that in output the top half of the video is mirrored
-onto the bottom half.
-</p>
-<p>Video filters are loaded using the <var>-vf</var> option passed to
-ffmpeg or to ffplay. Filters in the same linear chain are separated by
-commas. In our example, <var>split, fifo, overlay</var> are in one linear
-chain, and <var>fifo, crop, vflip</var> are in another. The points where
-the linear chains join are labeled by names enclosed in square
-brackets. In our example, that is <var>[T1]</var> and <var>[T2]</var>. The magic
-labels <var>[in]</var> and <var>[out]</var> are the points where video is input
-and output.
-</p>
-<p>Some filters take in input a list of parameters: they are specified
-after the filter name and an equal sign, and are separated each other
-by a semicolon.
-</p>
-<p>There exist so-called <var>source filters</var> that do not have a video
-input, and we expect in the future some <var>sink filters</var> that will
-not have video output.
-</p>
-<a name="graph2dot"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-graph2dot">3. graph2dot</a></h1>
-
-<p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
-directory can be used to parse a filter graph description and issue a
-corresponding textual representation in the dot language.
-</p>
-<p>Invoke the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">graph2dot -h
-</pre></td></tr></table>
-
-<p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
-</p>
-<p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
-the graphviz suite of programs) and obtain a graphical representation
-of the filter graph.
-</p>
-<p>For example the sequence of commands:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
-tools/graph2dot -o graph.tmp &amp;&amp; \
-dot -Tpng graph.tmp -o graph.png &amp;&amp; \
-display graph.png
-</pre></td></tr></table>
-
-<p>can be used to create and display an image representing the graph
-described by the <var>GRAPH_DESCRIPTION</var> string.
-</p>
-<a name="Filtergraph-description"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Filtergraph-description">4. Filtergraph description</a></h1>
-
-<p>A filtergraph is a directed graph of connected filters. It can contain
-cycles, and there can be multiple links between a pair of
-filters. Each link has one input pad on one side connecting it to one
-filter from which it takes its input, and one output pad on the other
-side connecting it to the one filter accepting its output.
-</p>
-<p>Each filter in a filtergraph is an instance of a filter class
-registered in the application, which defines the features and the
-number of input and output pads of the filter.
-</p>
-<p>A filter with no input pads is called a &quot;source&quot;, a filter with no
-output pads is called a &quot;sink&quot;.
-</p>
-<a name="Filtergraph-syntax"></a>
-<h2 class="section"><a href="libavfilter.html#toc-Filtergraph-syntax">4.1 Filtergraph syntax</a></h2>
-
-<p>A filtergraph can be represented using a textual representation, which
-is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
-tools, and by the <code>av_parse_graph()</code> function defined in
-&lsquo;<tt>libavfilter/avfiltergraph</tt>&rsquo;.
-</p>
-<p>A filterchain consists of a sequence of connected filters, each one
-connected to the previous one in the sequence. A filterchain is
-represented by a list of &quot;,&quot;-separated filter descriptions.
-</p>
-<p>A filtergraph consists of a sequence of filterchains. A sequence of
-filterchains is represented by a list of &quot;;&quot;-separated filterchain
-descriptions.
-</p>
-<p>A filter is represented by a string of the form:
-[<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
-</p>
-<p><var>filter_name</var> is the name of the filter class of which the
-described filter is an instance of, and has to be the name of one of
-the filter classes registered in the program.
-The name of the filter class is optionally followed by a string
-&quot;=<var>arguments</var>&quot;.
-</p>
-<p><var>arguments</var> is a string which contains the parameters used to
-initialize the filter instance, and are described in the filter
-descriptions below.
-</p>
-<p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
-and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
-within the quoted text; otherwise the argument string is considered
-terminated when the next special character (belonging to the set
-&quot;[]=;,&quot;) is encountered.
-</p>
-<p>The name and arguments of the filter are optionally preceded and
-followed by a list of link labels.
-A link label allows to name a link and associate it to a filter output
-or input pad. The preceding labels <var>in_link_1</var>
-... <var>in_link_N</var>, are associated to the filter input pads,
-the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
-associated to the output pads.
-</p>
-<p>When two link labels with the same name are found in the
-filtergraph, a link between the corresponding input and output pad is
-created.
-</p>
-<p>If an output pad is not labelled, it is linked by default to the first
-unlabelled input pad of the next filter in the filterchain.
-For example in the filterchain:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
-</pre></td></tr></table>
-<p>the split filter instance has two output pads, and the overlay filter
-instance two input pads. The first output pad of split is labelled
-&quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
-output pad of split is linked to the second input pad of overlay,
-which are both unlabelled.
-</p>
-<p>In a complete filterchain all the unlabelled filter input and output
-pads must be connected. A filtergraph is considered valid if all the
-filter input and output pads of all the filterchains are connected.
-</p>
-<p>Follows a BNF description for the filtergraph syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
-<var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
-<var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
-<var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
-<var>FILTER</var>           ::= [<var>LINKNAMES</var>] <var>NAME</var> [&quot;=&quot; <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
-<var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
-<var>FILTERGRAPH</var>      ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
-</pre></td></tr></table>
-
-
-<a name="Audio-Filters"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Audio-Filters">5. Audio Filters</a></h1>
-
-<p>When you configure your FFmpeg build, you can disable any of the
-existing filters using &ndash;disable-filters.
-The configure output will show the audio filters included in your
-build.
-</p>
-<p>Below is a description of the currently available audio filters.
-</p>
-<a name="anull"></a>
-<h2 class="section"><a href="libavfilter.html#toc-anull">5.1 anull</a></h2>
-
-<p>Pass the audio source unchanged to the output.
-</p>
-
-<a name="Audio-Sources"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Audio-Sources">6. Audio Sources</a></h1>
-
-<p>Below is a description of the currently available audio sources.
-</p>
-<a name="anullsrc"></a>
-<h2 class="section"><a href="libavfilter.html#toc-anullsrc">6.1 anullsrc</a></h2>
-
-<p>Null audio source, never return audio frames. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-</p>
-<p>It accepts as optional parameter a string of the form
-<var>sample_rate</var>:<var>channel_layout</var>.
-</p>
-<p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
-</p>
-<p><var>channel_layout</var> specify the channel layout, and can be either an
-integer or a string representing a channel layout. The default value
-of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
-</p>
-<p>Check the channel_layout_map definition in
-&lsquo;<tt>libavcodec/audioconvert.c</tt>&rsquo; for the mapping between strings and
-channel layout values.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
-anullsrc=48000:4
-
-# same as
-anullsrc=48000:mono
-</pre></td></tr></table>
-
-
-<a name="Audio-Sinks"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Audio-Sinks">7. Audio Sinks</a></h1>
-
-<p>Below is a description of the currently available audio sinks.
-</p>
-<a name="anullsink"></a>
-<h2 class="section"><a href="libavfilter.html#toc-anullsink">7.1 anullsink</a></h2>
-
-<p>Null audio sink, do absolutely nothing with the input audio. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-</p>
-
-<a name="Video-Filters"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Video-Filters">8. Video Filters</a></h1>
-
-<p>When you configure your FFmpeg build, you can disable any of the
-existing filters using &ndash;disable-filters.
-The configure output will show the video filters included in your
-build.
-</p>
-<p>Below is a description of the currently available video filters.
-</p>
-<a name="blackframe"></a>
-<h2 class="section"><a href="libavfilter.html#toc-blackframe">8.1 blackframe</a></h2>
-
-<p>Detect frames that are (almost) completely black. Can be useful to
-detect chapter transitions or commercials. Output lines consist of
-the frame number of the detected frame, the percentage of blackness,
-the position in the file if known or -1 and the timestamp in seconds.
-</p>
-<p>In order to display the output lines, you need to set the loglevel at
-least to the AV_LOG_INFO value.
-</p>
-<p>The filter accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
-</pre></td></tr></table>
-
-<p><var>amount</var> is the percentage of the pixels that have to be below the
-threshold, and defaults to 98.
-</p>
-<p><var>threshold</var> is the threshold below which a pixel value is
-considered black, and defaults to 32.
-</p>
-<a name="copy"></a>
-<h2 class="section"><a href="libavfilter.html#toc-copy">8.2 copy</a></h2>
-
-<p>Copy the input source unchanged to the output. Mainly useful for
-testing purposes.
-</p>
-<a name="crop"></a>
-<h2 class="section"><a href="libavfilter.html#toc-crop">8.3 crop</a></h2>
-
-<p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
-</p>
-<p>The parameters are expressions containing the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), PHI (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
-each new frame.
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output (cropped) width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>the number of input frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>the position in the file of the input frame, NAN if unknown
-</p>
-</dd>
-<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
-<dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
-</p>
-</dd>
-</dl>
-
-<p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
-the width and height of the output (cropped) video. They are
-evaluated just at the configuration of the filter.
-</p>
-<p>The default value of <var>out_w</var> is &quot;in_w&quot;, and the default value of
-<var>out_h</var> is &quot;in_h&quot;.
-</p>
-<p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
-and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
-cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
-evaluated after <var>out_w</var> and <var>out_h</var>.
-</p>
-<p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
-position of the top-left corner of the output (non-cropped) area. They
-are evaluated for each frame. If the evaluated value is not valid, it
-is approximated to the nearest valid value.
-</p>
-<p>The default value of <var>x</var> is &quot;(in_w-out_w)/2&quot;, and the default
-value for <var>y</var> is &quot;(in_h-out_h)/2&quot;, which set the cropped area at
-the center of the input image.
-</p>
-<p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
-for <var>y</var> may depend on <var>x</var>.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># crop the central input area with size 100x100
-crop=100:100
-
-# crop the central input area with size 2/3 of the input video
-&quot;crop=2/3*in_w:2/3*in_h&quot;
-
-# crop the input video central square
-crop=in_h
-
-# delimit the rectangle with the top-left corner placed at position
-# 100:100 and the right-bottom corner corresponding to the right-bottom
-# corner of the input image.
-crop=in_w-100:in_h-100:100:100
-
-# crop 10 pixels from the left and right borders, and 20 pixels from
-# the top and bottom borders
-&quot;crop=in_w-2*10:in_h-2*20&quot;
-
-# keep only the bottom right quarter of the input image
-&quot;crop=in_w/2:in_h/2:in_w/2:in_h/2&quot;
-
-# crop height for getting Greek harmony
-&quot;crop=in_w:1/PHI*in_w&quot;
-
-# trembling effect
-&quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)&quot;
-
-# erratic camera effect depending on timestamp
-&quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
-
-# set x depending on the value of y
-&quot;crop=in_w/2:in_h/2:y:10+10*sin(n/10)&quot;
-</pre></td></tr></table>
-
-<a name="cropdetect"></a>
-<h2 class="section"><a href="libavfilter.html#toc-cropdetect">8.4 cropdetect</a></h2>
-
-<p>Auto-detect crop size.
-</p>
-<p>Calculate necessary cropping parameters and prints the recommended
-parameters through the logging system. The detected dimensions
-correspond to the non-black area of the input video.
-</p>
-<p>It accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
-<dd><p>Threshold, which can be optionally specified from nothing (0) to
-everything (255), defaults to 24.
-</p>
-</dd>
-<dt> &lsquo;<samp>round</samp>&rsquo;</dt>
-<dd><p>Value which the width/height should be divisible by, defaults to
-16. The offset is automatically adjusted to center the video. Use 2 to
-get only even dimensions (needed for 4:2:2 video). 16 is best when
-encoding to most video codecs.
-</p>
-</dd>
-<dt> &lsquo;<samp>reset</samp>&rsquo;</dt>
-<dd><p>Counter that determines after how many frames cropdetect will reset
-the previously detected largest video area and start over to detect
-the current optimal crop area. Defaults to 0.
-</p>
-<p>This can be useful when channel logos distort the video area. 0
-indicates never reset and return the largest area encountered during
-playback.
-</p></dd>
-</dl>
-
-<a name="drawbox"></a>
-<h2 class="section"><a href="libavfilter.html#toc-drawbox">8.5 drawbox</a></h2>
-
-<p>Draw a colored box on the input image.
-</p>
-<p>It accepts the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
-</pre></td></tr></table>
-
-<dl compact="compact">
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>Specify the top left corner coordinates of the box. Default to 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd><p>Specify the width and height of the box, if 0 they are interpreted as
-the input width and height. Default to 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd><p>Specify the color of the box to write, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-</p></dd>
-</dl>
-
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># draw a black box around the edge of the input image
-drawbox
-
-# draw a box with color red and an opacity of 50%
-drawbox=10:20:200:60:red@0.5&quot;
-</pre></td></tr></table>
-
-<a name="drawtext"></a>
-<h2 class="section"><a href="libavfilter.html#toc-drawtext">8.6 drawtext</a></h2>
-
-<p>Draw text string or text from specified file on top of video using the
-libfreetype library.
-</p>
-<p>To enable compilation of this filter you need to configure FFmpeg with
-<code>--enable-libfreetype</code>.
-</p>
-<p>The filter also recognizes strftime() sequences in the provided text
-and expands them accordingly. Check the documentation of strftime().
-</p>
-<p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
-separated by &quot;:&quot;.
-</p>
-<p>The description of the accepted parameters follows.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
-<dd><p>The font file to be used for drawing text. Path must be included.
-This parameter is mandatory.
-</p>
-</dd>
-<dt> &lsquo;<samp>text</samp>&rsquo;</dt>
-<dd><p>The text string to be drawn. The text must be a sequence of UTF-8
-encoded characters.
-This parameter is mandatory if no file is specified with the parameter
-<var>textfile</var>.
-</p>
-</dd>
-<dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
-<dd><p>A text file containing text to be drawn. The text must be a sequence
-of UTF-8 encoded characters.
-</p>
-<p>This parameter is mandatory if no text string is specified with the
-parameter <var>text</var>.
-</p>
-<p>If both text and textfile are specified, an error is thrown.
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>The offsets where text will be drawn within the video frame.
-Relative to the top/left border of the output image.
-</p>
-<p>The default value of <var>x</var> and <var>y</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
-<dd><p>The font size to be used for drawing text.
-The default value of <var>fontsize</var> is 16.
-</p>
-</dd>
-<dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing fonts.
-Either a string (e.g. &quot;red&quot;) or in 0xRRGGBB[AA] format
-(e.g. &quot;0xff000033&quot;), possibly followed by an alpha specifier.
-The default value of <var>fontcolor</var> is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing box around text.
-Either a string (e.g. &quot;yellow&quot;) or in 0xRRGGBB[AA] format
-(e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
-The default value of <var>boxcolor</var> is &quot;white&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>box</samp>&rsquo;</dt>
-<dd><p>Used to draw a box around text using background color.
-Value should be either 1 (enable) or 0 (disable).
-The default value of <var>box</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>shadowx, shadowy</samp>&rsquo;</dt>
-<dd><p>The x and y offsets for the text shadow position with respect to the
-position of the text. They can be either positive or negative
-values. Default value for both is &quot;0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
-<dd><p>The color to be used for drawing a shadow behind the drawn text.  It
-can be a color name (e.g. &quot;yellow&quot;) or a string in the 0xRRGGBB[AA]
-form (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
-The default value of <var>shadowcolor</var> is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
-<dd><p>Flags to be used for loading the fonts.
-</p>
-<p>The flags map the corresponding flags supported by libfreetype, and are
-a combination of the following values:
-</p><dl compact="compact">
-<dt> <var>default</var></dt>
-<dt> <var>no_scale</var></dt>
-<dt> <var>no_hinting</var></dt>
-<dt> <var>render</var></dt>
-<dt> <var>no_bitmap</var></dt>
-<dt> <var>vertical_layout</var></dt>
-<dt> <var>force_autohint</var></dt>
-<dt> <var>crop_bitmap</var></dt>
-<dt> <var>pedantic</var></dt>
-<dt> <var>ignore_global_advance_width</var></dt>
-<dt> <var>no_recurse</var></dt>
-<dt> <var>ignore_transform</var></dt>
-<dt> <var>monochrome</var></dt>
-<dt> <var>linear_design</var></dt>
-<dt> <var>no_autohint</var></dt>
-<dt> <var>end table</var></dt>
-</dl>
-
-<p>Default value is &quot;render&quot;.
-</p>
-<p>For more information consult the documentation for the FT_LOAD_*
-libfreetype flags.
-</p>
-</dd>
-<dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
-<dd><p>The size in number of spaces to use for rendering the tab.
-Default value is 4.
-</p></dd>
-</dl>
-
-<p>For example the command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
-</pre></td></tr></table>
-
-<p>will draw &quot;Test Text&quot; with font FreeSerif, using the default values
-for the optional parameters.
-</p>
-<p>The command:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
-          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
-</pre></td></tr></table>
-
-<p>will draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
-and y=50 (counting from the top-left corner of the screen), text is
-yellow with a red box around it. Both the text and the box have an
-opacity of 20%.
-</p>
-<p>Note that the double quotes are not necessary if spaces are not used
-within the parameter list.
-</p>
-<p>For more information about libfreetype, check:
-<a href="http://www.freetype.org/">http://www.freetype.org/</a>.
-</p>
-<a name="fade"></a>
-<h2 class="section"><a href="libavfilter.html#toc-fade">8.7 fade</a></h2>
-
-<p>Apply fade-in/out effect to input video.
-</p>
-<p>It accepts the parameters:
-<var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
-</p>
-<p><var>type</var> specifies if the effect type, can be either &quot;in&quot; for
-fade-in, or &quot;out&quot; for a fade-out effect.
-</p>
-<p><var>start_frame</var> specifies the number of the start frame for starting
-to apply the fade effect.
-</p>
-<p><var>nb_frames</var> specifies the number of frames for which the fade
-effect has to last. At the end of the fade-in effect the output video
-will have the same intensity as the input video, at the end of the
-fade-out transition the output video will be completely black.
-</p>
-<p>A few usage examples follow, usable too as test scenarios.
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># fade in first 30 frames of video
-fade=in:0:30
-
-# fade out last 45 frames of a 200-frame video
-fade=out:155:45
-
-# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
-fade=in:0:25, fade=out:975:25
-
-# make first 5 frames black, then fade in from frame 5-24
-fade=in:5:20
-</pre></td></tr></table>
-
-<a name="fieldorder"></a>
-<h2 class="section"><a href="libavfilter.html#toc-fieldorder">8.8 fieldorder</a></h2>
-
-<p>Transform the field order of the input video.
-</p>
-<p>It accepts one parameter which specifies the required field order that
-the input interlaced video will be transformed to. The parameter can
-assume one of the following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0 or bff</samp>&rsquo;</dt>
-<dd><p>output bottom field first
-</p></dd>
-<dt> &lsquo;<samp>1 or tff</samp>&rsquo;</dt>
-<dd><p>output top field first
-</p></dd>
-</dl>
-
-<p>Default value is &quot;tff&quot;.
-</p>
-<p>Transformation is achieved by shifting the picture content up or down
-by one line, and filling the remaining line with appropriate picture content.
-This method is consistent with most broadcast field order converters.
-</p>
-<p>If the input video is not flagged as being interlaced, or it is already
-flagged as being of the required output field order then this filter does
-not alter the incoming video.
-</p>
-<p>This filter is very useful when converting to or from PAL DV material,
-which is bottom field first.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
-</pre></td></tr></table>
-
-<a name="fifo"></a>
-<h2 class="section"><a href="libavfilter.html#toc-fifo">8.9 fifo</a></h2>
-
-<p>Buffer input images and send them when they are requested.
-</p>
-<p>This filter is mainly useful when auto-inserted by the libavfilter
-framework.
-</p>
-<p>The filter does not take parameters.
-</p>
-<a name="format"></a>
-<h2 class="section"><a href="libavfilter.html#toc-format">8.10 format</a></h2>
-
-<p>Convert the input video to one of the specified pixel formats.
-Libavfilter will try to pick one that is supported for the input to
-the next filter.
-</p>
-<p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
-for example &quot;yuv420p:monow:rgb24&quot;.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># convert the input video to the format &quot;yuv420p&quot;
-format=yuv420p
-
-# convert the input video to any of the formats in the list
-format=yuv420p:yuv444p:yuv410p
-</pre></td></tr></table>
-
-<p><a name="frei0r"></a>
-</p><a name="frei0r-1"></a>
-<h2 class="section"><a href="libavfilter.html#toc-frei0r-1">8.11 frei0r</a></h2>
-
-<p>Apply a frei0r effect to the input video.
-</p>
-<p>To enable compilation of this filter you need to install the frei0r
-header and configure FFmpeg with &ndash;enable-frei0r.
-</p>
-<p>The filter supports the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
-</pre></td></tr></table>
-
-<p><var>filter_name</var> is the name to the frei0r effect to load. If the
-environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
-is searched in each one of the directories specified by the colon
-separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
-paths, which are in this order: &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;,
-&lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;, &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
-</p>
-<p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
-for the frei0r effect.
-</p>
-<p>A frei0r effect parameter can be a boolean (whose values are specified
-with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
-<var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
-numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
-description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
-<var>X</var> and <var>Y</var> being float numbers) and a string.
-</p>
-<p>The number and kind of parameters depend on the loaded effect. If an
-effect parameter is not specified the default value is set.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
-frei0r=distort0r:0.5:0.01
-
-# apply the colordistance effect, takes a color as first parameter
-frei0r=colordistance:0.2/0.3/0.4
-frei0r=colordistance:violet
-frei0r=colordistance:0x112233
-
-# apply the perspective effect, specify the top left and top right
-# image positions
-frei0r=perspective:0.2/0.2:0.8/0.2
-</pre></td></tr></table>
-
-<p>For more information see:
-<a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
-</p>
-<a name="gradfun"></a>
-<h2 class="section"><a href="libavfilter.html#toc-gradfun">8.12 gradfun</a></h2>
-
-<p>Fix the banding artifacts that are sometimes introduced into nearly flat
-regions by truncation to 8bit colordepth.
-Interpolate the gradients that should go where the bands are, and
-dither them.
-</p>
-<p>This filter is designed for playback only.  Do not use it prior to
-lossy compression, because compression tends to lose the dither and
-bring back the bands.
-</p>
-<p>The filter takes two optional parameters, separated by &rsquo;:&rsquo;:
-<var>strength</var>:<var>radius</var>
-</p>
-<p><var>strength</var> is the maximum amount by which the filter will change
-any one pixel. Also the threshold for detecting nearly flat
-regions. Acceptable values range from .51 to 255, default value is
-1.2, out-of-range values will be clipped to the valid range.
-</p>
-<p><var>radius</var> is the neighborhood to fit the gradient to. A larger
-radius makes for smoother gradients, but also prevents the filter from
-modifying the pixels near detailed regions. Acceptable values are
-8-32, default value is 16, out-of-range values will be clipped to the
-valid range.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># default parameters
-gradfun=1.2:16
-
-# omitting radius
-gradfun=1.2
-</pre></td></tr></table>
-
-<a name="hflip"></a>
-<h2 class="section"><a href="libavfilter.html#toc-hflip">8.13 hflip</a></h2>
-
-<p>Flip the input video horizontally.
-</p>
-<p>For example to horizontally flip the video in input with
-&lsquo;<tt>ffmpeg</tt>&rsquo;:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
-</pre></td></tr></table>
-
-<a name="hqdn3d"></a>
-<h2 class="section"><a href="libavfilter.html#toc-hqdn3d">8.14 hqdn3d</a></h2>
-
-<p>High precision/quality 3d denoise filter. This filter aims to reduce
-image noise producing smooth images and making still images really
-still. It should enhance compressibility.
-</p>
-<p>It accepts the following optional parameters:
-<var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
-<dd><p>a non-negative float number which specifies spatial luma strength,
-defaults to 4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
-<dd><p>a non-negative float number which specifies spatial chroma strength,
-defaults to 3.0*<var>luma_spatial</var>/4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
-<dd><p>a float number which specifies luma temporal strength, defaults to
-6.0*<var>luma_spatial</var>/4.0
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
-<dd><p>a float number which specifies chroma temporal strength, defaults to
-<var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
-</p></dd>
-</dl>
-
-<a name="mp"></a>
-<h2 class="section"><a href="libavfilter.html#toc-mp">8.15 mp</a></h2>
-
-<p>Apply an MPlayer filter to the input video.
-</p>
-<p>This filter provides a wrapper around most of the filters of
-MPlayer/MEncoder.
-</p>
-<p>This wrapper is considered experimental. Some of the wrapped filters
-may not work properly and we may drop support for them, as they will
-be implemented natively into FFmpeg. Thus you should avoid
-depending on them when writing portable scripts.
-</p>
-<p>The filters accepts the parameters:
-<var>filter_name</var>[:=]<var>filter_params</var>
-</p>
-<p><var>filter_name</var> is the name of a supported MPlayer filter,
-<var>filter_params</var> is a string containing the parameters accepted by
-the named filter.
-</p>
-<p>The list of the currently supported filters follows:
-</p><dl compact="compact">
-<dt> <var>2xsai</var></dt>
-<dt> <var>blackframe</var></dt>
-<dt> <var>boxblur</var></dt>
-<dt> <var>cropdetect</var></dt>
-<dt> <var>decimate</var></dt>
-<dt> <var>delogo</var></dt>
-<dt> <var>denoise3d</var></dt>
-<dt> <var>detc</var></dt>
-<dt> <var>dint</var></dt>
-<dt> <var>divtc</var></dt>
-<dt> <var>down3dright</var></dt>
-<dt> <var>dsize</var></dt>
-<dt> <var>eq2</var></dt>
-<dt> <var>eq</var></dt>
-<dt> <var>field</var></dt>
-<dt> <var>fil</var></dt>
-<dt> <var>fixpts</var></dt>
-<dt> <var>framestep</var></dt>
-<dt> <var>fspp</var></dt>
-<dt> <var>geq</var></dt>
-<dt> <var>gradfun</var></dt>
-<dt> <var>harddup</var></dt>
-<dt> <var>hqdn3d</var></dt>
-<dt> <var>hue</var></dt>
-<dt> <var>il</var></dt>
-<dt> <var>ilpack</var></dt>
-<dt> <var>ivtc</var></dt>
-<dt> <var>kerndeint</var></dt>
-<dt> <var>mcdeint</var></dt>
-<dt> <var>mirror</var></dt>
-<dt> <var>noise</var></dt>
-<dt> <var>ow</var></dt>
-<dt> <var>palette</var></dt>
-<dt> <var>perspective</var></dt>
-<dt> <var>phase</var></dt>
-<dt> <var>pp7</var></dt>
-<dt> <var>pullup</var></dt>
-<dt> <var>qp</var></dt>
-<dt> <var>rectangle</var></dt>
-<dt> <var>remove-logo</var></dt>
-<dt> <var>rgbtest</var></dt>
-<dt> <var>rotate</var></dt>
-<dt> <var>sab</var></dt>
-<dt> <var>screenshot</var></dt>
-<dt> <var>smartblur</var></dt>
-<dt> <var>softpulldown</var></dt>
-<dt> <var>softskip</var></dt>
-<dt> <var>spp</var></dt>
-<dt> <var>swapuv</var></dt>
-<dt> <var>telecine</var></dt>
-<dt> <var>test</var></dt>
-<dt> <var>tile</var></dt>
-<dt> <var>tinterlace</var></dt>
-<dt> <var>unsharp</var></dt>
-<dt> <var>uspp</var></dt>
-<dt> <var>yuvcsp</var></dt>
-<dt> <var>yvu9</var></dt>
-</dl>
-
-<p>The parameter syntax and behavior for the listed filters are the same
-of the corresponding MPlayer filters. For detailed instructions check
-the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
-mp=delogo=200:200:80:20:1
-
-# adjust gamma, brightness, contrast
-mp=eq2=1.0:2:0.5
-
-# tweak hue and saturation
-mp=hue=100:-10
-</pre></td></tr></table>
-
-<p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
-</p>
-<a name="noformat"></a>
-<h2 class="section"><a href="libavfilter.html#toc-noformat">8.16 noformat</a></h2>
-
-<p>Force libavfilter not to use any of the specified pixel formats for the
-input to the next filter.
-</p>
-<p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
-for example &quot;yuv420p:monow:rgb24&quot;.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># force libavfilter to use a format different from &quot;yuv420p&quot; for the
-# input to the vflip filter
-noformat=yuv420p,vflip
-
-# convert the input video to any of the formats not contained in the list
-noformat=yuv420p:yuv444p:yuv410p
-</pre></td></tr></table>
-
-<a name="null"></a>
-<h2 class="section"><a href="libavfilter.html#toc-null">8.17 null</a></h2>
-
-<p>Pass the video source unchanged to the output.
-</p>
-<a name="ocv"></a>
-<h2 class="section"><a href="libavfilter.html#toc-ocv">8.18 ocv</a></h2>
-
-<p>Apply video transform using libopencv.
-</p>
-<p>To enable this filter install libopencv library and headers and
-configure FFmpeg with &ndash;enable-libopencv.
-</p>
-<p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
-</p>
-<p><var>filter_name</var> is the name of the libopencv filter to apply.
-</p>
-<p><var>filter_params</var> specifies the parameters to pass to the libopencv
-filter. If not specified the default values are assumed.
-</p>
-<p>Refer to the official libopencv documentation for more precise
-informations:
-<a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
-</p>
-<p>Follows the list of supported libopencv filters.
-</p>
-<p><a name="dilate"></a>
-</p><a name="dilate-1"></a>
-<h3 class="subsection"><a href="libavfilter.html#toc-dilate-1">8.18.1 dilate</a></h3>
-
-<p>Dilate an image by using a specific structuring element.
-This filter corresponds to the libopencv function <code>cvDilate</code>.
-</p>
-<p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
-</p>
-<p><var>struct_el</var> represents a structuring element, and has the syntax:
-<var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
-</p>
-<p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
-the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
-point, and <var>shape</var> the shape for the structuring element, and
-can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
-</p>
-<p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
-string of the form &quot;=<var>filename</var>&quot;. The file with name
-<var>filename</var> is assumed to represent a binary image, with each
-printable character corresponding to a bright pixel. When a custom
-<var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
-or columns and rows of the read file are assumed instead.
-</p>
-<p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
-</p>
-<p><var>nb_iterations</var> specifies the number of times the transform is
-applied to the image, and defaults to 1.
-</p>
-<p>Follow some example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
-ocv=dilate
-
-# dilate using a structuring element with a 5x5 cross, iterate two times
-ocv=dilate=5x5+2x2/cross:2
-
-# read the shape from the file diamond.shape, iterate two times
-# the file diamond.shape may contain a pattern of characters like this:
-#   *
-#  ***
-# *****
-#  ***
-#   *
-# the specified cols and rows are ignored (but not the anchor point coordinates)
-ocv=0x0+2x2/custom=diamond.shape:2
-</pre></td></tr></table>
-
-<a name="erode"></a>
-<h3 class="subsection"><a href="libavfilter.html#toc-erode">8.18.2 erode</a></h3>
-
-<p>Erode an image by using a specific structuring element.
-This filter corresponds to the libopencv function <code>cvErode</code>.
-</p>
-<p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
-with the same meaning and use of those of the dilate filter
-(see <a href="#dilate">dilate</a>).
-</p>
-<a name="smooth"></a>
-<h3 class="subsection"><a href="libavfilter.html#toc-smooth">8.18.3 smooth</a></h3>
-
-<p>Smooth the input video.
-</p>
-<p>The filter takes the following parameters:
-<var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
-</p>
-<p><var>type</var> is the type of smooth filter to apply, and can be one of
-the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
-&quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
-</p>
-<p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
-parameters whose meanings depend on smooth type. <var>param1</var> and
-<var>param2</var> accept integer positive values or 0, <var>param3</var> and
-<var>param4</var> accept float values.
-</p>
-<p>The default value for <var>param1</var> is 3, the default value for the
-other parameters is 0.
-</p>
-<p>These parameters correspond to the parameters assigned to the
-libopencv function <code>cvSmooth</code>.
-</p>
-<a name="overlay"></a>
-<h2 class="section"><a href="libavfilter.html#toc-overlay">8.19 overlay</a></h2>
-
-<p>Overlay one video on top of another.
-</p>
-<p>It takes two inputs and one output, the first input is the &quot;main&quot;
-video on which the second input is overlayed.
-</p>
-<p>It accepts the parameters: <var>x</var>:<var>y</var>.
-</p>
-<p><var>x</var> is the x coordinate of the overlayed video on the main video,
-<var>y</var> is the y coordinate. The parameters are expressions containing
-the following parameters:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>main_w, main_h</samp>&rsquo;</dt>
-<dd><p>main input width and height
-</p>
-</dd>
-<dt> &lsquo;<samp>W, H</samp>&rsquo;</dt>
-<dd><p>same as <var>main_w</var> and <var>main_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>overlay_w, overlay_h</samp>&rsquo;</dt>
-<dd><p>overlay input width and height
-</p>
-</dd>
-<dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
-<dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
-</p></dd>
-</dl>
-
-<p>Be aware that frames are taken from each input video in timestamp
-order, hence, if their initial timestamps differ, it is a a good idea
-to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
-have them begin in the same zero timestamp, as it does the example for
-the <var>movie</var> filter.
-</p>
-<p>Follow some examples:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
-# corner of the main video.
-overlay=main_w-overlay_w-10:main_h-overlay_h-10
-
-# insert a transparent PNG logo in the bottom left corner of the input
-movie=logo.png [logo];
-[in][logo] overlay=10:main_h-overlay_h-10 [out]
-
-# insert 2 different transparent PNG logos (second logo on bottom
-# right corner):
-movie=logo1.png [logo1];
-movie=logo2.png [logo2];
-[in][logo1]       overlay=10:H-h-10 [in+logo1];
-[in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
-
-# add a transparent color layer on top of the main video,
-# WxH specifies the size of the main input to the overlay filter
-color=red.3:WxH [over]; [in][over] overlay [out]
-</pre></td></tr></table>
-
-<p>You can chain togheter more overlays but the efficiency of such
-approach is yet to be tested.
-</p>
-<a name="pad"></a>
-<h2 class="section"><a href="libavfilter.html#toc-pad">8.20 pad</a></h2>
-
-<p>Add paddings to the input image, and places the original input at the
-given coordinates <var>x</var>, <var>y</var>.
-</p>
-<p>It accepts the following parameters:
-<var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
-</p>
-<p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
-expressions containing the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input video width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output width and heigth, that is the size of the padded area as
-specified by the <var>width</var> and <var>height</var> expressions
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
-expressions, or NAN if not yet specified
-</p>
-</dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
-<dd><p>horizontal and vertical chroma subsample values. For example for the
-pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
-</p></dd>
-</dl>
-
-<p>Follows the description of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd>
-<p>Specify the size of the output image with the paddings added. If the
-value for <var>width</var> or <var>height</var> is 0, the corresponding input size
-is used for the output.
-</p>
-<p>The <var>width</var> expression can reference the value set by the
-<var>height</var> expression, and viceversa.
-</p>
-<p>The default value of <var>width</var> and <var>height</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
-<dd>
-<p>Specify the offsets where to place the input image in the padded area
-with respect to the top/left border of the output image.
-</p>
-<p>The <var>x</var> expression can reference the value set by the <var>y</var>
-expression, and viceversa.
-</p>
-<p>The default value of <var>x</var> and <var>y</var> is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd>
-<p>Specify the color of the padded area, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-</p>
-<p>The default value of <var>color</var> is &quot;black&quot;.
-</p>
-</dd>
-</dl>
-
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># Add paddings with color &quot;violet&quot; to the input video. Output video
-# size is 640x480, the top-left corner of the input video is placed at
-# column 0, row 40.
-pad=640:480:0:40:violet
-
-# pad the input to get an output with dimensions increased bt 3/2,
-# and put the input video at the center of the padded area
-pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
-
-# pad the input to get a squared output with size equal to the maximum
-# value between the input width and height, and put the input video at
-# the center of the padded area
-pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
-
-# pad the input to get a final w/h ratio of 16:9
-pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
-
-# double output size and put the input video in the bottom-right
-# corner of the output padded area
-pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
-</pre></td></tr></table>
-
-<a name="pixdesctest"></a>
-<h2 class="section"><a href="libavfilter.html#toc-pixdesctest">8.21 pixdesctest</a></h2>
-
-<p>Pixel format descriptor test filter, mainly useful for internal
-testing. The output video should be equal to the input video.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
-</pre></td></tr></table>
-
-<p>can be used to test the monowhite pixel format descriptor definition.
-</p>
-<a name="scale"></a>
-<h2 class="section"><a href="libavfilter.html#toc-scale">8.22 scale</a></h2>
-
-<p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
-</p>
-<p>The parameters <var>width</var> and <var>height</var> are expressions containing
-the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
-<dd><p>the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-</p>
-</dd>
-<dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
-<dd><p>the input width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
-<dd><p>same as <var>in_w</var> and <var>in_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
-<dd><p>the output (cropped) width and heigth
-</p>
-</dd>
-<dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
-<dd><p>same as <var>out_w</var> and <var>out_h</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
-<dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
-<dd><p>horizontal and vertical chroma subsample values. For example for the
-pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
-</p></dd>
-</dl>
-
-<p>If the input image format is different from the format requested by
-the next filter, the scale filter will convert the input to the
-requested format.
-</p>
-<p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
-size is used for the output.
-</p>
-<p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
-use, for the respective output size, a value that maintains the aspect
-ratio of the input image.
-</p>
-<p>The default value of <var>width</var> and <var>height</var> is 0.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># scale the input video to a size of 200x100.
-scale=200:100
-
-# scale the input to 2x
-scale=2*iw:2*ih
-# the above is the same as
-scale=2*in_w:2*in_h
-
-# scale the input to half size
-scale=iw/2:ih/2
-
-# increase the width, and set the height to the same size
-scale=3/2*iw:ow
-
-# seek for Greek harmony
-scale=iw:1/PHI*iw
-scale=ih*PHI:ih
-
-# increase the height, and set the width to 3/2 of the height
-scale=3/2*oh:3/5*ih
-
-# increase the size, but make the size a multiple of the chroma
-scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
-
-# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
-scale='min(500\, iw*3/2):-1'
-</pre></td></tr></table>
-
-<a name="select"></a>
-<h2 class="section"><a href="libavfilter.html#toc-select">8.23 select</a></h2>
-<p>Select frames to pass in output.
-</p>
-<p>It accepts in input an expression, which is evaluated for each input
-frame. If the expression is evaluated to a non-zero value, the frame
-is selected and passed to the output, otherwise it is discarded.
-</p>
-<p>The expression can contain the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
-<dd><p>Greek PI
-</p>
-</dd>
-<dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
-<dd><p>golden ratio
-</p>
-</dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Euler number
-</p>
-</dd>
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the filtered frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the selected frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
-<dd><p>the sequential number of the last selected frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
-<dd><p>timebase of the input timestamps
-</p>
-</dd>
-<dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
-<dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in <var>TB</var> units, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
-<dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in seconds, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the previously filtered video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the last previously filtered video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
-<dd><p>the PTS of the last previously selected video frame, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
-<dd><p>the PTS of the first video frame in the video, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
-<dd><p>the time of the first video frame in the video, NAN if undefined
-</p>
-</dd>
-<dt> &lsquo;<samp>pict_type</samp>&rsquo;</dt>
-<dd><p>the picture type of the filtered frame, can assume one of the following
-values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>PICT_TYPE_I</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_P</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_B</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_S</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_SI</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_SP</samp>&rsquo;</dt>
-<dt> &lsquo;<samp>PICT_TYPE_BI</samp>&rsquo;</dt>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>interlace_type</samp>&rsquo;</dt>
-<dd><p>the frame interlace type, can assume one of the following values:
-</p><dl compact="compact">
-<dt> &lsquo;<samp>INTERLACE_TYPE_P</samp>&rsquo;</dt>
-<dd><p>the frame is progressive (not interlaced)
-</p></dd>
-<dt> &lsquo;<samp>INTERLACE_TYPE_T</samp>&rsquo;</dt>
-<dd><p>the frame is top-field-first
-</p></dd>
-<dt> &lsquo;<samp>INTERLACE_TYPE_B</samp>&rsquo;</dt>
-<dd><p>the frame is bottom-field-first
-</p></dd>
-</dl>
-
-</dd>
-<dt> &lsquo;<samp>key</samp>&rsquo;</dt>
-<dd><p>1 if the filtered frame is a key-frame, 0 otherwise
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>the position in the file of the filtered frame, -1 if the information
-is not available (e.g. for synthetic video)
-</p></dd>
-</dl>
-
-<p>The default value of the select expression is &quot;1&quot;.
-</p>
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># select all frames in input
-select
-
-# the above is the same as:
-select=1
-
-# skip all frames:
-select=0
-
-# select only I-frames
-select='eq(pict_type\,PICT_TYPE_I)'
-
-# select one frame every 100
-select='not(mod(n\,100))'
-
-# select only frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)'
-
-# select only I frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
-
-# select frames with a minimum distance of 10 seconds
-select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
-</pre></td></tr></table>
-
-<p><a name="setdar"></a>
-</p><a name="setdar-1"></a>
-<h2 class="section"><a href="libavfilter.html#toc-setdar-1">8.24 setdar</a></h2>
-
-<p>Set the Display Aspect Ratio for the filter output video.
-</p>
-<p>This is done by changing the specified Sample (aka Pixel) Aspect
-Ratio, according to the following equation:
-<em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
-</p>
-<p>Keep in mind that this filter does not modify the pixel dimensions of
-the video frame. Also the display aspect ratio set by this filter may
-be changed by later filters in the filterchain, e.g. in case of
-scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is applied.
-</p>
-<p>The filter accepts a parameter string which represents the wanted
-display aspect ratio.
-The parameter can be a floating point number string, or an expression
-of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio.
-If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
-</p>
-<p>For example to change the display aspect ratio to 16:9, specify:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">setdar=16:9
-# the above is equivalent to
-setdar=1.77777
-</pre></td></tr></table>
-
-<p>See also the &quot;setsar&quot; filter documentation (see <a href="#setsar">setsar</a>).
-</p>
-<a name="setpts"></a>
-<h2 class="section"><a href="libavfilter.html#toc-setpts">8.25 setpts</a></h2>
-
-<p>Change the PTS (presentation timestamp) of the input video frames.
-</p>
-<p>Accept in input an expression evaluated through the eval API, which
-can contain the following constants:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
-<dd><p>the presentation timestamp in input
-</p>
-</dd>
-<dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
-<dd><p>Greek PI
-</p>
-</dd>
-<dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
-<dd><p>golden ratio
-</p>
-</dd>
-<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
-<dd><p>Euler number
-</p>
-</dd>
-<dt> &lsquo;<samp>N</samp>&rsquo;</dt>
-<dd><p>the count of the input frame, starting from 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
-<dd><p>the PTS of the first video frame
-</p>
-</dd>
-<dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
-<dd><p>tell if the current frame is interlaced
-</p>
-</dd>
-<dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
-<dd><p>original position in the file of the frame, or undefined if undefined
-for the current frame
-</p>
-</dd>
-<dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
-<dd><p>previous input PTS
-</p>
-</dd>
-<dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
-<dd><p>previous output PTS
-</p>
-</dd>
-</dl>
-
-<p>Some examples follow:
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># start counting PTS from zero
-setpts=PTS-STARTPTS
-
-# fast motion
-setpts=0.5*PTS
-
-# slow motion
-setpts=2.0*PTS
-
-# fixed rate 25 fps
-setpts=N/(25*TB)
-
-# fixed rate 25 fps with some jitter
-setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
-</pre></td></tr></table>
-
-<p><a name="setsar"></a>
-</p><a name="setsar-1"></a>
-<h2 class="section"><a href="libavfilter.html#toc-setsar-1">8.26 setsar</a></h2>
-
-<p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
-</p>
-<p>Note that as a consequence of the application of this filter, the
-output display aspect ratio will change according to the following
-equation:
-<em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
-</p>
-<p>Keep in mind that the sample aspect ratio set by this filter may be
-changed by later filters in the filterchain, e.g. if another &quot;setsar&quot;
-or a &quot;setdar&quot; filter is applied.
-</p>
-<p>The filter accepts a parameter string which represents the wanted
-sample aspect ratio.
-The parameter can be a floating point number string, or an expression
-of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
-numerator and denominator of the aspect ratio.
-If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
-</p>
-<p>For example to change the sample aspect ratio to 10:11, specify:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">setsar=10:11
-</pre></td></tr></table>
-
-<a name="settb"></a>
-<h2 class="section"><a href="libavfilter.html#toc-settb">8.27 settb</a></h2>
-
-<p>Set the timebase to use for the output frames timestamps.
-It is mainly useful for testing timebase configuration.
-</p>
-<p>It accepts in input an arithmetic expression representing a rational.
-The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;, &quot;AVTB&quot; (the
-default timebase), and &quot;intb&quot; (the input timebase).
-</p>
-<p>The default value for the input is &quot;intb&quot;.
-</p>
-<p>Follow some examples.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example"># set the timebase to 1/25
-settb=1/25
-
-# set the timebase to 1/10
-settb=0.1
-
-#set the timebase to 1001/1000
-settb=1+0.001
-
-#set the timebase to 2*intb
-settb=2*intb
-
-#set the default timebase value
-settb=AVTB
-</pre></td></tr></table>
-
-<a name="showinfo"></a>
-<h2 class="section"><a href="libavfilter.html#toc-showinfo">8.28 showinfo</a></h2>
-
-<p>Show a line containing various information for each input video frame.
-The input video is not modified.
-</p>
-<p>The shown line contains a sequence of key/value pairs of the form
-<var>key</var>:<var>value</var>.
-</p>
-<p>A description of each shown parameter follows:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
-<dd><p>sequential number of the input frame, starting from 0
-</p>
-</dd>
-<dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
-<dd><p>Presentation TimeStamp of the input frame, expressed as a number of
-time base units. The time base unit depends on the filter input pad.
-</p>
-</dd>
-<dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
-<dd><p>Presentation TimeStamp of the input frame, expressed as a number of
-seconds
-</p>
-</dd>
-<dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
-<dd><p>position of the frame in the input stream, -1 if this information in
-unavailable and/or meanigless (for example in case of synthetic video)
-</p>
-</dd>
-<dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
-<dd><p>pixel format name
-</p>
-</dd>
-<dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
-<dd><p>sample aspect ratio of the input frame, expressed in the form
-<var>num</var>/<var>den</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>s</samp>&rsquo;</dt>
-<dd><p>size of the input frame, expressed in the form
-<var>width</var>x<var>height</var>
-</p>
-</dd>
-<dt> &lsquo;<samp>i</samp>&rsquo;</dt>
-<dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
-for bottom field first)
-</p>
-</dd>
-<dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
-<dd><p>1 if the frame is a key frame, 0 otherwise
-</p>
-</dd>
-<dt> &lsquo;<samp>type</samp>&rsquo;</dt>
-<dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
-P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
-Check also the documentation of the <code>AVPictureType</code> enum and of
-the <code>av_get_picture_type_char</code> function defined in
-&lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
-</p>
-</dd>
-<dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
-<dd><p>Adler-32 checksum of all the planes of the input frame
-</p>
-</dd>
-<dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
-<dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
-&quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
-</p></dd>
-</dl>
-
-<a name="slicify"></a>
-<h2 class="section"><a href="libavfilter.html#toc-slicify">8.29 slicify</a></h2>
-
-<p>Pass the images of input video on to next video filter as multiple
-slices.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;slicify=32&quot; out.avi
-</pre></td></tr></table>
-
-<p>The filter accepts the slice height as parameter. If the parameter is
-not specified it will use the default value of 16.
-</p>
-<p>Adding this in the beginning of filter chains should make filtering
-faster due to better use of the memory cache.
-</p>
-<a name="split"></a>
-<h2 class="section"><a href="libavfilter.html#toc-split">8.30 split</a></h2>
-
-<p>Pass on the input video to two outputs. Both outputs are identical to
-the input video.
-</p>
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
-[splitout1] crop=100:100:0:0    [cropout];
-[splitout2] pad=200:200:100:100 [padout];
-</pre></td></tr></table>
-
-<p>will create two separate outputs from the same input, one cropped and
-one padded.
-</p>
-<a name="transpose"></a>
-<h2 class="section"><a href="libavfilter.html#toc-transpose">8.31 transpose</a></h2>
-
-<p>Transpose rows with columns in the input video and optionally flip it.
-</p>
-<p>It accepts a parameter representing an integer, which can assume the
-values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
-. . -&gt;  . .
-l.r     R.r
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees clockwise, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
-. . -&gt;  . .
-l.r     r.R
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees counterclockwise, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
-. . -&gt;  . .
-l.r     L.l
-</pre></td></tr></table>
-
-</dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
-. . -&gt;  . .
-l.r     l.L
-</pre></td></tr></table>
-</dd>
-</dl>
-
-<a name="unsharp"></a>
-<h2 class="section"><a href="libavfilter.html#toc-unsharp">8.32 unsharp</a></h2>
-
-<p>Sharpen or blur the input video.
-</p>
-<p>It accepts the following parameters:
-<var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>
-</p>
-<p>Negative values for the amount will blur the input video, while positive
-values will sharpen. All parameters are optional and default to the
-equivalent of the string &rsquo;5:5:1.0:0:0:0.0&rsquo;.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>luma_msize_x</samp>&rsquo;</dt>
-<dd><p>Set the luma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_msize_y</samp>&rsquo;</dt>
-<dd><p>Set the luma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
-<dd><p>Set the luma effect strength. It can be a float number between -2.0
-and 5.0, default value is 1.0.
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_msize_x</samp>&rsquo;</dt>
-<dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
-and 13, default value is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>chroma_msize_y</samp>&rsquo;</dt>
-<dd><p>Set the chroma matrix vertical size. It can be an integer between 3
-and 13, default value is 0.
-</p>
-</dd>
-<dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
-<dd><p>Set the chroma effect strength. It can be a float number between -2.0
-and 5.0, default value is 0.0.
-</p>
-</dd>
-</dl>
-
-<table><tr><td>&nbsp;</td><td><pre class="example"># Strong luma sharpen effect parameters
-unsharp=7:7:2.5
-
-# Strong blur of both luma and chroma parameters
-unsharp=7:7:-2:7:7:-2
-
-# Use the default values with <code>ffmpeg</code>
-./ffmpeg -i in.avi -vf &quot;unsharp&quot; out.mp4
-</pre></td></tr></table>
-
-<a name="vflip"></a>
-<h2 class="section"><a href="libavfilter.html#toc-vflip">8.33 vflip</a></h2>
-
-<p>Flip the input video vertically.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
-</pre></td></tr></table>
-
-<a name="yadif"></a>
-<h2 class="section"><a href="libavfilter.html#toc-yadif">8.34 yadif</a></h2>
-
-<p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
-filter&quot;).
-</p>
-<p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>.
-</p>
-<p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
-following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>output 1 frame for each frame
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>output 1 frame for each field
-</p></dd>
-<dt> &lsquo;<samp>2</samp>&rsquo;</dt>
-<dd><p>like 0 but skips spatial interlacing check
-</p></dd>
-<dt> &lsquo;<samp>3</samp>&rsquo;</dt>
-<dd><p>like 1 but skips spatial interlacing check
-</p></dd>
-</dl>
-
-<p>Default value is 0.
-</p>
-<p><var>parity</var> specifies the picture field parity assumed for the input
-interlaced video, accepts one of the following values:
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>0</samp>&rsquo;</dt>
-<dd><p>assume bottom field first
-</p></dd>
-<dt> &lsquo;<samp>1</samp>&rsquo;</dt>
-<dd><p>assume top field first
-</p></dd>
-<dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
-<dd><p>enable automatic detection
-</p></dd>
-</dl>
-
-<p>Default value is -1.
-If interlacing is unknown or decoder does not export this information,
-top field first will be assumed.
-</p>
-
-<a name="Video-Sources"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Video-Sources">9. Video Sources</a></h1>
-
-<p>Below is a description of the currently available video sources.
-</p>
-<a name="buffer"></a>
-<h2 class="section"><a href="libavfilter.html#toc-buffer">9.1 buffer</a></h2>
-
-<p>Buffer video frames, and make them available to the filter chain.
-</p>
-<p>This source is mainly intended for a programmatic use, in particular
-through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
-</p>
-<p>It accepts the following parameters:
-<var>width</var>:<var>height</var>:<var>pix_fmt_string</var>:<var>timebase_num</var>:<var>timebase_den</var>:<var>sample_aspect_ratio_num</var>:<var>sample_aspect_ratio.den</var>:<var>scale_params</var>
-</p>
-<p>All the parameters but <var>scale_params</var> need to be explicitely
-defined.
-</p>
-<p>Follows the list of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
-<dd><p>Specify the width and height of the buffered video frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>pix_fmt_string</samp>&rsquo;</dt>
-<dd><p>A string representing the pixel format of the buffered video frames.
-It may be a number corresponding to a pixel format, or a pixel format
-name.
-</p>
-</dd>
-<dt> &lsquo;<samp>timebase_num, timebase_den</samp>&rsquo;</dt>
-<dd><p>Specify numerator and denomitor of the timebase assumed by the
-timestamps of the buffered frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>&rsquo;</dt>
-<dd><p>Specify numerator and denominator of the sample aspect ratio assumed
-by the video frames.
-</p>
-</dd>
-<dt> &lsquo;<samp>scale_params</samp>&rsquo;</dt>
-<dd><p>Specify the optional parameters to be used for the scale filter which
-is automatically inserted when an input change is detected in the
-input size or format.
-</p></dd>
-</dl>
-
-<p>For example:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
-</pre></td></tr></table>
-
-<p>will instruct the source to accept video frames with size 320x240 and
-with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
-square pixels (1:1 sample aspect ratio).
-Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
-(check the enum PixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
-this example corresponds to:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:6:1:24:1:1
-</pre></td></tr></table>
-
-<a name="color"></a>
-<h2 class="section"><a href="libavfilter.html#toc-color">9.2 color</a></h2>
-
-<p>Provide an uniformly colored input.
-</p>
-<p>It accepts the following parameters:
-<var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
-</p>
-<p>Follows the description of the accepted parameters.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>color</samp>&rsquo;</dt>
-<dd><p>Specify the color of the source. It can be the name of a color (case
-insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
-alpha specifier. The default value is &quot;black&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
-<dd><p>Specify the size of the sourced video, it may be a string of the form
-<var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
-default value is &quot;320x240&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
-<dd><p>Specify the frame rate of the sourced video, as the number of frames
-generated per second. It has to be a string in the format
-<var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
-number or a valid video frame rate abbreviation. The default value is
-&quot;25&quot;.
-</p>
-</dd>
-</dl>
-
-<p>For example the following graph description will generate a red source
-with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
-frames per second, which will be overlayed over the source connected
-to the pad with identifier &quot;in&quot;.
-</p>
-<table><tr><td>&nbsp;</td><td><pre class="example">&quot;color=red@0.2:qcif:10 [color]; [in][color] overlay [out]&quot;
-</pre></td></tr></table>
-
-<a name="movie"></a>
-<h2 class="section"><a href="libavfilter.html#toc-movie">9.3 movie</a></h2>
-
-<p>Read a video stream from a movie container.
-</p>
-<p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
-<var>movie_name</var> is the name of the resource to read (not necessarily
-a file but also a device or a stream accessed through some protocol),
-and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
-pairs, separated by &quot;:&quot;.
-</p>
-<p>The description of the accepted options follows.
-</p>
-<dl compact="compact">
-<dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
-<dd><p>Specifies the format assumed for the movie to read, and can be either
-the name of a container or an input device. If not specified the
-format is guessed from <var>movie_name</var> or by probing.
-</p>
-</dd>
-<dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
-<dd><p>Specifies the seek point in seconds, the frames will be output
-starting from this seek point, the parameter is evaluated with
-<code>av_strtod</code> so the numerical value may be suffixed by an IS
-postfix. Default value is &quot;0&quot;.
-</p>
-</dd>
-<dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
-<dd><p>Specifies the index of the video stream to read. If the value is -1,
-the best suited video stream will be automatically selected. Default
-value is &quot;-1&quot;.
-</p>
-</dd>
-</dl>
-
-<p>This filter allows to overlay a second video on top of main input of
-a filtergraph as shown in this graph:
-</p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
-                                    ^
-                                    |
-movie --&gt; scale--&gt; deltapts1 -------+
-</pre></td></tr></table>
-
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
-# on top of the input labelled as &quot;in&quot;.
-movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-# read from a video4linux2 device, and overlay it on top of the input
-# labelled as &quot;in&quot;
-movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-</pre></td></tr></table>
-
-<a name="nullsrc"></a>
-<h2 class="section"><a href="libavfilter.html#toc-nullsrc">9.4 nullsrc</a></h2>
-
-<p>Null video source, never return images. It is mainly useful as a
-template and to be employed in analysis / debugging tools.
-</p>
-<p>It accepts as optional parameter a string of the form
-<var>width</var>:<var>height</var>:<var>timebase</var>.
-</p>
-<p><var>width</var> and <var>height</var> specify the size of the configured
-source. The default values of <var>width</var> and <var>height</var> are
-respectively 352 and 288 (corresponding to the CIF size format).
-</p>
-<p><var>timebase</var> specifies an arithmetic expression representing a
-timebase. The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;,
-&quot;AVTB&quot; (the default timebase), and defaults to the value &quot;AVTB&quot;.
-</p>
-<a name="frei0r_005fsrc"></a>
-<h2 class="section"><a href="libavfilter.html#toc-frei0r_005fsrc">9.5 frei0r_src</a></h2>
-
-<p>Provide a frei0r source.
-</p>
-<p>To enable compilation of this filter you need to install the frei0r
-header and configure FFmpeg with &ndash;enable-frei0r.
-</p>
-<p>The source supports the syntax:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
-</pre></td></tr></table>
-
-<p><var>size</var> is the size of the video to generate, may be a string of the
-form <var>width</var>x<var>height</var> or a frame size abbreviation.
-<var>rate</var> is the rate of the video to generate, may be a string of
-the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
-<var>src_name</var> is the name to the frei0r source to load. For more
-information regarding frei0r and how to set the parameters read the
-section &quot;frei0r&quot; (see <a href="#frei0r">frei0r</a>) in the description of the video
-filters.
-</p>
-<p>Some examples follow:
-</p><table><tr><td>&nbsp;</td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
-# which is overlayed on the overlay filter main input
-frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
-</pre></td></tr></table>
-
-
-<a name="Video-Sinks"></a>
-<h1 class="chapter"><a href="libavfilter.html#toc-Video-Sinks">10. Video Sinks</a></h1>
-
-<p>Below is a description of the currently available video sinks.
-</p>
-<a name="nullsink"></a>
-<h2 class="section"><a href="libavfilter.html#toc-nullsink">10.1 nullsink</a></h2>
-
-<p>Null video sink, do absolutely nothing with the input video. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-</p>
-
-
-<hr size="1">
-<p>
- <font size="-1">
-  This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
diff --git a/ffmpeg 0.7/include/inttypes.h b/ffmpeg 0.7/include/inttypes.h
deleted file mode 100644 (file)
index 2554277..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-// ISO C9x  compliant inttypes.h for Microsoft Visual Studio\r
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \r
-// \r
-//  Copyright (c) 2006 Alexander Chemeris\r
-// \r
-// Redistribution and use in source and binary forms, with or without\r
-// modification, are permitted provided that the following conditions are met:\r
-// \r
-//   1. Redistributions of source code must retain the above copyright notice,\r
-//      this list of conditions and the following disclaimer.\r
-// \r
-//   2. Redistributions in binary form must reproduce the above copyright\r
-//      notice, this list of conditions and the following disclaimer in the\r
-//      documentation and/or other materials provided with the distribution.\r
-// \r
-//   3. The name of the author may be used to endorse or promote products\r
-//      derived from this software without specific prior written permission.\r
-// \r
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-// \r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifndef _MSC_VER // [\r
-#error "Use this header only with Microsoft Visual C++ compilers!"\r
-#endif // _MSC_VER ]\r
-\r
-#ifndef _MSC_INTTYPES_H_ // [\r
-#define _MSC_INTTYPES_H_\r
-\r
-#if _MSC_VER > 1000\r
-#pragma once\r
-#endif\r
-\r
-#include "stdint.h"\r
-\r
-// 7.8 Format conversion of integer types\r
-\r
-typedef struct {\r
-   intmax_t quot;\r
-   intmax_t rem;\r
-} imaxdiv_t;\r
-\r
-// 7.8.1 Macros for format specifiers\r
-\r
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [   See footnote 185 at page 198\r
-\r
-// The fprintf macros for signed integers are:\r
-#define PRId8       "d"\r
-#define PRIi8       "i"\r
-#define PRIdLEAST8  "d"\r
-#define PRIiLEAST8  "i"\r
-#define PRIdFAST8   "d"\r
-#define PRIiFAST8   "i"\r
-\r
-#define PRId16       "hd"\r
-#define PRIi16       "hi"\r
-#define PRIdLEAST16  "hd"\r
-#define PRIiLEAST16  "hi"\r
-#define PRIdFAST16   "hd"\r
-#define PRIiFAST16   "hi"\r
-\r
-#define PRId32       "I32d"\r
-#define PRIi32       "I32i"\r
-#define PRIdLEAST32  "I32d"\r
-#define PRIiLEAST32  "I32i"\r
-#define PRIdFAST32   "I32d"\r
-#define PRIiFAST32   "I32i"\r
-\r
-#define PRId64       "I64d"\r
-#define PRIi64       "I64i"\r
-#define PRIdLEAST64  "I64d"\r
-#define PRIiLEAST64  "I64i"\r
-#define PRIdFAST64   "I64d"\r
-#define PRIiFAST64   "I64i"\r
-\r
-#define PRIdMAX     "I64d"\r
-#define PRIiMAX     "I64i"\r
-\r
-#define PRIdPTR     "Id"\r
-#define PRIiPTR     "Ii"\r
-\r
-// The fprintf macros for unsigned integers are:\r
-#define PRIo8       "o"\r
-#define PRIu8       "u"\r
-#define PRIx8       "x"\r
-#define PRIX8       "X"\r
-#define PRIoLEAST8  "o"\r
-#define PRIuLEAST8  "u"\r
-#define PRIxLEAST8  "x"\r
-#define PRIXLEAST8  "X"\r
-#define PRIoFAST8   "o"\r
-#define PRIuFAST8   "u"\r
-#define PRIxFAST8   "x"\r
-#define PRIXFAST8   "X"\r
-\r
-#define PRIo16       "ho"\r
-#define PRIu16       "hu"\r
-#define PRIx16       "hx"\r
-#define PRIX16       "hX"\r
-#define PRIoLEAST16  "ho"\r
-#define PRIuLEAST16  "hu"\r
-#define PRIxLEAST16  "hx"\r
-#define PRIXLEAST16  "hX"\r
-#define PRIoFAST16   "ho"\r
-#define PRIuFAST16   "hu"\r
-#define PRIxFAST16   "hx"\r
-#define PRIXFAST16   "hX"\r
-\r
-#define PRIo32       "I32o"\r
-#define PRIu32       "I32u"\r
-#define PRIx32       "I32x"\r
-#define PRIX32       "I32X"\r
-#define PRIoLEAST32  "I32o"\r
-#define PRIuLEAST32  "I32u"\r
-#define PRIxLEAST32  "I32x"\r
-#define PRIXLEAST32  "I32X"\r
-#define PRIoFAST32   "I32o"\r
-#define PRIuFAST32   "I32u"\r
-#define PRIxFAST32   "I32x"\r
-#define PRIXFAST32   "I32X"\r
-\r
-#define PRIo64       "I64o"\r
-#define PRIu64       "I64u"\r
-#define PRIx64       "I64x"\r
-#define PRIX64       "I64X"\r
-#define PRIoLEAST64  "I64o"\r
-#define PRIuLEAST64  "I64u"\r
-#define PRIxLEAST64  "I64x"\r
-#define PRIXLEAST64  "I64X"\r
-#define PRIoFAST64   "I64o"\r
-#define PRIuFAST64   "I64u"\r
-#define PRIxFAST64   "I64x"\r
-#define PRIXFAST64   "I64X"\r
-\r
-#define PRIoMAX     "I64o"\r
-#define PRIuMAX     "I64u"\r
-#define PRIxMAX     "I64x"\r
-#define PRIXMAX     "I64X"\r
-\r
-#define PRIoPTR     "Io"\r
-#define PRIuPTR     "Iu"\r
-#define PRIxPTR     "Ix"\r
-#define PRIXPTR     "IX"\r
-\r
-// The fscanf macros for signed integers are:\r
-#define SCNd8       "d"\r
-#define SCNi8       "i"\r
-#define SCNdLEAST8  "d"\r
-#define SCNiLEAST8  "i"\r
-#define SCNdFAST8   "d"\r
-#define SCNiFAST8   "i"\r
-\r
-#define SCNd16       "hd"\r
-#define SCNi16       "hi"\r
-#define SCNdLEAST16  "hd"\r
-#define SCNiLEAST16  "hi"\r
-#define SCNdFAST16   "hd"\r
-#define SCNiFAST16   "hi"\r
-\r
-#define SCNd32       "ld"\r
-#define SCNi32       "li"\r
-#define SCNdLEAST32  "ld"\r
-#define SCNiLEAST32  "li"\r
-#define SCNdFAST32   "ld"\r
-#define SCNiFAST32   "li"\r
-\r
-#define SCNd64       "I64d"\r
-#define SCNi64       "I64i"\r
-#define SCNdLEAST64  "I64d"\r
-#define SCNiLEAST64  "I64i"\r
-#define SCNdFAST64   "I64d"\r
-#define SCNiFAST64   "I64i"\r
-\r
-#define SCNdMAX     "I64d"\r
-#define SCNiMAX     "I64i"\r
-\r
-#ifdef _WIN64 // [\r
-#  define SCNdPTR     "I64d"\r
-#  define SCNiPTR     "I64i"\r
-#else  // _WIN64 ][\r
-#  define SCNdPTR     "ld"\r
-#  define SCNiPTR     "li"\r
-#endif  // _WIN64 ]\r
-\r
-// The fscanf macros for unsigned integers are:\r
-#define SCNo8       "o"\r
-#define SCNu8       "u"\r
-#define SCNx8       "x"\r
-#define SCNX8       "X"\r
-#define SCNoLEAST8  "o"\r
-#define SCNuLEAST8  "u"\r
-#define SCNxLEAST8  "x"\r
-#define SCNXLEAST8  "X"\r
-#define SCNoFAST8   "o"\r
-#define SCNuFAST8   "u"\r
-#define SCNxFAST8   "x"\r
-#define SCNXFAST8   "X"\r
-\r
-#define SCNo16       "ho"\r
-#define SCNu16       "hu"\r
-#define SCNx16       "hx"\r
-#define SCNX16       "hX"\r
-#define SCNoLEAST16  "ho"\r
-#define SCNuLEAST16  "hu"\r
-#define SCNxLEAST16  "hx"\r
-#define SCNXLEAST16  "hX"\r
-#define SCNoFAST16   "ho"\r
-#define SCNuFAST16   "hu"\r
-#define SCNxFAST16   "hx"\r
-#define SCNXFAST16   "hX"\r
-\r
-#define SCNo32       "lo"\r
-#define SCNu32       "lu"\r
-#define SCNx32       "lx"\r
-#define SCNX32       "lX"\r
-#define SCNoLEAST32  "lo"\r
-#define SCNuLEAST32  "lu"\r
-#define SCNxLEAST32  "lx"\r
-#define SCNXLEAST32  "lX"\r
-#define SCNoFAST32   "lo"\r
-#define SCNuFAST32   "lu"\r
-#define SCNxFAST32   "lx"\r
-#define SCNXFAST32   "lX"\r
-\r
-#define SCNo64       "I64o"\r
-#define SCNu64       "I64u"\r
-#define SCNx64       "I64x"\r
-#define SCNX64       "I64X"\r
-#define SCNoLEAST64  "I64o"\r
-#define SCNuLEAST64  "I64u"\r
-#define SCNxLEAST64  "I64x"\r
-#define SCNXLEAST64  "I64X"\r
-#define SCNoFAST64   "I64o"\r
-#define SCNuFAST64   "I64u"\r
-#define SCNxFAST64   "I64x"\r
-#define SCNXFAST64   "I64X"\r
-\r
-#define SCNoMAX     "I64o"\r
-#define SCNuMAX     "I64u"\r
-#define SCNxMAX     "I64x"\r
-#define SCNXMAX     "I64X"\r
-\r
-#ifdef _WIN64 // [\r
-#  define SCNoPTR     "I64o"\r
-#  define SCNuPTR     "I64u"\r
-#  define SCNxPTR     "I64x"\r
-#  define SCNXPTR     "I64X"\r
-#else  // _WIN64 ][\r
-#  define SCNoPTR     "lo"\r
-#  define SCNuPTR     "lu"\r
-#  define SCNxPTR     "lx"\r
-#  define SCNXPTR     "lX"\r
-#endif  // _WIN64 ]\r
-\r
-#endif // __STDC_FORMAT_MACROS ]\r
-\r
-// 7.8.2 Functions for greatest-width integer types\r
-\r
-// 7.8.2.1 The imaxabs function\r
-#define imaxabs _abs64\r
-\r
-// 7.8.2.2 The imaxdiv function\r
-\r
-// This is modified version of div() function from Microsoft's div.c found\r
-// in %MSVC.NET%\crt\src\div.c\r
-#ifdef STATIC_IMAXDIV // [\r
-static\r
-#else // STATIC_IMAXDIV ][\r
-_inline\r
-#endif // STATIC_IMAXDIV ]\r
-imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)\r
-{\r
-   imaxdiv_t result;\r
-\r
-   result.quot = numer / denom;\r
-   result.rem = numer % denom;\r
-\r
-   if (numer < 0 && result.rem > 0) {\r
-      // did division wrong; must fix up\r
-      ++result.quot;\r
-      result.rem -= denom;\r
-   }\r
-\r
-   return result;\r
-}\r
-\r
-// 7.8.2.3 The strtoimax and strtoumax functions\r
-#define strtoimax _strtoi64\r
-#define strtoumax _strtoui64\r
-\r
-// 7.8.2.4 The wcstoimax and wcstoumax functions\r
-#define wcstoimax _wcstoi64\r
-#define wcstoumax _wcstoui64\r
-\r
-\r
-#endif // _MSC_INTTYPES_H_ ]\r
diff --git a/ffmpeg 0.7/include/libavcodec/avcodec.h b/ffmpeg 0.7/include/libavcodec/avcodec.h
deleted file mode 100644 (file)
index ef539a2..0000000
+++ /dev/null
@@ -1,4250 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVCODEC_H
-#define AVCODEC_AVCODEC_H
-
-/**
- * @file
- * external API header
- */
-
-#include <errno.h>
-#include "libavutil/samplefmt.h"
-#include "libavutil/avutil.h"
-#include "libavutil/cpu.h"
-
-#include "libavcodec/version.h"
-
-/**
- * Identify the syntax and semantics of the bitstream.
- * The principle is roughly:
- * Two decoders with the same ID can decode the same streams.
- * Two encoders with the same ID can encode compatible streams.
- * There may be slight deviations from the principle due to implementation
- * details.
- *
- * If you add a codec ID to this list, add it so that
- * 1. no value of a existing codec ID changes (that would break ABI),
- * 2. it is as close as possible to similar codecs.
- */
-enum CodecID {
-    CODEC_ID_NONE,
-
-    /* video codecs */
-    CODEC_ID_MPEG1VIDEO,
-    CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
-    CODEC_ID_MPEG2VIDEO_XVMC,
-    CODEC_ID_H261,
-    CODEC_ID_H263,
-    CODEC_ID_RV10,
-    CODEC_ID_RV20,
-    CODEC_ID_MJPEG,
-    CODEC_ID_MJPEGB,
-    CODEC_ID_LJPEG,
-    CODEC_ID_SP5X,
-    CODEC_ID_JPEGLS,
-    CODEC_ID_MPEG4,
-    CODEC_ID_RAWVIDEO,
-    CODEC_ID_MSMPEG4V1,
-    CODEC_ID_MSMPEG4V2,
-    CODEC_ID_MSMPEG4V3,
-    CODEC_ID_WMV1,
-    CODEC_ID_WMV2,
-    CODEC_ID_H263P,
-    CODEC_ID_H263I,
-    CODEC_ID_FLV1,
-    CODEC_ID_SVQ1,
-    CODEC_ID_SVQ3,
-    CODEC_ID_DVVIDEO,
-    CODEC_ID_HUFFYUV,
-    CODEC_ID_CYUV,
-    CODEC_ID_H264,
-    CODEC_ID_INDEO3,
-    CODEC_ID_VP3,
-    CODEC_ID_THEORA,
-    CODEC_ID_ASV1,
-    CODEC_ID_ASV2,
-    CODEC_ID_FFV1,
-    CODEC_ID_4XM,
-    CODEC_ID_VCR1,
-    CODEC_ID_CLJR,
-    CODEC_ID_MDEC,
-    CODEC_ID_ROQ,
-    CODEC_ID_INTERPLAY_VIDEO,
-    CODEC_ID_XAN_WC3,
-    CODEC_ID_XAN_WC4,
-    CODEC_ID_RPZA,
-    CODEC_ID_CINEPAK,
-    CODEC_ID_WS_VQA,
-    CODEC_ID_MSRLE,
-    CODEC_ID_MSVIDEO1,
-    CODEC_ID_IDCIN,
-    CODEC_ID_8BPS,
-    CODEC_ID_SMC,
-    CODEC_ID_FLIC,
-    CODEC_ID_TRUEMOTION1,
-    CODEC_ID_VMDVIDEO,
-    CODEC_ID_MSZH,
-    CODEC_ID_ZLIB,
-    CODEC_ID_QTRLE,
-    CODEC_ID_SNOW,
-    CODEC_ID_TSCC,
-    CODEC_ID_ULTI,
-    CODEC_ID_QDRAW,
-    CODEC_ID_VIXL,
-    CODEC_ID_QPEG,
-    CODEC_ID_PNG,
-    CODEC_ID_PPM,
-    CODEC_ID_PBM,
-    CODEC_ID_PGM,
-    CODEC_ID_PGMYUV,
-    CODEC_ID_PAM,
-    CODEC_ID_FFVHUFF,
-    CODEC_ID_RV30,
-    CODEC_ID_RV40,
-    CODEC_ID_VC1,
-    CODEC_ID_WMV3,
-    CODEC_ID_LOCO,
-    CODEC_ID_WNV1,
-    CODEC_ID_AASC,
-    CODEC_ID_INDEO2,
-    CODEC_ID_FRAPS,
-    CODEC_ID_TRUEMOTION2,
-    CODEC_ID_BMP,
-    CODEC_ID_CSCD,
-    CODEC_ID_MMVIDEO,
-    CODEC_ID_ZMBV,
-    CODEC_ID_AVS,
-    CODEC_ID_SMACKVIDEO,
-    CODEC_ID_NUV,
-    CODEC_ID_KMVC,
-    CODEC_ID_FLASHSV,
-    CODEC_ID_CAVS,
-    CODEC_ID_JPEG2000,
-    CODEC_ID_VMNC,
-    CODEC_ID_VP5,
-    CODEC_ID_VP6,
-    CODEC_ID_VP6F,
-    CODEC_ID_TARGA,
-    CODEC_ID_DSICINVIDEO,
-    CODEC_ID_TIERTEXSEQVIDEO,
-    CODEC_ID_TIFF,
-    CODEC_ID_GIF,
-    CODEC_ID_FFH264,
-    CODEC_ID_DXA,
-    CODEC_ID_DNXHD,
-    CODEC_ID_THP,
-    CODEC_ID_SGI,
-    CODEC_ID_C93,
-    CODEC_ID_BETHSOFTVID,
-    CODEC_ID_PTX,
-    CODEC_ID_TXD,
-    CODEC_ID_VP6A,
-    CODEC_ID_AMV,
-    CODEC_ID_VB,
-    CODEC_ID_PCX,
-    CODEC_ID_SUNRAST,
-    CODEC_ID_INDEO4,
-    CODEC_ID_INDEO5,
-    CODEC_ID_MIMIC,
-    CODEC_ID_RL2,
-    CODEC_ID_8SVX_EXP,
-    CODEC_ID_8SVX_FIB,
-    CODEC_ID_ESCAPE124,
-    CODEC_ID_DIRAC,
-    CODEC_ID_BFI,
-    CODEC_ID_CMV,
-    CODEC_ID_MOTIONPIXELS,
-    CODEC_ID_TGV,
-    CODEC_ID_TGQ,
-    CODEC_ID_TQI,
-    CODEC_ID_AURA,
-    CODEC_ID_AURA2,
-    CODEC_ID_V210X,
-    CODEC_ID_TMV,
-    CODEC_ID_V210,
-    CODEC_ID_DPX,
-    CODEC_ID_MAD,
-    CODEC_ID_FRWU,
-    CODEC_ID_FLASHSV2,
-    CODEC_ID_CDGRAPHICS,
-    CODEC_ID_R210,
-    CODEC_ID_ANM,
-    CODEC_ID_BINKVIDEO,
-    CODEC_ID_IFF_ILBM,
-    CODEC_ID_IFF_BYTERUN1,
-    CODEC_ID_KGV1,
-    CODEC_ID_YOP,
-    CODEC_ID_VP8,
-    CODEC_ID_PICTOR,
-    CODEC_ID_ANSI,
-    CODEC_ID_A64_MULTI,
-    CODEC_ID_A64_MULTI5,
-    CODEC_ID_R10K,
-    CODEC_ID_MXPEG,
-    CODEC_ID_LAGARITH,
-    CODEC_ID_PRORES,
-    CODEC_ID_JV,
-    CODEC_ID_DFA,
-    CODEC_ID_8SVX_RAW,
-
-    /* various PCM "codecs" */
-    CODEC_ID_PCM_S16LE= 0x10000,
-    CODEC_ID_PCM_S16BE,
-    CODEC_ID_PCM_U16LE,
-    CODEC_ID_PCM_U16BE,
-    CODEC_ID_PCM_S8,
-    CODEC_ID_PCM_U8,
-    CODEC_ID_PCM_MULAW,
-    CODEC_ID_PCM_ALAW,
-    CODEC_ID_PCM_S32LE,
-    CODEC_ID_PCM_S32BE,
-    CODEC_ID_PCM_U32LE,
-    CODEC_ID_PCM_U32BE,
-    CODEC_ID_PCM_S24LE,
-    CODEC_ID_PCM_S24BE,
-    CODEC_ID_PCM_U24LE,
-    CODEC_ID_PCM_U24BE,
-    CODEC_ID_PCM_S24DAUD,
-    CODEC_ID_PCM_ZORK,
-    CODEC_ID_PCM_S16LE_PLANAR,
-    CODEC_ID_PCM_DVD,
-    CODEC_ID_PCM_F32BE,
-    CODEC_ID_PCM_F32LE,
-    CODEC_ID_PCM_F64BE,
-    CODEC_ID_PCM_F64LE,
-    CODEC_ID_PCM_BLURAY,
-    CODEC_ID_PCM_LXF,
-    CODEC_ID_S302M,
-
-    /* various ADPCM codecs */
-    CODEC_ID_ADPCM_IMA_QT= 0x11000,
-    CODEC_ID_ADPCM_IMA_WAV,
-    CODEC_ID_ADPCM_IMA_DK3,
-    CODEC_ID_ADPCM_IMA_DK4,
-    CODEC_ID_ADPCM_IMA_WS,
-    CODEC_ID_ADPCM_IMA_SMJPEG,
-    CODEC_ID_ADPCM_MS,
-    CODEC_ID_ADPCM_4XM,
-    CODEC_ID_ADPCM_XA,
-    CODEC_ID_ADPCM_ADX,
-    CODEC_ID_ADPCM_EA,
-    CODEC_ID_ADPCM_G726,
-    CODEC_ID_ADPCM_CT,
-    CODEC_ID_ADPCM_SWF,
-    CODEC_ID_ADPCM_YAMAHA,
-    CODEC_ID_ADPCM_SBPRO_4,
-    CODEC_ID_ADPCM_SBPRO_3,
-    CODEC_ID_ADPCM_SBPRO_2,
-    CODEC_ID_ADPCM_THP,
-    CODEC_ID_ADPCM_IMA_AMV,
-    CODEC_ID_ADPCM_EA_R1,
-    CODEC_ID_ADPCM_EA_R3,
-    CODEC_ID_ADPCM_EA_R2,
-    CODEC_ID_ADPCM_IMA_EA_SEAD,
-    CODEC_ID_ADPCM_IMA_EA_EACS,
-    CODEC_ID_ADPCM_EA_XAS,
-    CODEC_ID_ADPCM_EA_MAXIS_XA,
-    CODEC_ID_ADPCM_IMA_ISS,
-    CODEC_ID_ADPCM_G722,
-
-    /* AMR */
-    CODEC_ID_AMR_NB= 0x12000,
-    CODEC_ID_AMR_WB,
-
-    /* RealAudio codecs*/
-    CODEC_ID_RA_144= 0x13000,
-    CODEC_ID_RA_288,
-
-    /* various DPCM codecs */
-    CODEC_ID_ROQ_DPCM= 0x14000,
-    CODEC_ID_INTERPLAY_DPCM,
-    CODEC_ID_XAN_DPCM,
-    CODEC_ID_SOL_DPCM,
-
-    /* audio codecs */
-    CODEC_ID_MP2= 0x15000,
-    CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
-    CODEC_ID_AAC,
-    CODEC_ID_AC3,
-    CODEC_ID_DTS,
-    CODEC_ID_VORBIS,
-    CODEC_ID_DVAUDIO,
-    CODEC_ID_WMAV1,
-    CODEC_ID_WMAV2,
-    CODEC_ID_MACE3,
-    CODEC_ID_MACE6,
-    CODEC_ID_VMDAUDIO,
-    CODEC_ID_SONIC,
-    CODEC_ID_SONIC_LS,
-    CODEC_ID_FLAC,
-    CODEC_ID_MP3ADU,
-    CODEC_ID_MP3ON4,
-    CODEC_ID_SHORTEN,
-    CODEC_ID_ALAC,
-    CODEC_ID_WESTWOOD_SND1,
-    CODEC_ID_GSM, ///< as in Berlin toast format
-    CODEC_ID_QDM2,
-    CODEC_ID_COOK,
-    CODEC_ID_TRUESPEECH,
-    CODEC_ID_TTA,
-    CODEC_ID_SMACKAUDIO,
-    CODEC_ID_QCELP,
-    CODEC_ID_WAVPACK,
-    CODEC_ID_DSICINAUDIO,
-    CODEC_ID_IMC,
-    CODEC_ID_MUSEPACK7,
-    CODEC_ID_MLP,
-    CODEC_ID_GSM_MS, /* as found in WAV */
-    CODEC_ID_ATRAC3,
-    CODEC_ID_VOXWARE,
-    CODEC_ID_APE,
-    CODEC_ID_NELLYMOSER,
-    CODEC_ID_MUSEPACK8,
-    CODEC_ID_SPEEX,
-    CODEC_ID_WMAVOICE,
-    CODEC_ID_WMAPRO,
-    CODEC_ID_WMALOSSLESS,
-    CODEC_ID_ATRAC3P,
-    CODEC_ID_EAC3,
-    CODEC_ID_SIPR,
-    CODEC_ID_MP1,
-    CODEC_ID_TWINVQ,
-    CODEC_ID_TRUEHD,
-    CODEC_ID_MP4ALS,
-    CODEC_ID_ATRAC1,
-    CODEC_ID_BINKAUDIO_RDFT,
-    CODEC_ID_BINKAUDIO_DCT,
-    CODEC_ID_AAC_LATM,
-    CODEC_ID_QDMC,
-    CODEC_ID_CELT,
-
-    /* subtitle codecs */
-    CODEC_ID_DVD_SUBTITLE= 0x17000,
-    CODEC_ID_DVB_SUBTITLE,
-    CODEC_ID_TEXT,  ///< raw UTF-8 text
-    CODEC_ID_XSUB,
-    CODEC_ID_SSA,
-    CODEC_ID_MOV_TEXT,
-    CODEC_ID_HDMV_PGS_SUBTITLE,
-    CODEC_ID_DVB_TELETEXT,
-    CODEC_ID_SRT,
-    CODEC_ID_MICRODVD,
-
-    /* other specific kind of codecs (generally used for attachments) */
-    CODEC_ID_TTF= 0x18000,
-
-    CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
-
-    CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
-                                * stream (only used by libavformat) */
-    CODEC_ID_FFMETADATA=0x21000,   ///< Dummy codec for streams containing only metadata information.
-};
-
-#if FF_API_OLD_SAMPLE_FMT
-#define SampleFormat AVSampleFormat
-
-#define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE
-#define SAMPLE_FMT_U8   AV_SAMPLE_FMT_U8
-#define SAMPLE_FMT_S16  AV_SAMPLE_FMT_S16
-#define SAMPLE_FMT_S32  AV_SAMPLE_FMT_S32
-#define SAMPLE_FMT_FLT  AV_SAMPLE_FMT_FLT
-#define SAMPLE_FMT_DBL  AV_SAMPLE_FMT_DBL
-#define SAMPLE_FMT_NB   AV_SAMPLE_FMT_NB
-#endif
-
-#if FF_API_OLD_AUDIOCONVERT
-#include "libavutil/audioconvert.h"
-
-/* Audio channel masks */
-#define CH_FRONT_LEFT            AV_CH_FRONT_LEFT
-#define CH_FRONT_RIGHT           AV_CH_FRONT_RIGHT
-#define CH_FRONT_CENTER          AV_CH_FRONT_CENTER
-#define CH_LOW_FREQUENCY         AV_CH_LOW_FREQUENCY
-#define CH_BACK_LEFT             AV_CH_BACK_LEFT
-#define CH_BACK_RIGHT            AV_CH_BACK_RIGHT
-#define CH_FRONT_LEFT_OF_CENTER  AV_CH_FRONT_LEFT_OF_CENTER
-#define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER
-#define CH_BACK_CENTER           AV_CH_BACK_CENTER
-#define CH_SIDE_LEFT             AV_CH_SIDE_LEFT
-#define CH_SIDE_RIGHT            AV_CH_SIDE_RIGHT
-#define CH_TOP_CENTER            AV_CH_TOP_CENTER
-#define CH_TOP_FRONT_LEFT        AV_CH_TOP_FRONT_LEFT
-#define CH_TOP_FRONT_CENTER      AV_CH_TOP_FRONT_CENTER
-#define CH_TOP_FRONT_RIGHT       AV_CH_TOP_FRONT_RIGHT
-#define CH_TOP_BACK_LEFT         AV_CH_TOP_BACK_LEFT
-#define CH_TOP_BACK_CENTER       AV_CH_TOP_BACK_CENTER
-#define CH_TOP_BACK_RIGHT        AV_CH_TOP_BACK_RIGHT
-#define CH_STEREO_LEFT           AV_CH_STEREO_LEFT
-#define CH_STEREO_RIGHT          AV_CH_STEREO_RIGHT
-
-/** Channel mask value used for AVCodecContext.request_channel_layout
-    to indicate that the user requests the channel order of the decoder output
-    to be the native codec channel order. */
-#define CH_LAYOUT_NATIVE         AV_CH_LAYOUT_NATIVE
-
-/* Audio channel convenience macros */
-#define CH_LAYOUT_MONO           AV_CH_LAYOUT_MONO
-#define CH_LAYOUT_STEREO         AV_CH_LAYOUT_STEREO
-#define CH_LAYOUT_2_1            AV_CH_LAYOUT_2_1
-#define CH_LAYOUT_SURROUND       AV_CH_LAYOUT_SURROUND
-#define CH_LAYOUT_4POINT0        AV_CH_LAYOUT_4POINT0
-#define CH_LAYOUT_2_2            AV_CH_LAYOUT_2_2
-#define CH_LAYOUT_QUAD           AV_CH_LAYOUT_QUAD
-#define CH_LAYOUT_5POINT0        AV_CH_LAYOUT_5POINT0
-#define CH_LAYOUT_5POINT1        AV_CH_LAYOUT_5POINT1
-#define CH_LAYOUT_5POINT0_BACK   AV_CH_LAYOUT_5POINT0_BACK
-#define CH_LAYOUT_5POINT1_BACK   AV_CH_LAYOUT_5POINT1_BACK
-#define CH_LAYOUT_7POINT0        AV_CH_LAYOUT_7POINT0
-#define CH_LAYOUT_7POINT1        AV_CH_LAYOUT_7POINT1
-#define CH_LAYOUT_7POINT1_WIDE   AV_CH_LAYOUT_7POINT1_WIDE
-#define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX
-#endif
-
-/* in bytes */
-#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-
-/**
- * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * This is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end.<br>
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged
- * MPEG bitstreams could cause overread and segfault.
- */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-
-/**
- * minimum encoding buffer size
- * Used to avoid some checks during header writing.
- */
-#define FF_MIN_BUFFER_SIZE 16384
-
-
-/**
- * motion estimation type.
- */
-enum Motion_Est_ID {
-    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
-    ME_FULL,
-    ME_LOG,
-    ME_PHODS,
-    ME_EPZS,        ///< enhanced predictive zonal search
-    ME_X1,          ///< reserved for experiments
-    ME_HEX,         ///< hexagon based search
-    ME_UMH,         ///< uneven multi-hexagon search
-    ME_ITER,        ///< iterative search
-    ME_TESA,        ///< transformed exhaustive search algorithm
-};
-
-enum AVDiscard{
-    /* We leave some space between them for extensions (drop some
-     * keyframes for intra-only or drop just some bidir frames). */
-    AVDISCARD_NONE   =-16, ///< discard nothing
-    AVDISCARD_DEFAULT=  0, ///< discard useless packets like 0 size packets in avi
-    AVDISCARD_NONREF =  8, ///< discard all non reference
-    AVDISCARD_BIDIR  = 16, ///< discard all bidirectional frames
-    AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
-    AVDISCARD_ALL    = 48, ///< discard all
-};
-
-enum AVColorPrimaries{
-    AVCOL_PRI_BT709      =1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
-    AVCOL_PRI_UNSPECIFIED=2,
-    AVCOL_PRI_BT470M     =4,
-    AVCOL_PRI_BT470BG    =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_PRI_SMPTE170M  =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
-    AVCOL_PRI_SMPTE240M  =7, ///< functionally identical to above
-    AVCOL_PRI_FILM       =8,
-    AVCOL_PRI_NB           , ///< Not part of ABI
-};
-
-enum AVColorTransferCharacteristic{
-    AVCOL_TRC_BT709      =1, ///< also ITU-R BT1361
-    AVCOL_TRC_UNSPECIFIED=2,
-    AVCOL_TRC_GAMMA22    =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_TRC_GAMMA28    =5, ///< also ITU-R BT470BG
-    AVCOL_TRC_NB           , ///< Not part of ABI
-};
-
-enum AVColorSpace{
-    AVCOL_SPC_RGB        =0,
-    AVCOL_SPC_BT709      =1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
-    AVCOL_SPC_UNSPECIFIED=2,
-    AVCOL_SPC_FCC        =4,
-    AVCOL_SPC_BT470BG    =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
-    AVCOL_SPC_SMPTE170M  =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
-    AVCOL_SPC_SMPTE240M  =7,
-    AVCOL_SPC_NB           , ///< Not part of ABI
-};
-
-enum AVColorRange{
-    AVCOL_RANGE_UNSPECIFIED=0,
-    AVCOL_RANGE_MPEG       =1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
-    AVCOL_RANGE_JPEG       =2, ///< the normal     2^n-1   "JPEG" YUV ranges
-    AVCOL_RANGE_NB           , ///< Not part of ABI
-};
-
-/**
- *  X   X      3 4 X      X are luma samples,
- *             1 2        1-6 are possible chroma positions
- *  X   X      5 6 X      0 is undefined/unknown position
- */
-enum AVChromaLocation{
-    AVCHROMA_LOC_UNSPECIFIED=0,
-    AVCHROMA_LOC_LEFT       =1, ///< mpeg2/4, h264 default
-    AVCHROMA_LOC_CENTER     =2, ///< mpeg1, jpeg, h263
-    AVCHROMA_LOC_TOPLEFT    =3, ///< DV
-    AVCHROMA_LOC_TOP        =4,
-    AVCHROMA_LOC_BOTTOMLEFT =5,
-    AVCHROMA_LOC_BOTTOM     =6,
-    AVCHROMA_LOC_NB           , ///< Not part of ABI
-};
-
-#if FF_API_FLAC_GLOBAL_OPTS
-/**
- * LPC analysis type
- */
-attribute_deprecated enum AVLPCType {
-    AV_LPC_TYPE_DEFAULT     = -1, ///< use the codec default LPC type
-    AV_LPC_TYPE_NONE        =  0, ///< do not use LPC prediction or use all zero coefficients
-    AV_LPC_TYPE_FIXED       =  1, ///< fixed LPC coefficients
-    AV_LPC_TYPE_LEVINSON    =  2, ///< Levinson-Durbin recursion
-    AV_LPC_TYPE_CHOLESKY    =  3, ///< Cholesky factorization
-    AV_LPC_TYPE_NB              , ///< Not part of ABI
-};
-#endif
-
-enum AVAudioServiceType {
-    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
-    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
-    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
-    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
-    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
-    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
-    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
-    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
-    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
-    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
-};
-
-typedef struct RcOverride{
-    int start_frame;
-    int end_frame;
-    int qscale; // If this is 0 then quality_factor will be used instead.
-    float quality_factor;
-} RcOverride;
-
-#define FF_MAX_B_FRAMES 16
-
-/* encoding support
-   These flags can be passed in AVCodecContext.flags before initialization.
-   Note: Not everything is supported yet.
-*/
-
-#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
-#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
-#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
-#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
-#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
-#define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
-/**
- * The parent program guarantees that the input for B-frames containing
- * streams is not written to for at least s->max_b_frames+1 frames, if
- * this is not set the input will be copied.
- */
-#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
-#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
-#define CODEC_FLAG_EXTERN_HUFF     0x1000   ///< Use external Huffman table (for MJPEG).
-#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
-#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
-#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
-#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
-                                                  location instead of only at frame boundaries. */
-#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
-#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
-#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
-#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
-#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
-#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
-#define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
-#define CODEC_FLAG_CBP_RD         0x04000000 ///< Use rate distortion optimization for cbp.
-#define CODEC_FLAG_QP_RD          0x08000000 ///< Use rate distortion optimization for qp selectioon.
-#define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
-#define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
-#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
-#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
-#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
-#define CODEC_FLAG_CLOSED_GOP     0x80000000
-#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
-#define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< Strictly enforce GOP size.
-#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
-#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
-#define CODEC_FLAG2_BPYRAMID      0x00000010 ///< H.264 allow B-frames to be used as references.
-#define CODEC_FLAG2_WPRED         0x00000020 ///< H.264 weighted biprediction for B-frames
-#define CODEC_FLAG2_MIXED_REFS    0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
-#define CODEC_FLAG2_8X8DCT        0x00000080 ///< H.264 high profile 8x8 transform
-#define CODEC_FLAG2_FASTPSKIP     0x00000100 ///< H.264 fast pskip
-#define CODEC_FLAG2_AUD           0x00000200 ///< H.264 access unit delimiters
-#define CODEC_FLAG2_BRDO          0x00000400 ///< B-frame rate-distortion optimization
-#define CODEC_FLAG2_INTRA_VLC     0x00000800 ///< Use MPEG-2 intra VLC table.
-#define CODEC_FLAG2_MEMC_ONLY     0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
-#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
-#define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
-#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
-#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
-#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
-#define CODEC_FLAG2_MBTREE        0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
-#define CODEC_FLAG2_PSY           0x00080000 ///< Use psycho visual optimizations.
-#define CODEC_FLAG2_SSIM          0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
-#define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes.
-
-/* Unsupported options :
- *              Syntax Arithmetic coding (SAC)
- *              Reference Picture Selection
- *              Independent Segment Decoding */
-/* /Fx */
-/* codec capabilities */
-
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
-/**
- * Codec uses get_buffer() for allocating buffers and supports custom allocators.
- * If not set, it might not use get_buffer() at all or use operations that
- * assume the buffer was allocated by avcodec_default_get_buffer.
- */
-#define CODEC_CAP_DR1             0x0002
-/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
-#define CODEC_CAP_PARSE_ONLY      0x0004
-#define CODEC_CAP_TRUNCATED       0x0008
-/* Codec can export data for HW decoding (XvMC). */
-#define CODEC_CAP_HWACCEL         0x0010
-/**
- * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
- * If this is not set, the codec is guaranteed to never be fed with NULL data.
- */
-#define CODEC_CAP_DELAY           0x0020
-/**
- * Codec can be fed a final frame with a smaller size.
- * This can be used to prevent truncation of the last audio samples.
- */
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
-/**
- * Codec can export data for HW decoding (VDPAU).
- */
-#define CODEC_CAP_HWACCEL_VDPAU    0x0080
-/**
- * Codec can output multiple frames per AVPacket
- * Normally demuxers return one frame at a time, demuxers which do not do
- * are connected to a parser to split what they return into proper frames.
- * This flag is reserved to the very rare category of codecs which have a
- * bitstream that cannot be split into frames without timeconsuming
- * operations like full decoding. Demuxers carring such bitstreams thus
- * may return multiple frames in a packet. This has many disadvantages like
- * prohibiting stream copy in many cases thus it should only be considered
- * as a last resort.
- */
-#define CODEC_CAP_SUBFRAMES        0x0100
-/**
- * Codec is experimental and is thus avoided in favor of non experimental
- * encoders
- */
-#define CODEC_CAP_EXPERIMENTAL     0x0200
-/**
- * Codec should fill in channel configuration and samplerate instead of container
- */
-#define CODEC_CAP_CHANNEL_CONF     0x0400
-
-/**
- * Codec is able to deal with negative linesizes
- */
-#define CODEC_CAP_NEG_LINESIZES    0x0800
-
-/**
- * Codec supports frame-level multithreading.
- */
-#define CODEC_CAP_FRAME_THREADS    0x1000
-/**
- * Codec supports slice-based (or partition-based) multithreading.
- */
-#define CODEC_CAP_SLICE_THREADS    0x2000
-
-//The following defines may change, don't expect compatibility if you use them.
-#define MB_TYPE_INTRA4x4   0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16      0x0008
-#define MB_TYPE_16x8       0x0010
-#define MB_TYPE_8x16       0x0020
-#define MB_TYPE_8x8        0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2    0x0100 //FIXME
-#define MB_TYPE_ACPRED     0x0200
-#define MB_TYPE_GMC        0x0400
-#define MB_TYPE_SKIP       0x0800
-#define MB_TYPE_P0L0       0x1000
-#define MB_TYPE_P1L0       0x2000
-#define MB_TYPE_P0L1       0x4000
-#define MB_TYPE_P1L1       0x8000
-#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
-#define MB_TYPE_QUANT      0x00010000
-#define MB_TYPE_CBP        0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
-
-/**
- * Pan Scan area.
- * This specifies the area which should be displayed.
- * Note there may be multiple such areas for one frame.
- */
-typedef struct AVPanScan{
-    /**
-     * id
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int id;
-
-    /**
-     * width and height in 1/16 pel
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int width;
-    int height;
-
-    /**
-     * position of the top left corner in 1/16 pel for up to 3 fields/frames
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int16_t position[3][2];
-}AVPanScan;
-
-#define FF_COMMON_FRAME \
-    /**\
-     * pointer to the picture planes.\
-     * This might be different from the first allocated byte\
-     * - encoding: \
-     * - decoding: \
-     */\
-    uint8_t *data[4];\
-    int linesize[4];\
-    /**\
-     * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
-     * This isn't used by libavcodec unless the default get/release_buffer() is used.\
-     * - encoding: \
-     * - decoding: \
-     */\
-    uint8_t *base[4];\
-    /**\
-     * 1 -> keyframe, 0-> not\
-     * - encoding: Set by libavcodec.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int key_frame;\
-\
-    /**\
-     * Picture type of the frame, see ?_TYPE below.\
-     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
-     * - decoding: Set by libavcodec.\
-     */\
-    enum AVPictureType pict_type;\
-\
-    /**\
-     * presentation timestamp in time_base units (time when frame should be shown to user)\
-     * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
-     * - encoding: MUST be set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int64_t pts;\
-\
-    /**\
-     * picture number in bitstream order\
-     * - encoding: set by\
-     * - decoding: Set by libavcodec.\
-     */\
-    int coded_picture_number;\
-    /**\
-     * picture number in display order\
-     * - encoding: set by\
-     * - decoding: Set by libavcodec.\
-     */\
-    int display_picture_number;\
-\
-    /**\
-     * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
-     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
-     * - decoding: Set by libavcodec.\
-     */\
-    int quality; \
-\
-    /**\
-     * buffer age (1->was last buffer and dint change, 2->..., ...).\
-     * Set to INT_MAX if the buffer has not been used yet.\
-     * - encoding: unused\
-     * - decoding: MUST be set by get_buffer().\
-     */\
-    int age;\
-\
-    /**\
-     * is this picture used as reference\
-     * The values for this are the same as the MpegEncContext.picture_structure\
-     * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
-     * Set to 4 for delayed, non-reference frames.\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec. (before get_buffer() call)).\
-     */\
-    int reference;\
-\
-    /**\
-     * QP table\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int8_t *qscale_table;\
-    /**\
-     * QP store stride\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int qstride;\
-\
-    /**\
-     * mbskip_table[mb]>=1 if MB didn't change\
-     * stride= mb_width = (width+15)>>4\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint8_t *mbskip_table;\
-\
-    /**\
-     * motion vector table\
-     * @code\
-     * example:\
-     * int mv_sample_log2= 4 - motion_subsample_log2;\
-     * int mb_width= (width+15)>>4;\
-     * int mv_stride= (mb_width << mv_sample_log2) + 1;\
-     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
-     * @endcode\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int16_t (*motion_val[2])[2];\
-\
-    /**\
-     * macroblock type table\
-     * mb_type_base + mb_width + 2\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint32_t *mb_type;\
-\
-    /**\
-     * log2 of the size of the block which a single vector in motion_val represents: \
-     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    uint8_t motion_subsample_log2;\
-\
-    /**\
-     * for some private data of the user\
-     * - encoding: unused\
-     * - decoding: Set by user.\
-     */\
-    void *opaque;\
-\
-    /**\
-     * error\
-     * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\
-     * - decoding: unused\
-     */\
-    uint64_t error[4];\
-\
-    /**\
-     * type of the buffer (to keep track of who has to deallocate data[*])\
-     * - encoding: Set by the one who allocates it.\
-     * - decoding: Set by the one who allocates it.\
-     * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\
-     */\
-    int type;\
-    \
-    /**\
-     * When decoding, this signals how much the picture must be delayed.\
-     * extra_delay = repeat_pict / (2*fps)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    int repeat_pict;\
-    \
-    /**\
-     * \
-     */\
-    int qscale_type;\
-    \
-    /**\
-     * The content of the picture is interlaced.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec. (default 0)\
-     */\
-    int interlaced_frame;\
-    \
-    /**\
-     * If the content is interlaced, is top field displayed first.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int top_field_first;\
-    \
-    /**\
-     * Pan scan.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    AVPanScan *pan_scan;\
-    \
-    /**\
-     * Tell user application that palette has changed from previous frame.\
-     * - encoding: ??? (no palette-enabled encoder yet)\
-     * - decoding: Set by libavcodec. (default 0).\
-     */\
-    int palette_has_changed;\
-    \
-    /**\
-     * codec suggestion on buffer type if != 0\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec. (before get_buffer() call)).\
-     */\
-    int buffer_hints;\
-\
-    /**\
-     * DCT coefficients\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec.\
-     */\
-    short *dct_coeff;\
-\
-    /**\
-     * motion reference frame index\
-     * the order in which these are stored can depend on the codec.\
-     * - encoding: Set by user.\
-     * - decoding: Set by libavcodec.\
-     */\
-    int8_t *ref_index[2];\
-\
-    /**\
-     * reordered opaque 64bit (generally an integer or a double precision float\
-     * PTS but can be anything). \
-     * The user sets AVCodecContext.reordered_opaque to represent the input at\
-     * that time,\
-     * the decoder reorders values as needed and sets AVFrame.reordered_opaque\
-     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque \
-     * @deprecated in favor of pkt_pts\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int64_t reordered_opaque;\
-\
-    /**\
-     * hardware accelerator private data (FFmpeg allocated)\
-     * - encoding: unused\
-     * - decoding: Set by libavcodec\
-     */\
-    void *hwaccel_picture_private;\
-\
-    /**\
-     * reordered pts from the last AVPacket that has been input into the decoder\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int64_t pkt_pts;\
-\
-    /**\
-     * dts from the last AVPacket that has been input into the decoder\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int64_t pkt_dts;\
-\
-    /**\
-     * the AVCodecContext which ff_thread_get_buffer() was last called on\
-     * - encoding: Set by libavcodec.\
-     * - decoding: Set by libavcodec.\
-     */\
-    struct AVCodecContext *owner;\
-\
-    /**\
-     * used by multithreading to store frame-specific info\
-     * - encoding: Set by libavcodec.\
-     * - decoding: Set by libavcodec.\
-     */\
-    void *thread_opaque;\
-\
-    /**\
-     * frame timestamp estimated using various heuristics, in stream time base\
-     * - encoding: unused\
-     * - decoding: set by libavcodec, read by user.\
-     */\
-    int64_t best_effort_timestamp;\
-\
-    /**\
-     * reordered pos from the last AVPacket that has been input into the decoder\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int64_t pkt_pos;\
-\
-    /**\
-     * reordered sample aspect ratio for the video frame, 0/1 if unknown\unspecified
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    AVRational sample_aspect_ratio;\
-\
-    /**\
-     * width and height of the video frame\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int width, height;\
-\
-    /**\
-     * format of the frame, -1 if unknown or unset\
-     * It should be cast to the corresponding enum (enum PixelFormat\
-     * for video, enum AVSampleFormat for audio)\
-     * - encoding: unused\
-     * - decoding: Read by user.\
-     */\
-    int format;\
-
-
-#define FF_QSCALE_TYPE_MPEG1 0
-#define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264  2
-#define FF_QSCALE_TYPE_VP56  3
-
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
-#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
-
-#if FF_API_OLD_FF_PICT_TYPES
-/* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */
-#define FF_I_TYPE  AV_PICTURE_TYPE_I  ///< Intra
-#define FF_P_TYPE  AV_PICTURE_TYPE_P  ///< Predicted
-#define FF_B_TYPE  AV_PICTURE_TYPE_B  ///< Bi-dir predicted
-#define FF_S_TYPE  AV_PICTURE_TYPE_S  ///< S(GMC)-VOP MPEG4
-#define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra
-#define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted
-#define FF_BI_TYPE AV_PICTURE_TYPE_BI
-#endif
-
-#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
-
-enum AVPacketSideDataType {
-    AV_PKT_DATA_PALETTE,
-};
-
-typedef struct AVPacket {
-    /**
-     * Presentation timestamp in AVStream->time_base units; the time at which
-     * the decompressed packet will be presented to the user.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     * pts MUST be larger or equal to dts as presentation cannot happen before
-     * decompression, unless one wants to view hex dumps. Some formats misuse
-     * the terms dts and pts/cts to mean something different. Such timestamps
-     * must be converted to true pts/dts before they are stored in AVPacket.
-     */
-    int64_t pts;
-    /**
-     * Decompression timestamp in AVStream->time_base units; the time at which
-     * the packet is decompressed.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     */
-    int64_t dts;
-    uint8_t *data;
-    int   size;
-    int   stream_index;
-    int   flags;
-    /**
-     * Additional packet data that can be provided by the container.
-     * Packet can contain several types of side information.
-     */
-    struct {
-        uint8_t *data;
-        int      size;
-        enum AVPacketSideDataType type;
-    } *side_data;
-    int side_data_elems;
-
-    /**
-     * Duration of this packet in AVStream->time_base units, 0 if unknown.
-     * Equals next_pts - this_pts in presentation order.
-     */
-    int   duration;
-    void  (*destruct)(struct AVPacket *);
-    void  *priv;
-    int64_t pos;                            ///< byte position in stream, -1 if unknown
-
-    /**
-     * Time difference in AVStream->time_base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current packet.
-     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
-     * set.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-} AVPacket;
-#define AV_PKT_FLAG_KEY   0x0001
-
-/**
- * Audio Video Frame.
- * New fields can be added to the end of FF_COMMON_FRAME with minor version
- * bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump. No fields should be added into AVFrame before or after
- * FF_COMMON_FRAME!
- * sizeof(AVFrame) must not be used outside libav*.
- */
-typedef struct AVFrame {
-    FF_COMMON_FRAME
-} AVFrame;
-
-/**
- * main external API structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVCodecContext) must not be used outside libav*.
- */
-typedef struct AVCodecContext {
-    /**
-     * information on struct for av_log
-     * - set by avcodec_alloc_context
-     */
-    const AVClass *av_class;
-    /**
-     * the average bitrate
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
-     */
-    int bit_rate;
-
-    /**
-     * number of bits the bitstream is allowed to diverge from the reference.
-     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: unused
-     */
-    int bit_rate_tolerance;
-
-    /**
-     * CODEC_FLAG_*.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags;
-
-    /**
-     * Some codecs need additional format info. It is stored here.
-     * If any muxer uses this then ALL demuxers/parsers AND encoders for the
-     * specific codec MUST set it correctly otherwise stream copy breaks.
-     * In general use of this field by muxers is not recommanded.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec. (FIXME: Is this OK?)
-     */
-    int sub_id;
-
-    /**
-     * Motion estimation algorithm used for video coding.
-     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
-     * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
-     * - encoding: MUST be set by user.
-     * - decoding: unused
-     */
-    int me_method;
-
-    /**
-     * some codecs need / can use extradata like Huffman tables.
-     * mjpeg: Huffman tables
-     * rv10: additional flags
-     * mpeg4: global headers (they can be in the bitstream or here)
-     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
-     * than extradata_size to avoid prolems if it is read with the bitstream reader.
-     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
-     * - encoding: Set/allocated/freed by libavcodec.
-     * - decoding: Set/allocated/freed by user.
-     */
-    uint8_t *extradata;
-    int extradata_size;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identically 1.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational time_base;
-
-    /* video only */
-    /**
-     * picture width / height.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     * Note: For compatibility it is possible to set this instead of
-     * coded_width/height before decoding.
-     */
-    int width, height;
-
-#define FF_ASPECT_EXTENDED 15
-
-    /**
-     * the number of pictures in a group of pictures, or 0 for intra_only
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int gop_size;
-
-    /**
-     * Pixel format, see PIX_FMT_xxx.
-     * May be set by the demuxer if known from headers.
-     * May be overriden by the decoder if it knows better.
-     * - encoding: Set by user.
-     * - decoding: Set by user if known, overridden by libavcodec if known
-     */
-    enum PixelFormat pix_fmt;
-
-    /**
-     * If non NULL, 'draw_horiz_band' is called by the libavcodec
-     * decoder to draw a horizontal band. It improves cache usage. Not
-     * all codecs can do that. You must check the codec capabilities
-     * beforehand.
-     * When multithreading is used, it may be called from multiple threads
-     * at the same time; threads might draw different parts of the same AVFrame,
-     * or multiple AVFrames, and there is no guarantee that slices will be drawn
-     * in order.
-     * The function is also used by hardware acceleration APIs.
-     * It is called at least once during frame decoding to pass
-     * the data needed for hardware render.
-     * In that mode instead of pixel data, AVFrame points to
-     * a structure specific to the acceleration API. The application
-     * reads the structure and can change some fields to indicate progress
-     * or mark state.
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @param height the height of the slice
-     * @param y the y position of the slice
-     * @param type 1->top field, 2->bottom field, 3->frame
-     * @param offset offset into the AVFrame.data from which the slice should be read
-     */
-    void (*draw_horiz_band)(struct AVCodecContext *s,
-                            const AVFrame *src, int offset[4],
-                            int y, int type, int height);
-
-    /* audio only */
-    int sample_rate; ///< samples per second
-    int channels;    ///< number of audio channels
-
-    /**
-     * audio sample format
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum AVSampleFormat sample_fmt;  ///< sample format
-
-    /* The following data should not be initialized. */
-    /**
-     * Samples per packet, initialized when calling 'init'.
-     */
-    int frame_size;
-    int frame_number;   ///< audio or video frame number
-
-    /**
-     * Number of frames the decoded output will be delayed relative to
-     * the encoded input.
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int delay;
-
-    /* - encoding parameters */
-    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
-    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
-
-    /**
-     * minimum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmin;
-
-    /**
-     * maximum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmax;
-
-    /**
-     * maximum quantizer difference between frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_qdiff;
-
-    /**
-     * maximum number of B-frames between non-B-frames
-     * Note: The output will be delayed by max_b_frames+1 relative to the input.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_b_frames;
-
-    /**
-     * qscale factor between IP and B-frames
-     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_factor;
-
-    /** obsolete FIXME remove */
-    int rc_strategy;
-#define FF_RC_STRATEGY_XVID 1
-
-    int b_frame_strategy;
-
-    struct AVCodec *codec;
-
-    void *priv_data;
-
-    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
-                            /* do its best to deliver a chunk with size     */
-                            /* below rtp_payload_size, the chunk will start */
-                            /* with a start code on some codecs like H.263. */
-                            /* This doesn't take account of any particular  */
-                            /* headers inside the transmitted RTP payload.  */
-
-
-    /* The RTP callback: This function is called    */
-    /* every time the encoder has a packet to send. */
-    /* It depends on the encoder if the data starts */
-    /* with a Start Code (it should). H.263 does.   */
-    /* mb_nb contains the number of macroblocks     */
-    /* encoded in the RTP payload.                  */
-    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
-
-    /* statistics, used for 2-pass encoding */
-    int mv_bits;
-    int header_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int i_count;
-    int p_count;
-    int skip_count;
-    int misc_bits;
-
-    /**
-     * number of bits used for the previously encoded frame
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int frame_bits;
-
-    /**
-     * Private data of the user, can be used to carry app specific stuff.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    void *opaque;
-
-    char codec_name[32];
-    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
-    enum CodecID codec_id; /* see CODEC_ID_xxx */
-
-    /**
-     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * A demuxer should set this to what is stored in the field used to identify the codec.
-     * If there are multiple such fields in a container then the demuxer should choose the one
-     * which maximizes the information about the used codec.
-     * If the codec tag field in a container is larger then 32 bits then the demuxer should
-     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
-     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
-     * first.
-     * - encoding: Set by user, if not then the default based on codec_id will be used.
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int codec_tag;
-
-    /**
-     * Work around bugs in encoders which sometimes cannot be detected automatically.
-     * - encoding: Set by user
-     * - decoding: Set by user
-     */
-    int workaround_bugs;
-#define FF_BUG_AUTODETECT       1  ///< autodetection
-#define FF_BUG_OLD_MSMPEG4      2
-#define FF_BUG_XVID_ILACE       4
-#define FF_BUG_UMP4             8
-#define FF_BUG_NO_PADDING       16
-#define FF_BUG_AMV              32
-#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
-#define FF_BUG_QPEL_CHROMA      64
-#define FF_BUG_STD_QPEL         128
-#define FF_BUG_QPEL_CHROMA2     256
-#define FF_BUG_DIRECT_BLOCKSIZE 512
-#define FF_BUG_EDGE             1024
-#define FF_BUG_HPEL_CHROMA      2048
-#define FF_BUG_DC_CLIP          4096
-#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
-#define FF_BUG_TRUNCATED       16384
-//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
-
-    /**
-     * luma single coefficient elimination threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int luma_elim_threshold;
-
-    /**
-     * chroma single coeff elimination threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chroma_elim_threshold;
-
-    /**
-     * strictly follow the standard (MPEG4, ...).
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     * Setting this to STRICT or higher means the encoder and decoder will
-     * generally do stupid things, whereas setting it to unofficial or lower
-     * will mean the encoder might produce output that is not supported by all
-     * spec-compliant decoders. Decoders don't differentiate between normal,
-     * unofficial and experimental (that is, they always try to decode things
-     * when they can) unless they are explicitly asked to behave stupidly
-     * (=strictly conform to the specs)
-     */
-    int strict_std_compliance;
-#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
-#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
-#define FF_COMPLIANCE_NORMAL        0
-#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
-#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
-
-    /**
-     * qscale offset between IP and B-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_offset;
-
-    /**
-     * Error recognization; higher values will detect more errors but may
-     * misdetect some more or less valid parts as errors.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_recognition;
-#define FF_ER_CAREFUL         1
-#define FF_ER_COMPLIANT       2
-#define FF_ER_AGGRESSIVE      3
-#define FF_ER_VERY_AGGRESSIVE 4
-
-    /**
-     * Called at the beginning of each frame to get a buffer for it.
-     * If pic.reference is set then the frame will be read later by libavcodec.
-     * avcodec_align_dimensions2() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     * if CODEC_CAP_DR1 is not set then get_buffer() must call
-     * avcodec_default_get_buffer() instead of providing buffers allocated by
-     * some other means.
-     * If frame multithreading is used and thread_safe_callbacks is set,
-     * it may be called from a different thread, but not from more than one at once.
-     * Does not need to be reentrant.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called to release buffers which were allocated with get_buffer.
-     * A released buffer can be reused in get_buffer().
-     * pic.data[*] must be set to NULL.
-     * May be called from a different thread if frame multithreading is used,
-     * but not by more than one thread at once, so does not need to be reentrant.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Size of the frame reordering buffer in the decoder.
-     * For MPEG-2 it is 1 IPB or 0 low delay IP.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int has_b_frames;
-
-    /**
-     * number of bytes per packet if constant and known or 0
-     * Used by some WAV based audio codecs.
-     */
-    int block_align;
-
-    int parse_only; /* - decoding only: If true, only parsing is done
-                       (function avcodec_parse_frame()). The frame
-                       data is returned. Only MPEG codecs support this now. */
-
-    /**
-     * 0-> h263 quant 1-> mpeg quant
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mpeg_quant;
-
-    /**
-     * pass1 encoding statistics output buffer
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    char *stats_out;
-
-    /**
-     * pass2 encoding statistics input buffer
-     * Concatenated stuff from stats_out of pass1 should be placed here.
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    char *stats_in;
-
-    /**
-     * ratecontrol qmin qmax limiting method
-     * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_qsquish;
-
-    float rc_qmod_amp;
-    int rc_qmod_freq;
-
-    /**
-     * ratecontrol override, see RcOverride
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    RcOverride *rc_override;
-    int rc_override_count;
-
-    /**
-     * rate control equation
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    const char *rc_eq;
-
-    /**
-     * maximum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_max_rate;
-
-    /**
-     * minimum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_min_rate;
-
-    /**
-     * decoder bitstream buffer size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_buffer_size;
-    float rc_buffer_aggressivity;
-
-    /**
-     * qscale factor between P and I-frames
-     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_factor;
-
-    /**
-     * qscale offset between P and I-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_offset;
-
-    /**
-     * initial complexity for pass1 ratecontrol
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_initial_cplx;
-
-    /**
-     * DCT algorithm, see FF_DCT_* below
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dct_algo;
-#define FF_DCT_AUTO    0
-#define FF_DCT_FASTINT 1
-#define FF_DCT_INT     2
-#define FF_DCT_MMX     3
-#define FF_DCT_MLIB    4
-#define FF_DCT_ALTIVEC 5
-#define FF_DCT_FAAN    6
-
-    /**
-     * luminance masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float lumi_masking;
-
-    /**
-     * temporary complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float temporal_cplx_masking;
-
-    /**
-     * spatial complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float spatial_cplx_masking;
-
-    /**
-     * p block masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float p_masking;
-
-    /**
-     * darkness masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float dark_masking;
-
-    /**
-     * IDCT algorithm, see FF_IDCT_* below.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int idct_algo;
-#define FF_IDCT_AUTO          0
-#define FF_IDCT_INT           1
-#define FF_IDCT_SIMPLE        2
-#define FF_IDCT_SIMPLEMMX     3
-#define FF_IDCT_LIBMPEG2MMX   4
-#define FF_IDCT_PS2           5
-#define FF_IDCT_MLIB          6
-#define FF_IDCT_ARM           7
-#define FF_IDCT_ALTIVEC       8
-#define FF_IDCT_SH4           9
-#define FF_IDCT_SIMPLEARM     10
-#define FF_IDCT_H264          11
-#define FF_IDCT_VP3           12
-#define FF_IDCT_IPP           13
-#define FF_IDCT_XVIDMMX       14
-#define FF_IDCT_CAVS          15
-#define FF_IDCT_SIMPLEARMV5TE 16
-#define FF_IDCT_SIMPLEARMV6   17
-#define FF_IDCT_SIMPLEVIS     18
-#define FF_IDCT_WMV2          19
-#define FF_IDCT_FAAN          20
-#define FF_IDCT_EA            21
-#define FF_IDCT_SIMPLENEON    22
-#define FF_IDCT_SIMPLEALPHA   23
-#define FF_IDCT_BINK          24
-
-    /**
-     * slice count
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user (or 0).
-     */
-    int slice_count;
-    /**
-     * slice offsets in the frame in bytes
-     * - encoding: Set/allocated by libavcodec.
-     * - decoding: Set/allocated by user (or NULL).
-     */
-    int *slice_offset;
-
-    /**
-     * error concealment flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_concealment;
-#define FF_EC_GUESS_MVS   1
-#define FF_EC_DEBLOCK     2
-
-    /**
-     * dsp_mask could be add used to disable unwanted CPU features
-     * CPU features (i.e. MMX, SSE. ...)
-     *
-     * With the FORCE flag you may instead enable given CPU features.
-     * (Dangerous: Usable in case of misdetection, improper usage however will
-     * result into program crash.)
-     */
-    unsigned dsp_mask;
-
-    /**
-     * bits per sample/pixel from the demuxer (needed for huffyuv).
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user.
-     */
-     int bits_per_coded_sample;
-
-    /**
-     * prediction method (needed for huffyuv)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int prediction_method;
-#define FF_PRED_LEFT   0
-#define FF_PRED_PLANE  1
-#define FF_PRED_MEDIAN 2
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * That is the width of a pixel divided by the height of the pixel.
-     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * the picture in the bitstream
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    AVFrame *coded_frame;
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug;
-#define FF_DEBUG_PICT_INFO   1
-#define FF_DEBUG_RC          2
-#define FF_DEBUG_BITSTREAM   4
-#define FF_DEBUG_MB_TYPE     8
-#define FF_DEBUG_QP          16
-#define FF_DEBUG_MV          32
-#define FF_DEBUG_DCT_COEFF   0x00000040
-#define FF_DEBUG_SKIP        0x00000080
-#define FF_DEBUG_STARTCODE   0x00000100
-#define FF_DEBUG_PTS         0x00000200
-#define FF_DEBUG_ER          0x00000400
-#define FF_DEBUG_MMCO        0x00000800
-#define FF_DEBUG_BUGS        0x00001000
-#define FF_DEBUG_VIS_QP      0x00002000
-#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-#define FF_DEBUG_BUFFERS     0x00008000
-#define FF_DEBUG_THREADS     0x00010000
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-
-    /**
-     * error
-     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
-     * - decoding: unused
-     */
-    uint64_t error[4];
-
-    /**
-     * motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_cmp;
-    /**
-     * subpixel motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_sub_cmp;
-    /**
-     * macroblock comparison function (not supported yet)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_cmp;
-    /**
-     * interlaced DCT comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int ildct_cmp;
-#define FF_CMP_SAD    0
-#define FF_CMP_SSE    1
-#define FF_CMP_SATD   2
-#define FF_CMP_DCT    3
-#define FF_CMP_PSNR   4
-#define FF_CMP_BIT    5
-#define FF_CMP_RD     6
-#define FF_CMP_ZERO   7
-#define FF_CMP_VSAD   8
-#define FF_CMP_VSSE   9
-#define FF_CMP_NSSE   10
-#define FF_CMP_W53    11
-#define FF_CMP_W97    12
-#define FF_CMP_DCTMAX 13
-#define FF_CMP_DCT264 14
-#define FF_CMP_CHROMA 256
-
-    /**
-     * ME diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dia_size;
-
-    /**
-     * amount of previous MV predictors (2a+1 x 2a+1 square)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int last_predictor_count;
-
-    /**
-     * prepass for motion estimation
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_me;
-
-    /**
-     * motion estimation prepass comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_pre_cmp;
-
-    /**
-     * ME prepass diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_dia_size;
-
-    /**
-     * subpel ME quality
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_subpel_quality;
-
-    /**
-     * callback to negotiate the pixelFormat
-     * @param fmt is the list of formats which are supported by the codec,
-     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
-     * The first is always the native one.
-     * @return the chosen format
-     * - encoding: unused
-     * - decoding: Set by user, if not set the native format will be chosen.
-     */
-    enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-    /**
-     * DTG active format information (additional aspect ratio
-     * information only used in DVB MPEG-2 transport streams)
-     * 0 if not set.
-     *
-     * - encoding: unused
-     * - decoding: Set by decoder.
-     */
-    int dtg_active_format;
-#define FF_DTG_AFD_SAME         8
-#define FF_DTG_AFD_4_3          9
-#define FF_DTG_AFD_16_9         10
-#define FF_DTG_AFD_14_9         11
-#define FF_DTG_AFD_4_3_SP_14_9  13
-#define FF_DTG_AFD_16_9_SP_14_9 14
-#define FF_DTG_AFD_SP_4_3       15
-
-    /**
-     * maximum motion estimation search range in subpel units
-     * If 0 then no limit.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_range;
-
-    /**
-     * intra quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_quant_bias;
-#define FF_DEFAULT_QUANT_BIAS 999999
-
-    /**
-     * inter quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_quant_bias;
-
-    /**
-     * color table ID
-     * - encoding: unused
-     * - decoding: Which clrtable should be used for 8bit RGB images.
-     *             Tables have to be stored somewhere. FIXME
-     */
-    int color_table_id;
-
-    /**
-     * internal_buffer count
-     * Don't touch, used by libavcodec default_get_buffer().
-     */
-    int internal_buffer_count;
-
-    /**
-     * internal_buffers
-     * Don't touch, used by libavcodec default_get_buffer().
-     */
-    void *internal_buffer;
-
-    /**
-     * Global quality for codecs which cannot change it per frame.
-     * This should be proportional to MPEG-1/2/4 qscale.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int global_quality;
-
-#define FF_CODER_TYPE_VLC       0
-#define FF_CODER_TYPE_AC        1
-#define FF_CODER_TYPE_RAW       2
-#define FF_CODER_TYPE_RLE       3
-#define FF_CODER_TYPE_DEFLATE   4
-    /**
-     * coder type
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int coder_type;
-
-    /**
-     * context model
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int context_model;
-#if 0
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
-#endif
-
-    /**
-     * slice flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int slice_flags;
-#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
-#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
-
-    /**
-     * XVideo Motion Acceleration
-     * - encoding: forbidden
-     * - decoding: set by decoder
-     */
-    int xvmc_acceleration;
-
-    /**
-     * macroblock decision mode
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_decision;
-#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
-#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
-#define FF_MB_DECISION_RD     2        ///< rate distortion
-
-    /**
-     * custom intra quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *intra_matrix;
-
-    /**
-     * custom inter quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *inter_matrix;
-
-    /**
-     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * - encoding: unused
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int stream_codec_tag;
-
-    /**
-     * scene change detection threshold
-     * 0 is default, larger means fewer detected scene changes.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_threshold;
-
-    /**
-     * minimum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmin;
-
-    /**
-     * maximum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmax;
-
-#if FF_API_PALETTE_CONTROL
-    /**
-     * palette control structure
-     * - encoding: ??? (no palette-enabled encoder yet)
-     * - decoding: Set by user.
-     */
-    struct AVPaletteControl *palctrl;
-#endif
-
-    /**
-     * noise reduction strength
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int noise_reduction;
-
-    /**
-     * Called at the beginning of a frame to get cr buffer for it.
-     * Buffer type (size, hints) must be the same. libavcodec won't check it.
-     * libavcodec will pass previous buffer in pic, function should return
-     * same buffer or new buffer with old frame "painted" into it.
-     * If pic.data[0] == NULL must behave like get_buffer().
-     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
-     * avcodec_default_reget_buffer() instead of providing buffers allocated by
-     * some other means.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Number of bits which should be loaded into the rc buffer before decoding starts.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_initial_buffer_occupancy;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_threshold;
-
-    /**
-     * CODEC_FLAG2_*
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags2;
-
-    /**
-     * Simulates errors in the bitstream to test error concealment.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int error_rate;
-
-#if FF_API_ANTIALIAS_ALGO
-    /**
-     * MP3 antialias algorithm, see FF_AA_* below.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    attribute_deprecated int antialias_algo;
-#define FF_AA_AUTO    0
-#define FF_AA_FASTINT 1 //not implemented yet
-#define FF_AA_INT     2
-#define FF_AA_FLOAT   3
-#endif
-
-    /**
-     * quantizer noise shaping
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int quantizer_noise_shaping;
-
-    /**
-     * thread count
-     * is used to decide how many independent tasks should be passed to execute()
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_count;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * @param count the number of things to execute
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
-
-    /**
-     * thread opaque
-     * Can be used by execute() to store some per AVCodecContext stuff.
-     * - encoding: set by execute()
-     * - decoding: set by execute()
-     */
-    void *thread_opaque;
-
-    /**
-     * Motion estimation threshold below which no motion estimation is
-     * performed, but instead the user specified motion vectors are used.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int me_threshold;
-
-    /**
-     * Macroblock threshold below which the user specified macroblock types will be used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int mb_threshold;
-
-    /**
-     * precision of the intra DC coefficient - 8
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int intra_dc_precision;
-
-    /**
-     * noise vs. sse weight for the nsse comparsion function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int nsse_weight;
-
-    /**
-     * Number of macroblock rows at the top which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int skip_top;
-
-    /**
-     * Number of macroblock rows at the bottom which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int skip_bottom;
-
-    /**
-     * profile
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int profile;
-#define FF_PROFILE_UNKNOWN -99
-#define FF_PROFILE_RESERVED -100
-
-#define FF_PROFILE_AAC_MAIN 0
-#define FF_PROFILE_AAC_LOW  1
-#define FF_PROFILE_AAC_SSR  2
-#define FF_PROFILE_AAC_LTP  3
-
-#define FF_PROFILE_DTS         20
-#define FF_PROFILE_DTS_ES      30
-#define FF_PROFILE_DTS_96_24   40
-#define FF_PROFILE_DTS_HD_HRA  50
-#define FF_PROFILE_DTS_HD_MA   60
-
-#define FF_PROFILE_MPEG2_422    0
-#define FF_PROFILE_MPEG2_HIGH   1
-#define FF_PROFILE_MPEG2_SS     2
-#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
-#define FF_PROFILE_MPEG2_MAIN   4
-#define FF_PROFILE_MPEG2_SIMPLE 5
-
-#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
-#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
-
-#define FF_PROFILE_H264_BASELINE             66
-#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
-#define FF_PROFILE_H264_MAIN                 77
-#define FF_PROFILE_H264_EXTENDED             88
-#define FF_PROFILE_H264_HIGH                 100
-#define FF_PROFILE_H264_HIGH_10              110
-#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_HIGH_422             122
-#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_HIGH_444             144
-#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
-#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_CAVLC_444            44
-
-#define FF_PROFILE_VC1_SIMPLE   0
-#define FF_PROFILE_VC1_MAIN     1
-#define FF_PROFILE_VC1_COMPLEX  2
-#define FF_PROFILE_VC1_ADVANCED 3
-
-    /**
-     * level
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int level;
-#define FF_LEVEL_UNKNOWN -99
-
-    /**
-     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-     int lowres;
-
-    /**
-     * Bitstream width / height, may be different from width/height if lowres
-     * or other things are used.
-     * - encoding: unused
-     * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
-     */
-    int coded_width, coded_height;
-
-    /**
-     * frame skip threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_threshold;
-
-    /**
-     * frame skip factor
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_factor;
-
-    /**
-     * frame skip exponent
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_exp;
-
-    /**
-     * frame skip comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_cmp;
-
-    /**
-     * Border processing masking, raises the quantizer for mbs on the borders
-     * of the picture.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float border_masking;
-
-    /**
-     * minimum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmin;
-
-    /**
-     * maximum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmax;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_penalty_compensation;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_loop_filter;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_idct;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_frame;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bidir_refine;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int brd_scale;
-
-    /**
-     * constant rate factor - quality-based VBR - values ~correspond to qps
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float crf;
-
-    /**
-     * constant quantization parameter rate control method
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cqp;
-
-    /**
-     * minimum GOP size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int keyint_min;
-
-    /**
-     * number of reference frames
-     * - encoding: Set by user.
-     * - decoding: Set by lavc.
-     */
-    int refs;
-
-    /**
-     * chroma qp offset from luma
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chromaoffset;
-
-    /**
-     * Influences how often B-frames are used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bframebias;
-
-    /**
-     * trellis RD quantization
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int trellis;
-
-    /**
-     * Reduce fluctuations in qp (before curve compression).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float complexityblur;
-
-    /**
-     * in-loop deblocking filter alphac0 parameter
-     * alpha is in the range -6...6
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int deblockalpha;
-
-    /**
-     * in-loop deblocking filter beta parameter
-     * beta is in the range -6...6
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int deblockbeta;
-
-    /**
-     * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int partitions;
-#define X264_PART_I4X4 0x001  /* Analyze i4x4 */
-#define X264_PART_I8X8 0x002  /* Analyze i8x8 (requires 8x8 transform) */
-#define X264_PART_P8X8 0x010  /* Analyze p16x8, p8x16 and p8x8 */
-#define X264_PART_P4X4 0x020  /* Analyze p8x4, p4x8, p4x4 */
-#define X264_PART_B8X8 0x100  /* Analyze b16x8, b8x16 and b8x8 */
-
-    /**
-     * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int directpred;
-
-    /**
-     * Audio cutoff bandwidth (0 means "automatic")
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cutoff;
-
-    /**
-     * Multiplied by qscale for each frame and added to scene_change_score.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_factor;
-
-    /**
-     *
-     * Note: Value depends upon the compare function used for fullpel ME.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mv0_threshold;
-
-    /**
-     * Adjusts sensitivity of b_frame_strategy 1.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int b_sensitivity;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int compression_level;
-#define FF_COMPRESSION_DEFAULT -1
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_prediction_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_prediction_order;
-
-#if FF_API_FLAC_GLOBAL_OPTS
-    /**
-     * @defgroup flac_opts FLAC options
-     * @deprecated Use FLAC encoder private options instead.
-     * @{
-     */
-
-    /**
-     * LPC coefficient precision - used by FLAC encoder
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    attribute_deprecated int lpc_coeff_precision;
-
-    /**
-     * search method for selecting prediction order
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    attribute_deprecated int prediction_order_method;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    attribute_deprecated int min_partition_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    attribute_deprecated int max_partition_order;
-    /**
-     * @}
-     */
-#endif
-
-    /**
-     * GOP timecode frame start number, in non drop frame format
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int64_t timecode_frame_start;
-
-#if FF_API_REQUEST_CHANNELS
-    /**
-     * Decoder should decode to this many channels if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @deprecated Deprecated in favor of request_channel_layout.
-     */
-    int request_channels;
-#endif
-
-    /**
-     * Percentage of dynamic range compression to be applied by the decoder.
-     * The default value is 1.0, corresponding to full compression.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    float drc_scale;
-
-    /**
-     * opaque 64bit number (generally a PTS) that will be reordered and
-     * output in AVFrame.reordered_opaque
-     * @deprecated in favor of pkt_pts
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int64_t reordered_opaque;
-
-    /**
-     * Bits per sample/pixel of internal libavcodec pixel/sample format.
-     * This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    int bits_per_raw_sample;
-
-    /**
-     * Audio channel layout.
-     * - encoding: set by user.
-     * - decoding: set by user, may be overwritten by libavcodec.
-     */
-    int64_t channel_layout;
-
-    /**
-     * Request decoder to use this channel layout if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int64_t request_channel_layout;
-
-    /**
-     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_max_available_vbv_use;
-
-    /**
-     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_min_vbv_overflow_use;
-
-    /**
-     * Hardware accelerator in use
-     * - encoding: unused.
-     * - decoding: Set by libavcodec
-     */
-    struct AVHWAccel *hwaccel;
-
-    /**
-     * For some codecs, the time base is closer to the field rate than the frame rate.
-     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
-     * if no telecine is used ...
-     *
-     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
-     */
-    int ticks_per_frame;
-
-    /**
-     * Hardware accelerator context.
-     * For some hardware accelerators, a global context needs to be
-     * provided by the user. In that case, this holds display-dependent
-     * data FFmpeg cannot instantiate itself. Please refer to the
-     * FFmpeg HW accelerator documentation to know how to fill this
-     * is. e.g. for VA API, this is a struct vaapi_context.
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *hwaccel_context;
-
-    /**
-     * Chromaticity coordinates of the source primaries.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorPrimaries color_primaries;
-
-    /**
-     * Color Transfer Characteristic.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorTransferCharacteristic color_trc;
-
-    /**
-     * YUV colorspace type.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorSpace colorspace;
-
-    /**
-     * MPEG vs JPEG YUV range.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorRange color_range;
-
-    /**
-     * This defines the location of chroma samples.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVChromaLocation chroma_sample_location;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
-     * @param c context passed also to func
-     * @param count the number of things to execute
-     * @param arg2 argument passed unchanged to func
-     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
-     * @param func function that will be called count times, with jobnr from 0 to count-1.
-     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
-     *             two instances of func executing at the same time will have the same threadnr.
-     * @return always 0 currently, but code should handle a future improvement where when any call to func
-     *         returns < 0 no further calls to func may be done and < 0 is returned.
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
-
-    /**
-     * explicit P-frame weighted prediction analysis method
-     * 0: off
-     * 1: fast blind weighting (one reference duplicate with -1 offset)
-     * 2: smart weighting (full fade detection analysis)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int weighted_p_pred;
-
-    /**
-     * AQ mode
-     * 0: Disabled
-     * 1: Variance AQ (complexity mask)
-     * 2: Auto-variance AQ (experimental)
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int aq_mode;
-
-    /**
-     * AQ strength
-     * Reduces blocking and blurring in flat and textured areas.
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    float aq_strength;
-
-    /**
-     * PSY RD
-     * Strength of psychovisual optimization
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    float psy_rd;
-
-    /**
-     * PSY trellis
-     * Strength of psychovisual optimization
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    float psy_trellis;
-
-    /**
-     * RC lookahead
-     * Number of frames for frametype and ratecontrol lookahead
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int rc_lookahead;
-
-    /**
-     * Constant rate factor maximum
-     * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse
-     * than crf_max, even if doing so would violate VBV restrictions.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float crf_max;
-
-    int log_level_offset;
-
-#if FF_API_FLAC_GLOBAL_OPTS
-    /**
-     * Determines which LPC analysis algorithm to use.
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    attribute_deprecated enum AVLPCType lpc_type;
-
-    /**
-     * Number of passes to use for Cholesky factorization during LPC analysis
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    attribute_deprecated int lpc_passes;
-#endif
-
-    /**
-     * Number of slices.
-     * Indicates number of picture subdivisions. Used for parallelized
-     * decoding.
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int slices;
-
-    /**
-     * Header containing style information for text subtitles.
-     * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
-     * [Script Info] and [V4+ Styles] section, plus the [Events] line and
-     * the Format line following. It shouldn't include any Dialogue line.
-     * - encoding: Set/allocated/freed by user (before avcodec_open())
-     * - decoding: Set/allocated/freed by libavcodec (by avcodec_open())
-     */
-    uint8_t *subtitle_header;
-    int subtitle_header_size;
-
-    /**
-     * Current packet as passed into the decoder, to avoid having
-     * to pass the packet into every function. Currently only valid
-     * inside lavc and get/release_buffer callbacks.
-     * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
-     * - encoding: unused
-     */
-    AVPacket *pkt;
-
-    /**
-     * Whether this is a copy of the context which had init() called on it.
-     * This is used by multithreading - shared tables and picture pointers
-     * should be freed from the original context only.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int is_copy;
-
-    /**
-     * Which multithreading methods to use.
-     * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
-     * so clients which cannot provide future frames should not use it.
-     *
-     * - encoding: Set by user, otherwise the default is used.
-     * - decoding: Set by user, otherwise the default is used.
-     */
-    int thread_type;
-#define FF_THREAD_FRAME   1 //< Decode more than one frame at once
-#define FF_THREAD_SLICE   2 //< Decode more than one part of a single frame at once
-
-    /**
-     * Which multithreading methods are in use by the codec.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int active_thread_type;
-
-    /**
-     * Set by the client if its custom get_buffer() callback can be called
-     * from another thread, which allows faster multithreaded decoding.
-     * draw_horiz_band() will be called from other threads regardless of this setting.
-     * Ignored if the default get_buffer() is used.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_safe_callbacks;
-
-    /**
-     * VBV delay coded in the last frame (in periods of a 27 MHz clock).
-     * Used for compliant TS muxing.
-     * - encoding: Set by libavcodec.
-     * - decoding: unused.
-     */
-    uint64_t vbv_delay;
-
-    /**
-     * Type of service that the audio stream conveys.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum AVAudioServiceType audio_service_type;
-
-    /**
-     * desired sample format
-     * - encoding: Not used.
-     * - decoding: Set by user.
-     * Decoder will decode to this format if it can.
-     */
-    enum AVSampleFormat request_sample_fmt;
-
-    /**
-     * Current statistics for PTS correction.
-     * - decoding: maintained and used by libavcodec, not intended to be used by user apps
-     * - encoding: unused
-     */
-    int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far
-    int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far
-    int64_t pts_correction_last_pts;       /// PTS of the last frame
-    int64_t pts_correction_last_dts;       /// DTS of the last frame
-
-
-} AVCodecContext;
-
-/**
- * AVProfile.
- */
-typedef struct AVProfile {
-    int profile;
-    const char *name; ///< short name for the profile
-} AVProfile;
-
-/**
- * AVCodec.
- */
-typedef struct AVCodec {
-    /**
-     * Name of the codec implementation.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     * This is the primary way to find a codec from the user perspective.
-     */
-    const char *name;
-    enum AVMediaType type;
-    enum CodecID id;
-    int priv_data_size;
-    int (*init)(AVCodecContext *);
-    int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
-    int (*close)(AVCodecContext *);
-    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
-    /**
-     * Codec capabilities.
-     * see CODEC_CAP_*
-     */
-    int capabilities;
-    struct AVCodec *next;
-    /**
-     * Flush buffers.
-     * Will be called when seeking
-     */
-    void (*flush)(AVCodecContext *);
-    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
-    const enum PixelFormat *pix_fmts;       ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
-    /**
-     * Descriptive name for the codec, meant to be more human readable than name.
-     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *long_name;
-    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
-    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
-    const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
-    uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
-    const AVClass *priv_class;              ///< AVClass for the private context
-    const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
-
-    /**
-     * @defgroup framethreading Frame-level threading support functions.
-     * @{
-     */
-    /**
-     * If defined, called on thread contexts when they are created.
-     * If the codec allocates writable tables in init(), re-allocate them here.
-     * priv_data will be set to a copy of the original.
-     */
-    int (*init_thread_copy)(AVCodecContext *);
-    /**
-     * Copy necessary context variables from a previous thread context to the current one.
-     * If not defined, the next thread will start automatically; otherwise, the codec
-     * must call ff_thread_finish_setup().
-     *
-     * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
-     */
-    int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
-    /** @} */
-} AVCodec;
-
-/**
- * AVHWAccel.
- */
-typedef struct AVHWAccel {
-    /**
-     * Name of the hardware accelerated codec.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     */
-    const char *name;
-
-    /**
-     * Type of codec implemented by the hardware accelerator.
-     *
-     * See AVMEDIA_TYPE_xxx
-     */
-    enum AVMediaType type;
-
-    /**
-     * Codec implemented by the hardware accelerator.
-     *
-     * See CODEC_ID_xxx
-     */
-    enum CodecID id;
-
-    /**
-     * Supported pixel format.
-     *
-     * Only hardware accelerated formats are supported here.
-     */
-    enum PixelFormat pix_fmt;
-
-    /**
-     * Hardware accelerated codec capabilities.
-     * see FF_HWACCEL_CODEC_CAP_*
-     */
-    int capabilities;
-
-    struct AVHWAccel *next;
-
-    /**
-     * Called at the beginning of each frame or field picture.
-     *
-     * Meaningful frame information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * Note that buf can be NULL along with buf_size set to 0.
-     * Otherwise, this means the whole frame is available at this point.
-     *
-     * @param avctx the codec context
-     * @param buf the frame data buffer base
-     * @param buf_size the size of the frame in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Callback for each slice.
-     *
-     * Meaningful slice information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @param buf the slice data buffer base
-     * @param buf_size the size of the slice in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Called at the end of each frame or field picture.
-     *
-     * The whole picture is parsed at this point and can now be sent
-     * to the hardware accelerator. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*end_frame)(AVCodecContext *avctx);
-
-    /**
-     * Size of HW accelerator private data.
-     *
-     * Private data is allocated with av_mallocz() before
-     * AVCodecContext.get_buffer() and deallocated after
-     * AVCodecContext.release_buffer().
-     */
-    int priv_data_size;
-} AVHWAccel;
-
-/**
- * four components are given, that's all.
- * the last component is alpha
- */
-typedef struct AVPicture {
-    uint8_t *data[4];
-    int linesize[4];       ///< number of bytes per line
-} AVPicture;
-
-#if FF_API_PALETTE_CONTROL
-/**
- * AVPaletteControl
- * This structure defines a method for communicating palette changes
- * between and demuxer and a decoder.
- *
- * @deprecated Use AVPacket to send palette changes instead.
- * This is totally broken.
- */
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
-typedef struct AVPaletteControl {
-
-    /* Demuxer sets this to 1 to indicate the palette has changed;
-     * decoder resets to 0. */
-    int palette_changed;
-
-    /* 4-byte ARGB palette entries, stored in native byte order; note that
-     * the individual palette components should be on a 8-bit scale; if
-     * the palette data comes from an IBM VGA native format, the component
-     * data is probably 6 bits in size and needs to be scaled. */
-    unsigned int palette[AVPALETTE_COUNT];
-
-} AVPaletteControl attribute_deprecated;
-#endif
-
-enum AVSubtitleType {
-    SUBTITLE_NONE,
-
-    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
-
-    /**
-     * Plain text, the text field must be set by the decoder and is
-     * authoritative. ass and pict fields may contain approximations.
-     */
-    SUBTITLE_TEXT,
-
-    /**
-     * Formatted text, the ass field must be set by the decoder and is
-     * authoritative. pict and text fields may contain approximations.
-     */
-    SUBTITLE_ASS,
-};
-
-typedef struct AVSubtitleRect {
-    int x;         ///< top left corner  of pict, undefined when pict is not set
-    int y;         ///< top left corner  of pict, undefined when pict is not set
-    int w;         ///< width            of pict, undefined when pict is not set
-    int h;         ///< height           of pict, undefined when pict is not set
-    int nb_colors; ///< number of colors in pict, undefined when pict is not set
-
-    /**
-     * data+linesize for the bitmap of this subtitle.
-     * can be set for text/ass as well once they where rendered
-     */
-    AVPicture pict;
-    enum AVSubtitleType type;
-
-    char *text;                     ///< 0 terminated plain UTF-8 text
-
-    /**
-     * 0 terminated ASS/SSA compatible event line.
-     * The pressentation of this is unaffected by the other values in this
-     * struct.
-     */
-    char *ass;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
-    uint16_t format; /* 0 = graphics */
-    uint32_t start_display_time; /* relative to packet pts, in ms */
-    uint32_t end_display_time; /* relative to packet pts, in ms */
-    unsigned num_rects;
-    AVSubtitleRect **rects;
-    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
-} AVSubtitle;
-
-/* packet functions */
-
-/**
- * @deprecated use NULL instead
- */
-attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
-
-/**
- * Default packet destructor.
- */
-void av_destruct_packet(AVPacket *pkt);
-
-/**
- * Initialize optional fields of a packet with default values.
- *
- * @param pkt packet
- */
-void av_init_packet(AVPacket *pkt);
-
-/**
- * Allocate the payload of a packet and initialize its fields with
- * default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_new_packet(AVPacket *pkt, int size);
-
-/**
- * Reduce packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param size new size
- */
-void av_shrink_packet(AVPacket *pkt, int size);
-
-/**
- * Increase packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param grow_by number of bytes by which to increase the size of the packet
- */
-int av_grow_packet(AVPacket *pkt, int grow_by);
-
-/**
- * @warning This is a hack - the packet memory allocation stuff is broken. The
- * packet is allocated if it was not really allocated.
- */
-int av_dup_packet(AVPacket *pkt);
-
-/**
- * Free a packet.
- *
- * @param pkt packet to free
- */
-void av_free_packet(AVPacket *pkt);
-
-/**
- * Allocate new information of a packet.
- *
- * @param pkt packet
- * @param type side information type
- * @param size side information size
- * @return pointer to fresh allocated data or NULL otherwise
- */
-uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int size);
-
-/**
- * Get side information from packet.
- *
- * @param pkt packet
- * @param type desired side information type
- * @param size pointer for side information size to store (optional)
- * @return pointer to data if present or NULL otherwise
- */
-uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int *size);
-
-int av_packet_merge_side_data(AVPacket *pkt);
-
-int av_packet_split_side_data(AVPacket *pkt);
-
-
-/* resample.c */
-
-struct ReSampleContext;
-struct AVResampleContext;
-
-typedef struct ReSampleContext ReSampleContext;
-
-/**
- *  Initialize audio resampling context.
- *
- * @param output_channels  number of output channels
- * @param input_channels   number of input channels
- * @param output_rate      output sample rate
- * @param input_rate       input sample rate
- * @param sample_fmt_out   requested output sample format
- * @param sample_fmt_in    input sample format
- * @param filter_length    length of each FIR filter in the filterbank relative to the cutoff frequency
- * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
- * @param linear           if 1 then the used FIR filter will be linearly interpolated
-                           between the 2 closest, if 0 the closest will be used
- * @param cutoff           cutoff frequency, 1.0 corresponds to half the output sampling rate
- * @return allocated ReSampleContext, NULL if error occured
- */
-ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
-                                        int output_rate, int input_rate,
-                                        enum AVSampleFormat sample_fmt_out,
-                                        enum AVSampleFormat sample_fmt_in,
-                                        int filter_length, int log2_phase_count,
-                                        int linear, double cutoff);
-
-int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
-
-/**
- * Free resample context.
- *
- * @param s a non-NULL pointer to a resample context previously
- *          created with av_audio_resample_init()
- */
-void audio_resample_close(ReSampleContext *s);
-
-
-/**
- * Initialize an audio resampler.
- * Note, if either rate is not an integer then simply scale both rates up so they are.
- * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
- * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
- * @param linear If 1 then the used FIR filter will be linearly interpolated
-                 between the 2 closest, if 0 the closest will be used
- * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
- */
-struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
-
-/**
- * Resample an array of samples using a previously configured context.
- * @param src an array of unconsumed samples
- * @param consumed the number of samples of src which have been consumed are returned here
- * @param src_size the number of unconsumed samples available
- * @param dst_size the amount of space in samples available in dst
- * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
- * @return the number of samples written in dst or -1 if an error occurred
- */
-int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
-
-
-/**
- * Compensate samplerate/timestamp drift. The compensation is done by changing
- * the resampler parameters, so no audible clicks or similar distortions occur
- * @param compensation_distance distance in output samples over which the compensation should be performed
- * @param sample_delta number of output samples which should be output less
- *
- * example: av_resample_compensate(c, 10, 500)
- * here instead of 510 samples only 500 samples would be output
- *
- * note, due to rounding the actual compensation might be slightly different,
- * especially if the compensation_distance is large and the in_rate used during init is small
- */
-void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
-void av_resample_close(struct AVResampleContext *c);
-
-/**
- * Allocate memory for a picture.  Call avpicture_free() to free it.
- *
- * \see avpicture_fill()
- *
- * @param picture the picture to be filled in
- * @param pix_fmt the format of the picture
- * @param width the width of the picture
- * @param height the height of the picture
- * @return zero if successful, a negative value if not
- */
-int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
-
-/**
- * Free a picture previously allocated by avpicture_alloc().
- * The data buffer used by the AVPicture is freed, but the AVPicture structure
- * itself is not.
- *
- * @param picture the AVPicture to be freed
- */
-void avpicture_free(AVPicture *picture);
-
-/**
- * Fill in the AVPicture fields.
- * The fields of the given AVPicture are filled in by using the 'ptr' address
- * which points to the image data buffer. Depending on the specified picture
- * format, one or multiple image data pointers and line sizes will be set.
- * If a planar format is specified, several pointers will be set pointing to
- * the different picture planes and the line sizes of the different planes
- * will be stored in the lines_sizes array.
- * Call with ptr == NULL to get the required size for the ptr buffer.
- *
- * To allocate the buffer and fill in the AVPicture fields in one call,
- * use avpicture_alloc().
- *
- * @param picture AVPicture whose fields are to be filled in
- * @param ptr Buffer which will contain or contains the actual image data
- * @param pix_fmt The format in which the picture data is stored.
- * @param width the width of the image in pixels
- * @param height the height of the image in pixels
- * @return size of the image data in bytes
- */
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
-                   enum PixelFormat pix_fmt, int width, int height);
-
-/**
- * Copy pixel data from an AVPicture into a buffer.
- * The data is stored compactly, without any gaps for alignment or padding
- * which may be applied by avpicture_fill().
- *
- * \see avpicture_get_size()
- *
- * @param[in] src AVPicture containing image data
- * @param[in] pix_fmt The format in which the picture data is stored.
- * @param[in] width the width of the image in pixels.
- * @param[in] height the height of the image in pixels.
- * @param[out] dest A buffer into which picture data will be copied.
- * @param[in] dest_size The size of 'dest'.
- * @return The number of bytes written to dest, or a negative value (error code) on error.
- */
-int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
-                     unsigned char *dest, int dest_size);
-
-/**
- * Calculate the size in bytes that a picture of the given width and height
- * would occupy if stored in the given picture format.
- * Note that this returns the size of a compact representation as generated
- * by avpicture_layout(), which can be smaller than the size required for e.g.
- * avpicture_fill().
- *
- * @param pix_fmt the given picture format
- * @param width the width of the image
- * @param height the height of the image
- * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
- */
-int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
-void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
-
-#if FF_API_GET_PIX_FMT_NAME
-/**
- * Return the short name for a pixel format.
- *
- * \see av_get_pix_fmt(), av_get_pix_fmt_string().
- * @deprecated Deprecated in favor of av_get_pix_fmt_name().
- */
-attribute_deprecated
-const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
-#endif
-
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
-
-/**
- * Return a value representing the fourCC code associated to the
- * pixel format pix_fmt, or 0 if no associated fourCC code can be
- * found.
- */
-unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
-
-/**
- * Put a string representing the codec tag codec_tag in buf.
- *
- * @param buf_size size in bytes of buf
- * @return the length of the string that would have been generated if
- * enough space had been available, excluding the trailing null
- */
-size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
-
-#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
-#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
-#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
-#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
-#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
-#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
-
-/**
- * Compute what kind of losses will occur when converting from one specific
- * pixel format to another.
- * When converting from one pixel format to another, information loss may occur.
- * For example, when converting from RGB24 to GRAY, the color information will
- * be lost. Similarly, other losses occur when converting from some formats to
- * other formats. These losses can involve loss of chroma, but also loss of
- * resolution, loss of color depth, loss due to the color space conversion, loss
- * of the alpha bits or loss due to color quantization.
- * avcodec_get_fix_fmt_loss() informs you about the various types of losses
- * which will occur when converting from one pixel format to another.
- *
- * @param[in] dst_pix_fmt destination pixel format
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @return Combination of flags informing you what kind of losses will occur.
- */
-int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
-                             int has_alpha);
-
-/**
- * Find the best pixel format to convert to given a certain source pixel
- * format.  When converting from one pixel format to another, information loss
- * may occur.  For example, when converting from RGB24 to GRAY, the color
- * information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
- * the given pixel formats should be used to suffer the least amount of loss.
- * The pixel formats from which it chooses one, are determined by the
- * pix_fmt_mask parameter.
- *
- * @code
- * src_pix_fmt = PIX_FMT_YUV420P;
- * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);
- * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
- * @endcode
- *
- * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
- * @return The best pixel format to convert to or -1 if none was found.
- */
-enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
-                              int has_alpha, int *loss_ptr);
-
-#define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */
-#define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */
-
-/**
- * Tell if an image really has transparent alpha values.
- * @return ored mask of FF_ALPHA_xxx constants
- */
-int img_get_alpha_info(const AVPicture *src,
-                       enum PixelFormat pix_fmt, int width, int height);
-
-/* deinterlace a picture */
-/* deinterlace - if not supported return -1 */
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
-                          enum PixelFormat pix_fmt, int width, int height);
-
-/* external high level API */
-
-/**
- * If c is NULL, returns the first registered codec,
- * if c is non-NULL, returns the next registered codec after c,
- * or NULL if c is the last one.
- */
-AVCodec *av_codec_next(AVCodec *c);
-
-/**
- * Return the LIBAVCODEC_VERSION_INT constant.
- */
-unsigned avcodec_version(void);
-
-/**
- * Return the libavcodec build-time configuration.
- */
-const char *avcodec_configuration(void);
-
-/**
- * Return the libavcodec license.
- */
-const char *avcodec_license(void);
-
-/**
- * Initialize libavcodec.
- * If called more than once, does nothing.
- *
- * @warning This function must be called before any other libavcodec
- * function.
- *
- * @warning This function is not thread-safe.
- */
-void avcodec_init(void);
-
-/**
- * Register the codec codec and initialize libavcodec.
- *
- * @see avcodec_init(), avcodec_register_all()
- */
-void avcodec_register(AVCodec *codec);
-
-/**
- * Find a registered encoder with a matching codec ID.
- *
- * @param id CodecID of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder(enum CodecID id);
-
-/**
- * Find a registered encoder with the specified name.
- *
- * @param name name of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder_by_name(const char *name);
-
-/**
- * Find a registered decoder with a matching codec ID.
- *
- * @param id CodecID of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder(enum CodecID id);
-
-/**
- * Find a registered decoder with the specified name.
- *
- * @param name name of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder_by_name(const char *name);
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
-
-/**
- * Return a name for the specified profile, if available.
- *
- * @param codec the codec that is searched for the given profile
- * @param profile the profile value for which a name is requested
- * @return A name for the profile if found, NULL otherwise.
- */
-const char *av_get_profile_name(const AVCodec *codec, int profile);
-
-/**
- * Set the fields of the given AVCodecContext to default values.
- *
- * @param s The AVCodecContext of which the fields should be set to default values.
- */
-void avcodec_get_context_defaults(AVCodecContext *s);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
-
-/**
- * Allocate an AVCodecContext and set its fields to default values.  The
- * resulting struct can be deallocated by simply calling av_free().
- *
- * @return An AVCodecContext filled with default values or NULL on failure.
- * @see avcodec_get_context_defaults
- */
-AVCodecContext *avcodec_alloc_context(void);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
-
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- *  we WILL change its arguments and name a few times! */
-AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
-
-/**
- * Copy the settings of the source AVCodecContext into the destination
- * AVCodecContext. The resulting destination codec context will be
- * unopened, i.e. you are required to call avcodec_open() before you
- * can use this AVCodecContext to decode/encode video/audio data.
- *
- * @param dest target codec context, should be initialized with
- *             avcodec_alloc_context(), but otherwise uninitialized
- * @param src source codec context
- * @return AVERROR() on error (e.g. memory allocation error), 0 on success
- */
-int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
-
-/**
- * Set the fields of the given AVFrame to default values.
- *
- * @param pic The AVFrame of which the fields should be set to default values.
- */
-void avcodec_get_frame_defaults(AVFrame *pic);
-
-/**
- * Allocate an AVFrame and set its fields to default values.  The resulting
- * struct can be deallocated by simply calling av_free().
- *
- * @return An AVFrame filled with default values or NULL on failure.
- * @see avcodec_get_frame_defaults
- */
-AVFrame *avcodec_alloc_frame(void);
-
-int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-
-/**
- * Return the amount of padding in pixels which the get_buffer callback must
- * provide around the edge of the image for codecs which do not have the
- * CODEC_FLAG_EMU_EDGE flag.
- *
- * @return Required padding in pixels.
- */
-unsigned avcodec_get_edge_width(void);
-/**
- * Modify width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you do not use any horizontal
- * padding.
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
- */
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
-/**
- * Modify width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you also ensure that all
- * line sizes are a multiple of the respective linesize_align[i].
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
- */
-void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
-                               int linesize_align[4]);
-
-enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-#if FF_API_THREAD_INIT
-/**
- * @deprecated Set s->thread_count before calling avcodec_open() instead of calling this.
- */
-attribute_deprecated
-int avcodec_thread_init(AVCodecContext *s, int thread_count);
-#endif
-
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
-int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
-//FIXME func typedef
-
-/**
- * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
- * function the context has to be allocated.
- *
- * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
- * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
- * retrieving a codec.
- *
- * @warning This function is not thread safe!
- *
- * @code
- * avcodec_register_all();
- * codec = avcodec_find_decoder(CODEC_ID_H264);
- * if (!codec)
- *     exit(1);
- *
- * context = avcodec_alloc_context();
- *
- * if (avcodec_open(context, codec) < 0)
- *     exit(1);
- * @endcode
- *
- * @param avctx The context which will be set up to use the given codec.
- * @param codec The codec to use within the context.
- * @return zero on success, a negative value on error
- * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder, avcodec_close
- */
-int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-
-/**
- * Decode the audio frame of size avpkt->size from avpkt->data into samples.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame. In this case,
- * avcodec_decode_audio3 has to be called again with an AVPacket that contains
- * the remaining data in order to decode the second frame etc.
- * If no frame
- * could be outputted, frame_size_ptr is zero. Otherwise, it is the
- * decompressed frame size in bytes.
- *
- * @warning You must set frame_size_ptr to the allocated size of the
- * output buffer before calling avcodec_decode_audio3().
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer avpkt->data and output buffer
- * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum and
- * samples should be 16 byte aligned unless the CPU doesn't need it
- * (AltiVec and SSE do).
- *
- * @param avctx the codec context
- * @param[out] samples the output buffer, sample type in avctx->sample_fmt
- * @param[in,out] frame_size_ptr the output buffer size in bytes
- * @param[in] avpkt The input AVPacket containing the input buffer.
- *            You can create such packet with av_init_packet() and by then setting
- *            data and size, some decoders might in addition need other fields.
- *            All decoders are designed to use the least fields possible though.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame data was decompressed (used) from the input AVPacket.
- */
-int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
-                         int *frame_size_ptr,
-                         AVPacket *avpkt);
-
-/**
- * Decode the video frame of size avpkt->size from avpkt->data into picture.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame.
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer buf should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer avpkt->data.
- * The alignment requirements depend on the CPU: on some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum.
- *
- * @note Some codecs have a delay between input and output, these need to be
- * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
- *
- * @param avctx the codec context
- * @param[out] picture The AVFrame in which the decoded video frame will be stored.
- *             Use avcodec_alloc_frame to get an AVFrame, the codec will
- *             allocate memory for the actual bitmap.
- *             with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit.
- *             with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder
- *                   decodes and the decoder tells the user once it does not need the data anymore,
- *                   the user app can at this point free/reuse/keep the memory as it sees fit.
- *
- * @param[in] avpkt The input AVpacket containing the input buffer.
- *            You can create such packet with av_init_packet() and by then setting
- *            data and size, some decoders might in addition need other fields like
- *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
- *            fields possible.
- * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_picture_ptr,
-                         AVPacket *avpkt);
-
-/**
- * Decode a subtitle message.
- * Return a negative value on error, otherwise return the number of bytes used.
- * If no subtitle could be decompressed, got_sub_ptr is zero.
- * Otherwise, the subtitle is stored in *sub.
- * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
- * simplicity, because the performance difference is expect to be negligible
- * and reusing a get_buffer written for video codecs would probably perform badly
- * due to a potentially very different allocation pattern.
- *
- * @param avctx the codec context
- * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
-                   freed with avsubtitle_free if *got_sub_ptr is set.
- * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
- * @param[in] avpkt The input AVPacket containing the input buffer.
- */
-int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
-                            int *got_sub_ptr,
-                            AVPacket *avpkt);
-
-/**
- * Frees all allocated data in the given subtitle struct.
- *
- * @param sub AVSubtitle to free.
- */
-void avsubtitle_free(AVSubtitle *sub);
-
-int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
-                        int *data_size_ptr,
-                        uint8_t *buf, int buf_size);
-
-/**
- * Encode an audio frame from samples into buf.
- *
- * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
- * However, for PCM audio the user will know how much space is needed
- * because it depends on the value passed in buf_size as described
- * below. In that case a lower value can be used.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer
- * @param[in] buf_size the output buffer size
- * @param[in] samples the input buffer containing the samples
- * The number of samples read from this buffer is frame_size*channels,
- * both of which are defined in avctx.
- * For PCM audio the number of samples read from samples is equal to
- * buf_size * input_sample_size / output_sample_size.
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used to encode the data read from the input buffer.
- */
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                         const short *samples);
-
-/**
- * Encode a video frame from pict into buf.
- * The input picture should be
- * stored using a specific format, namely avctx.pix_fmt.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer for the bitstream of encoded frame
- * @param[in] buf_size the size of the output buffer in bytes
- * @param[in] pict the input picture to encode
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used from the output buffer.
- */
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                         const AVFrame *pict);
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                            const AVSubtitle *sub);
-
-int avcodec_close(AVCodecContext *avctx);
-
-/**
- * Register all the codecs, parsers and bitstream filters which were enabled at
- * configuration time. If you do not call this function you can select exactly
- * which formats you want to support, by using the individual registration
- * functions.
- *
- * @see avcodec_register
- * @see av_register_codec_parser
- * @see av_register_bitstream_filter
- */
-void avcodec_register_all(void);
-
-/**
- * Flush buffers, should be called when seeking or when switching to a different stream.
- */
-void avcodec_flush_buffers(AVCodecContext *avctx);
-
-void avcodec_default_free_buffers(AVCodecContext *s);
-
-/* misc useful functions */
-
-#if FF_API_OLD_FF_PICT_TYPES
-/**
- * Return a single letter to describe the given picture type pict_type.
- *
- * @param[in] pict_type the picture type
- * @return A single character representing the picture type.
- * @deprecated Use av_get_picture_type_char() instead.
- */
-attribute_deprecated
-char av_get_pict_type_char(int pict_type);
-#endif
-
-/**
- * Return codec bits per sample.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_bits_per_sample(enum CodecID codec_id);
-
-#if FF_API_OLD_SAMPLE_FMT
-/**
- * @deprecated Use av_get_bits_per_sample_fmt() instead.
- */
-attribute_deprecated
-int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt);
-#endif
-
-/* frame parsing */
-typedef struct AVCodecParserContext {
-    void *priv_data;
-    struct AVCodecParser *parser;
-    int64_t frame_offset; /* offset of the current frame */
-    int64_t cur_offset; /* current offset
-                           (incremented by each av_parser_parse()) */
-    int64_t next_frame_offset; /* offset of the next frame */
-    /* video info */
-    int pict_type; /* XXX: Put it back in AVCodecContext. */
-    /**
-     * This field is used for proper frame duration computation in lavf.
-     * It signals, how much longer the frame duration of the current frame
-     * is compared to normal frame duration.
-     *
-     * frame_duration = (1 + repeat_pict) * time_base
-     *
-     * It is used by codecs like H.264 to display telecined material.
-     */
-    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
-    int64_t pts;     /* pts of the current frame */
-    int64_t dts;     /* dts of the current frame */
-
-    /* private data */
-    int64_t last_pts;
-    int64_t last_dts;
-    int fetch_timestamp;
-
-#define AV_PARSER_PTS_NB 4
-    int cur_frame_start_index;
-    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
-    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
-    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
-    int flags;
-#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
-#define PARSER_FLAG_ONCE                      0x0002
-/// Set if the parser has a valid file offset
-#define PARSER_FLAG_FETCHED_OFFSET            0x0004
-
-    int64_t offset;      ///< byte offset from starting packet start
-    int64_t cur_frame_end[AV_PARSER_PTS_NB];
-
-    /*!
-     * Set by parser to 1 for key frames and 0 for non-key frames.
-     * It is initialized to -1, so if the parser doesn't set this flag,
-     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
-     * will be used.
-     */
-    int key_frame;
-
-    /**
-     * Time difference in stream time base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current frame.
-     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
-     * set.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-
-    // Timestamp generation support:
-    /**
-     * Synchronization point for start of timestamp generation.
-     *
-     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
-     * (default).
-     *
-     * For example, this corresponds to presence of H.264 buffering period
-     * SEI message.
-     */
-    int dts_sync_point;
-
-    /**
-     * Offset of the current timestamp against last timestamp sync point in
-     * units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain a valid timestamp offset.
-     *
-     * Note that the timestamp of sync point has usually a nonzero
-     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
-     * the next frame after timestamp sync point will be usually 1.
-     *
-     * For example, this corresponds to H.264 cpb_removal_delay.
-     */
-    int dts_ref_dts_delta;
-
-    /**
-     * Presentation delay of current frame in units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain valid non-negative timestamp delta (presentation time of a frame
-     * must not lie in the past).
-     *
-     * This delay represents the difference between decoding and presentation
-     * time of the frame.
-     *
-     * For example, this corresponds to H.264 dpb_output_delay.
-     */
-    int pts_dts_delta;
-
-    /**
-     * Position of the packet in file.
-     *
-     * Analogous to cur_frame_pts/dts
-     */
-    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
-
-    /**
-     * Byte position of currently parsed frame in stream.
-     */
-    int64_t pos;
-
-    /**
-     * Previous frame byte position.
-     */
-    int64_t last_pos;
-} AVCodecParserContext;
-
-typedef struct AVCodecParser {
-    int codec_ids[5]; /* several codec IDs are permitted */
-    int priv_data_size;
-    int (*parser_init)(AVCodecParserContext *s);
-    int (*parser_parse)(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size);
-    void (*parser_close)(AVCodecParserContext *s);
-    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-    struct AVCodecParser *next;
-} AVCodecParser;
-
-AVCodecParser *av_parser_next(AVCodecParser *c);
-
-void av_register_codec_parser(AVCodecParser *parser);
-AVCodecParserContext *av_parser_init(int codec_id);
-
-/**
- * Parse a packet.
- *
- * @param s             parser context.
- * @param avctx         codec context.
- * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
- * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
- * @param buf           input buffer.
- * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
- * @param pts           input presentation timestamp.
- * @param dts           input decoding timestamp.
- * @param pos           input byte position in stream.
- * @return the number of bytes of the input bitstream used.
- *
- * Example:
- * @code
- *   while(in_len){
- *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
- *                                        in_data, in_len,
- *                                        pts, dts, pos);
- *       in_data += len;
- *       in_len  -= len;
- *
- *       if(size)
- *          decode_frame(data, size);
- *   }
- * @endcode
- */
-int av_parser_parse2(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size,
-                     int64_t pts, int64_t dts,
-                     int64_t pos);
-
-int av_parser_change(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe);
-void av_parser_close(AVCodecParserContext *s);
-
-
-typedef struct AVBitStreamFilterContext {
-    void *priv_data;
-    struct AVBitStreamFilter *filter;
-    AVCodecParserContext *parser;
-    struct AVBitStreamFilterContext *next;
-} AVBitStreamFilterContext;
-
-
-typedef struct AVBitStreamFilter {
-    const char *name;
-    int priv_data_size;
-    int (*filter)(AVBitStreamFilterContext *bsfc,
-                  AVCodecContext *avctx, const char *args,
-                  uint8_t **poutbuf, int *poutbuf_size,
-                  const uint8_t *buf, int buf_size, int keyframe);
-    void (*close)(AVBitStreamFilterContext *bsfc);
-    struct AVBitStreamFilter *next;
-} AVBitStreamFilter;
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-                               AVCodecContext *avctx, const char *args,
-                               uint8_t **poutbuf, int *poutbuf_size,
-                               const uint8_t *buf, int buf_size, int keyframe);
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-
-AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
-
-/* memory */
-
-/**
- * Reallocate the given block if it is not large enough, otherwise do nothing.
- *
- * @see av_realloc
- */
-void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Allocate a buffer, reusing the given one if large enough.
- *
- * Contrary to av_fast_realloc the current buffer contents might not be
- * preserved and on error the old buffer is freed, thus no special
- * handling to avoid memleaks is necessary.
- *
- * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
- * @param size size of the buffer *ptr points to
- * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
- *                 *size 0 if an error occurred.
- */
-void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Copy image src to dst. Wraps av_picture_data_copy() above.
- */
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
-                     enum PixelFormat pix_fmt, int width, int height);
-
-/**
- * Crop image top and left side.
- */
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
-                    enum PixelFormat pix_fmt, int top_band, int left_band);
-
-/**
- * Pad image.
- */
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
-            int padtop, int padbottom, int padleft, int padright, int *color);
-
-/**
- * Encode extradata length to a buffer. Used by xiph codecs.
- *
- * @param s buffer to write to; must be at least (v/255+1) bytes long
- * @param v size of extradata in bytes
- * @return number of bytes written to the buffer.
- */
-unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-/**
- * Logs a generic warning message about a missing feature. This function is
- * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] feature string containing the name of the missing feature
- * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
- * If want_sample is non-zero, additional verbage will be added to the log
- * message which tells the user how to report samples to the development
- * mailing list.
- */
-void av_log_missing_feature(void *avc, const char *feature, int want_sample);
-
-/**
- * Log a generic warning message asking for a sample. This function is
- * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] msg string containing an optional message, or NULL if no message
- */
-void av_log_ask_for_sample(void *avc, const char *msg, ...);
-
-/**
- * Register the hardware accelerator hwaccel.
- */
-void av_register_hwaccel(AVHWAccel *hwaccel);
-
-/**
- * If hwaccel is NULL, returns the first registered hardware accelerator,
- * if hwaccel is non-NULL, returns the next registered hardware accelerator
- * after hwaccel, or NULL if hwaccel is the last one.
- */
-AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
-
-
-/**
- * Lock operation used by lockmgr
- */
-enum AVLockOp {
-  AV_LOCK_CREATE,  ///< Create a mutex
-  AV_LOCK_OBTAIN,  ///< Lock the mutex
-  AV_LOCK_RELEASE, ///< Unlock the mutex
-  AV_LOCK_DESTROY, ///< Free mutex resources
-};
-
-/**
- * Register a user provided lock manager supporting the operations
- * specified by AVLockOp. mutex points to a (void *) where the
- * lockmgr should store/get a pointer to a user allocated mutex. It's
- * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
- *
- * @param cb User defined callback. Note: FFmpeg may invoke calls to this
- *           callback during the call to av_lockmgr_register().
- *           Thus, the application must be prepared to handle that.
- *           If cb is set to NULL the lockmgr will be unregistered.
- *           Also note that during unregistration the previously registered
- *           lockmgr callback may also be invoked.
- */
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
-
-#endif /* AVCODEC_AVCODEC_H */
diff --git a/ffmpeg 0.7/include/libavcodec/avfft.h b/ffmpeg 0.7/include/libavcodec/avfft.h
deleted file mode 100644 (file)
index be2d9c7..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVFFT_H
-#define AVCODEC_AVFFT_H
-
-typedef float FFTSample;
-
-typedef struct FFTComplex {
-    FFTSample re, im;
-} FFTComplex;
-
-typedef struct FFTContext FFTContext;
-
-/**
- * Set up a complex FFT.
- * @param nbits           log2 of the length of the input array
- * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
- */
-FFTContext *av_fft_init(int nbits, int inverse);
-
-/**
- * Do the permutation needed BEFORE calling ff_fft_calc().
- */
-void av_fft_permute(FFTContext *s, FFTComplex *z);
-
-/**
- * Do a complex FFT with the parameters defined in av_fft_init(). The
- * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
- */
-void av_fft_calc(FFTContext *s, FFTComplex *z);
-
-void av_fft_end(FFTContext *s);
-
-FFTContext *av_mdct_init(int nbits, int inverse, double scale);
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_end(FFTContext *s);
-
-/* Real Discrete Fourier Transform */
-
-enum RDFTransformType {
-    DFT_R2C,
-    IDFT_C2R,
-    IDFT_R2C,
-    DFT_C2R,
-};
-
-typedef struct RDFTContext RDFTContext;
-
-/**
- * Set up a real FFT.
- * @param nbits           log2 of the length of the input array
- * @param trans           the type of transform
- */
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
-void av_rdft_calc(RDFTContext *s, FFTSample *data);
-void av_rdft_end(RDFTContext *s);
-
-/* Discrete Cosine Transform */
-
-typedef struct DCTContext DCTContext;
-
-enum DCTTransformType {
-    DCT_II = 0,
-    DCT_III,
-    DCT_I,
-    DST_I,
-};
-
-/**
- * Set up DCT.
- * @param nbits           size of the input array:
- *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
- *                        (1 << nbits) + 1 for DCT-I
- *
- * @note the first element of the input of DST-I is ignored
- */
-DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
-void av_dct_calc(DCTContext *s, FFTSample *data);
-void av_dct_end (DCTContext *s);
-
-#endif /* AVCODEC_AVFFT_H */
diff --git a/ffmpeg 0.7/include/libavcodec/dxva2.h b/ffmpeg 0.7/include/libavcodec/dxva2.h
deleted file mode 100644 (file)
index 5c5fe21..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DXVA2 HW acceleration
- *
- * copyright (c) 2009 Laurent Aimar
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DXVA_H
-#define AVCODEC_DXVA_H
-
-#include <stdint.h>
-
-#include <dxva2api.h>
-
-/**
- * This structure is used to provides the necessary configurations and data
- * to the DXVA2 FFmpeg HWAccel implementation.
- *
- * The application must make it available as AVCodecContext.hwaccel_context.
- */
-struct dxva_context {
-    /**
-     * DXVA2 decoder object
-     */
-    IDirectXVideoDecoder *decoder;
-
-    /**
-     * DXVA2 configuration used to create the decoder
-     */
-    const DXVA2_ConfigPictureDecode *cfg;
-
-    /**
-     * The number of surface in the surface array
-     */
-    unsigned surface_count;
-
-    /**
-     * The array of Direct3D surfaces used to create the decoder
-     */
-    LPDIRECT3DSURFACE9 *surface;
-
-    /**
-     * A bit field configuring the workarounds needed for using the decoder
-     */
-    uint64_t workaround;
-
-    /**
-     * Private to the FFmpeg AVHWAccel implementation
-     */
-    unsigned report_id;
-};
-
-#endif /* AVCODEC_DXVA_H */
diff --git a/ffmpeg 0.7/include/libavcodec/opt.h b/ffmpeg 0.7/include/libavcodec/opt.h
deleted file mode 100644 (file)
index 70de27d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * @file
- * This header is provided for compatibility only and will be removed
- * on next major bump
- */
-
-#ifndef AVCODEC_OPT_H
-#define AVCODEC_OPT_H
-
-#include "libavcodec/version.h"
-
-#if FF_API_OPT_H
-#include "libavutil/opt.h"
-#endif
-
-#endif /* AVCODEC_OPT_H */
diff --git a/ffmpeg 0.7/include/libavcodec/vaapi.h b/ffmpeg 0.7/include/libavcodec/vaapi.h
deleted file mode 100644 (file)
index 07568a4..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Video Acceleration API (shared data between FFmpeg and the video player)
- * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VAAPI_H
-#define AVCODEC_VAAPI_H
-
-#include <stdint.h>
-
-/**
- * \defgroup VAAPI_Decoding VA API Decoding
- * \ingroup Decoder
- * @{
- */
-
-/**
- * This structure is used to share data between the FFmpeg library and
- * the client video application.
- * This shall be zero-allocated and available as
- * AVCodecContext.hwaccel_context. All user members can be set once
- * during initialization or through each AVCodecContext.get_buffer()
- * function call. In any case, they must be valid prior to calling
- * decoding functions.
- */
-struct vaapi_context {
-    /**
-     * Window system dependent data
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *display;
-
-    /**
-     * Configuration ID
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    uint32_t config_id;
-
-    /**
-     * Context ID (video decode pipeline)
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    uint32_t context_id;
-
-    /**
-     * VAPictureParameterBuffer ID
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t pic_param_buf_id;
-
-    /**
-     * VAIQMatrixBuffer ID
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t iq_matrix_buf_id;
-
-    /**
-     * VABitPlaneBuffer ID (for VC-1 decoding)
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t bitplane_buf_id;
-
-    /**
-     * Slice parameter/data buffer IDs
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t *slice_buf_ids;
-
-    /**
-     * Number of effective slice buffer IDs to send to the HW
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int n_slice_buf_ids;
-
-    /**
-     * Size of pre-allocated slice_buf_ids
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_buf_ids_alloc;
-
-    /**
-     * Pointer to VASliceParameterBuffers
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    void *slice_params;
-
-    /**
-     * Size of a VASliceParameterBuffer element
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_param_size;
-
-    /**
-     * Size of pre-allocated slice_params
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_params_alloc;
-
-    /**
-     * Number of slices currently filled in
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_count;
-
-    /**
-     * Pointer to slice data buffer base
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    const uint8_t *slice_data;
-
-    /**
-     * Current size of slice data
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t slice_data_size;
-};
-
-/* @} */
-
-#endif /* AVCODEC_VAAPI_H */
diff --git a/ffmpeg 0.7/include/libavcodec/vdpau.h b/ffmpeg 0.7/include/libavcodec/vdpau.h
deleted file mode 100644 (file)
index 0dc6fb8..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * The Video Decode and Presentation API for UNIX (VDPAU) is used for
- * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
- *
- * Copyright (C) 2008 NVIDIA
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VDPAU_H
-#define AVCODEC_VDPAU_H
-
-/**
- * \defgroup Decoder VDPAU Decoder and Renderer
- *
- * VDPAU hardware acceleration has two modules
- * - VDPAU decoding
- * - VDPAU presentation
- *
- * The VDPAU decoding module parses all headers using FFmpeg
- * parsing mechanisms and uses VDPAU for the actual decoding.
- *
- * As per the current implementation, the actual decoding
- * and rendering (API calls) are done as part of the VDPAU
- * presentation (vo_vdpau.c) module.
- *
- * \defgroup  VDPAU_Decoding VDPAU Decoding
- * \ingroup Decoder
- * @{
- */
-
-#include <vdpau/vdpau.h>
-#include <vdpau/vdpau_x11.h>
-
-/** \brief The videoSurface is used for rendering. */
-#define FF_VDPAU_STATE_USED_FOR_RENDER 1
-
-/**
- * \brief The videoSurface is needed for reference/prediction.
- * The codec manipulates this.
- */
-#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
-
-/**
- * \brief This structure is used as a callback between the FFmpeg
- * decoder (vd_) and presentation (vo_) module.
- * This is used for defining a video frame containing surface,
- * picture parameter, bitstream information etc which are passed
- * between the FFmpeg decoder and its clients.
- */
-struct vdpau_render_state {
-    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
-
-    int state; ///< Holds FF_VDPAU_STATE_* values.
-
-    /** Describe size/location of the compressed video data.
-        Set to 0 when freeing bitstream_buffers. */
-    int bitstream_buffers_allocated;
-    int bitstream_buffers_used;
-    /** The user is responsible for freeing this buffer using av_freep(). */
-    VdpBitstreamBuffer *bitstream_buffers;
-
-    /** picture parameter information for all supported codecs */
-    union VdpPictureInfo {
-        VdpPictureInfoH264        h264;
-        VdpPictureInfoMPEG1Or2    mpeg;
-        VdpPictureInfoVC1          vc1;
-        VdpPictureInfoMPEG4Part2 mpeg4;
-    } info;
-};
-
-/* @}*/
-
-#endif /* AVCODEC_VDPAU_H */
diff --git a/ffmpeg 0.7/include/libavcodec/version.h b/ffmpeg 0.7/include/libavcodec/version.h
deleted file mode 100644 (file)
index 100c06d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VERSION_H
-#define AVCODEC_VERSION_H
-
-#define LIBAVCODEC_VERSION_MAJOR 53
-#define LIBAVCODEC_VERSION_MINOR  7
-#define LIBAVCODEC_VERSION_MICRO  0
-
-#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-                                               LIBAVCODEC_VERSION_MINOR, \
-                                               LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
-                                           LIBAVCODEC_VERSION_MINOR,    \
-                                           LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
-
-#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
-
-/**
- * Those FF_API_* defines are not part of public API.
- * They may change, break or disappear at any time.
- */
-#ifndef FF_API_PALETTE_CONTROL
-#define FF_API_PALETTE_CONTROL  (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_OLD_SAMPLE_FMT
-#define FF_API_OLD_SAMPLE_FMT   (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_OLD_AUDIOCONVERT
-#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_ANTIALIAS_ALGO
-#define FF_API_ANTIALIAS_ALGO   (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_REQUEST_CHANNELS
-#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_OPT_H
-#define FF_API_OPT_H            (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_THREAD_INIT
-#define FF_API_THREAD_INIT      (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_OLD_FF_PICT_TYPES
-#define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_FLAC_GLOBAL_OPTS
-#define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_GET_PIX_FMT_NAME
-#define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
-
-#endif /* AVCODEC_VERSION_H */
diff --git a/ffmpeg 0.7/include/libavcodec/xvmc.h b/ffmpeg 0.7/include/libavcodec/xvmc.h
deleted file mode 100644 (file)
index 93ad8bb..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2003 Ivan Kalvachev
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XVMC_H
-#define AVCODEC_XVMC_H
-
-#include <X11/extensions/XvMC.h>
-
-#include "avcodec.h"
-
-#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
-                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
-
-struct xvmc_pix_fmt {
-    /** The field contains the special constant value AV_XVMC_ID.
-        It is used as a test that the application correctly uses the API,
-        and that there is no corruption caused by pixel routines.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             xvmc_id;
-
-    /** Pointer to the block array allocated by XvMCCreateBlocks().
-        The array has to be freed by XvMCDestroyBlocks().
-        Each group of 64 values represents one data block of differential
-        pixel information (in MoCo mode) or coefficients for IDCT.
-        - application - set the pointer during initialization
-        - libavcodec  - fills coefficients/pixel data into the array
-    */
-    short*          data_blocks;
-
-    /** Pointer to the macroblock description array allocated by
-        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
-        - application - set the pointer during initialization
-        - libavcodec  - fills description data into the array
-    */
-    XvMCMacroBlock* mv_blocks;
-
-    /** Number of macroblock descriptions that can be stored in the mv_blocks
-        array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_mv_blocks;
-
-    /** Number of blocks that can be stored at once in the data_blocks array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_data_blocks;
-
-    /** Indicate that the hardware would interpret data_blocks as IDCT
-        coefficients and perform IDCT on them.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             idct;
-
-    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
-        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             unsigned_intra;
-
-    /** Pointer to the surface allocated by XvMCCreateSurface().
-        It has to be freed by XvMCDestroySurface() on application exit.
-        It identifies the frame and its state on the video hardware.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    XvMCSurface*    p_surface;
-
-/** Set by the decoder before calling ff_draw_horiz_band(),
-    needed by the XvMCRenderSurface function. */
-//@{
-    /** Pointer to the surface used as past reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_past_surface;
-
-    /** Pointer to the surface used as future reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_future_surface;
-
-    /** top/bottom field or frame
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    picture_structure;
-
-    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    flags;
-//}@
-
-    /** Number of macroblock descriptions in the mv_blocks array
-        that have already been passed to the hardware.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may increment it
-                        with filled_mb_block_num or zero both.
-        - libavcodec  - unchanged
-    */
-    int             start_mv_blocks_num;
-
-    /** Number of new macroblock descriptions in the mv_blocks array (after
-        start_mv_blocks_num) that are filled by libavcodec and have to be
-        passed to the hardware.
-        - application - zeroes it on get_buffer() or after successful
-                        ff_draw_horiz_band().
-        - libavcodec  - increment with one of each stored MB
-    */
-    int             filled_mv_blocks_num;
-
-    /** Number of the the next free data block; one data block consists of
-        64 short values in the data_blocks array.
-        All blocks before this one have already been claimed by placing their
-        position into the corresponding block description structure field,
-        that are part of the mv_blocks array.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may zero it together
-                        with start_mb_blocks_num.
-        - libavcodec  - each decoded macroblock increases it by the number
-                        of coded blocks it contains.
-    */
-    int             next_free_data_block_num;
-};
-
-#endif /* AVCODEC_XVMC_H */
diff --git a/ffmpeg 0.7/include/libavdevice/avdevice.h b/ffmpeg 0.7/include/libavdevice/avdevice.h
deleted file mode 100644 (file)
index e49e5b7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_AVDEVICE_H
-#define AVDEVICE_AVDEVICE_H
-
-#include "libavutil/avutil.h"
-#include "libavformat/avformat.h"
-
-#define LIBAVDEVICE_VERSION_MAJOR 53
-#define LIBAVDEVICE_VERSION_MINOR  1
-#define LIBAVDEVICE_VERSION_MICRO  1
-
-#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
-                                               LIBAVDEVICE_VERSION_MINOR, \
-                                               LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_VERSION     AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
-                                           LIBAVDEVICE_VERSION_MINOR, \
-                                           LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_BUILD       LIBAVDEVICE_VERSION_INT
-
-#ifndef FF_API_V4L
-#define FF_API_V4L              (LIBAVDEVICE_VERSION_MAJOR < 54)
-#endif
-
-/**
- * Return the LIBAVDEVICE_VERSION_INT constant.
- */
-unsigned avdevice_version(void);
-
-/**
- * Return the libavdevice build-time configuration.
- */
-const char *avdevice_configuration(void);
-
-/**
- * Return the libavdevice license.
- */
-const char *avdevice_license(void);
-
-/**
- * Initialize libavdevice and register all the input and output devices.
- * @warning This function is not thread safe.
- */
-void avdevice_register_all(void);
-
-#endif /* AVDEVICE_AVDEVICE_H */
-
diff --git a/ffmpeg 0.7/include/libavfilter/avcodec.h b/ffmpeg 0.7/include/libavfilter/avcodec.h
deleted file mode 100644 (file)
index 4eed6b2..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_AVCODEC_H
-#define AVFILTER_AVCODEC_H
-
-/**
- * @file
- * libavcodec/libavfilter gluing utilities
- *
- * This should be included in an application ONLY if the installed
- * libavfilter has been compiled with libavcodec support, otherwise
- * symbols defined below will not be available.
- */
-
-#include "libavcodec/avcodec.h" // AVFrame
-#include "avfilter.h"
-#include "vsrc_buffer.h"
-
-/**
- * Copy the frame properties of src to dst, without copying the actual
- * image data.
- */
-void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
-
-/**
- * Create and return a picref reference from the data and properties
- * contained in frame.
- *
- * @param perms permissions to assign to the new buffer reference
- */
-AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
-
-/**
- * Add frame data to buffer_src.
- *
- * @param buffer_src pointer to a buffer source context
- * @param flags a combination of AV_VSRC_BUF_FLAG_* flags
- * @return >= 0 in case of success, a negative AVERROR code in case of
- * failure
- */
-int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
-                             const AVFrame *frame, int flags);
-
-#endif /* AVFILTER_AVCODEC_H */
diff --git a/ffmpeg 0.7/include/libavfilter/avfilter.h b/ffmpeg 0.7/include/libavfilter/avfilter.h
deleted file mode 100644 (file)
index 4f5ed36..0000000
+++ /dev/null
@@ -1,886 +0,0 @@
-/*
- * filter layer
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_AVFILTER_H
-#define AVFILTER_AVFILTER_H
-
-#include "libavutil/avutil.h"
-#include "libavutil/samplefmt.h"
-
-#define LIBAVFILTER_VERSION_MAJOR  2
-#define LIBAVFILTER_VERSION_MINOR 15
-#define LIBAVFILTER_VERSION_MICRO  0
-
-#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
-                                               LIBAVFILTER_VERSION_MINOR, \
-                                               LIBAVFILTER_VERSION_MICRO)
-#define LIBAVFILTER_VERSION     AV_VERSION(LIBAVFILTER_VERSION_MAJOR,   \
-                                           LIBAVFILTER_VERSION_MINOR,   \
-                                           LIBAVFILTER_VERSION_MICRO)
-#define LIBAVFILTER_BUILD       LIBAVFILTER_VERSION_INT
-
-#include <stddef.h>
-
-/**
- * Return the LIBAVFILTER_VERSION_INT constant.
- */
-unsigned avfilter_version(void);
-
-/**
- * Return the libavfilter build-time configuration.
- */
-const char *avfilter_configuration(void);
-
-/**
- * Return the libavfilter license.
- */
-const char *avfilter_license(void);
-
-
-typedef struct AVFilterContext AVFilterContext;
-typedef struct AVFilterLink    AVFilterLink;
-typedef struct AVFilterPad     AVFilterPad;
-
-/**
- * A reference-counted buffer data type used by the filter system. Filters
- * should not store pointers to this structure directly, but instead use the
- * AVFilterBufferRef structure below.
- */
-typedef struct AVFilterBuffer {
-    uint8_t *data[8];           ///< buffer data for each plane/channel
-    int linesize[8];            ///< number of bytes per line
-
-    unsigned refcount;          ///< number of references to this buffer
-
-    /** private data to be used by a custom free function */
-    void *priv;
-    /**
-     * A pointer to the function to deallocate this buffer if the default
-     * function is not sufficient. This could, for example, add the memory
-     * back into a memory pool to be reused later without the overhead of
-     * reallocating it from scratch.
-     */
-    void (*free)(struct AVFilterBuffer *buf);
-
-    int format;                 ///< media format
-    int w, h;                   ///< width and height of the allocated buffer
-} AVFilterBuffer;
-
-#define AV_PERM_READ     0x01   ///< can read from the buffer
-#define AV_PERM_WRITE    0x02   ///< can write to the buffer
-#define AV_PERM_PRESERVE 0x04   ///< nobody else can overwrite the buffer
-#define AV_PERM_REUSE    0x08   ///< can output the buffer multiple times, with the same contents each time
-#define AV_PERM_REUSE2   0x10   ///< can output the buffer multiple times, modified each time
-#define AV_PERM_NEG_LINESIZES 0x20  ///< the buffer requested can have negative linesizes
-
-/**
- * Audio specific properties in a reference to an AVFilterBuffer. Since
- * AVFilterBufferRef is common to different media formats, audio specific
- * per reference properties must be separated out.
- */
-typedef struct AVFilterBufferRefAudioProps {
-    int64_t channel_layout;     ///< channel layout of audio buffer
-    int nb_samples;             ///< number of audio samples per channel
-    uint32_t sample_rate;       ///< audio buffer sample rate
-    int planar;                 ///< audio buffer - planar or packed
-} AVFilterBufferRefAudioProps;
-
-/**
- * Video specific properties in a reference to an AVFilterBuffer. Since
- * AVFilterBufferRef is common to different media formats, video specific
- * per reference properties must be separated out.
- */
-typedef struct AVFilterBufferRefVideoProps {
-    int w;                      ///< image width
-    int h;                      ///< image height
-    AVRational sample_aspect_ratio; ///< sample aspect ratio
-    int interlaced;             ///< is frame interlaced
-    int top_field_first;        ///< field order
-    enum AVPictureType pict_type; ///< picture type of the frame
-    int key_frame;              ///< 1 -> keyframe, 0-> not
-} AVFilterBufferRefVideoProps;
-
-/**
- * A reference to an AVFilterBuffer. Since filters can manipulate the origin of
- * a buffer to, for example, crop image without any memcpy, the buffer origin
- * and dimensions are per-reference properties. Linesize is also useful for
- * image flipping, frame to field filters, etc, and so is also per-reference.
- *
- * TODO: add anything necessary for frame reordering
- */
-typedef struct AVFilterBufferRef {
-    AVFilterBuffer *buf;        ///< the buffer that this is a reference to
-    uint8_t *data[8];           ///< picture/audio data for each plane
-    int linesize[8];            ///< number of bytes per line
-    int format;                 ///< media format
-
-    /**
-     * presentation timestamp. The time unit may change during
-     * filtering, as it is specified in the link and the filter code
-     * may need to rescale the PTS accordingly.
-     */
-    int64_t pts;
-    int64_t pos;                ///< byte position in stream, -1 if unknown
-
-    int perms;                  ///< permissions, see the AV_PERM_* flags
-
-    enum AVMediaType type;      ///< media type of buffer data
-    AVFilterBufferRefVideoProps *video; ///< video buffer specific properties
-    AVFilterBufferRefAudioProps *audio; ///< audio buffer specific properties
-} AVFilterBufferRef;
-
-/**
- * Copy properties of src to dst, without copying the actual data
- */
-static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
-{
-    // copy common properties
-    dst->pts             = src->pts;
-    dst->pos             = src->pos;
-
-    switch (src->type) {
-    case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
-    case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
-    }
-}
-
-/**
- * Add a new reference to a buffer.
- *
- * @param ref   an existing reference to the buffer
- * @param pmask a bitmask containing the allowable permissions in the new
- *              reference
- * @return      a new reference to the buffer with the same properties as the
- *              old, excluding any permissions denied by pmask
- */
-AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask);
-
-/**
- * Remove a reference to a buffer. If this is the last reference to the
- * buffer, the buffer itself is also automatically freed.
- *
- * @param ref reference to the buffer, may be NULL
- */
-void avfilter_unref_buffer(AVFilterBufferRef *ref);
-
-/**
- * A list of supported formats for one end of a filter link. This is used
- * during the format negotiation process to try to pick the best format to
- * use to minimize the number of necessary conversions. Each filter gives a
- * list of the formats supported by each input and output pad. The list
- * given for each pad need not be distinct - they may be references to the
- * same list of formats, as is often the case when a filter supports multiple
- * formats, but will always output the same format as it is given in input.
- *
- * In this way, a list of possible input formats and a list of possible
- * output formats are associated with each link. When a set of formats is
- * negotiated over a link, the input and output lists are merged to form a
- * new list containing only the common elements of each list. In the case
- * that there were no common elements, a format conversion is necessary.
- * Otherwise, the lists are merged, and all other links which reference
- * either of the format lists involved in the merge are also affected.
- *
- * For example, consider the filter chain:
- * filter (a) --> (b) filter (b) --> (c) filter
- *
- * where the letters in parenthesis indicate a list of formats supported on
- * the input or output of the link. Suppose the lists are as follows:
- * (a) = {A, B}
- * (b) = {A, B, C}
- * (c) = {B, C}
- *
- * First, the first link's lists are merged, yielding:
- * filter (a) --> (a) filter (a) --> (c) filter
- *
- * Notice that format list (b) now refers to the same list as filter list (a).
- * Next, the lists for the second link are merged, yielding:
- * filter (a) --> (a) filter (a) --> (a) filter
- *
- * where (a) = {B}.
- *
- * Unfortunately, when the format lists at the two ends of a link are merged,
- * we must ensure that all links which reference either pre-merge format list
- * get updated as well. Therefore, we have the format list structure store a
- * pointer to each of the pointers to itself.
- */
-typedef struct AVFilterFormats {
-    unsigned format_count;      ///< number of formats
-    int *formats;               ///< list of media formats
-
-    unsigned refcount;          ///< number of references to this list
-    struct AVFilterFormats ***refs; ///< references to this list
-}  AVFilterFormats;
-
-/**
- * Create a list of supported formats. This is intended for use in
- * AVFilter->query_formats().
- *
- * @param fmts list of media formats, terminated by -1. If NULL an
- *        empty list is created.
- * @return the format list, with no existing references
- */
-AVFilterFormats *avfilter_make_format_list(const int *fmts);
-
-/**
- * Add fmt to the list of media formats contained in *avff.
- * If *avff is NULL the function allocates the filter formats struct
- * and puts its pointer in *avff.
- *
- * @return a non negative value in case of success, or a negative
- * value corresponding to an AVERROR code in case of error
- */
-int avfilter_add_format(AVFilterFormats **avff, int fmt);
-
-/**
- * Return a list of all formats supported by FFmpeg for the given media type.
- */
-AVFilterFormats *avfilter_all_formats(enum AVMediaType type);
-
-/**
- * Return a format list which contains the intersection of the formats of
- * a and b. Also, all the references of a, all the references of b, and
- * a and b themselves will be deallocated.
- *
- * If a and b do not share any common formats, neither is modified, and NULL
- * is returned.
- */
-AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b);
-
-/**
- * Add *ref as a new reference to formats.
- * That is the pointers will point like in the ascii art below:
- *   ________
- *  |formats |<--------.
- *  |  ____  |     ____|___________________
- *  | |refs| |    |  __|_
- *  | |* * | |    | |  | |  AVFilterLink
- *  | |* *--------->|*ref|
- *  | |____| |    | |____|
- *  |________|    |________________________
- */
-void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
-
-/**
- * If *ref is non-NULL, remove *ref as a reference to the format list
- * it currently points to, deallocates that list if this was the last
- * reference, and sets *ref to NULL.
- *
- *         Before                                 After
- *   ________                               ________         NULL
- *  |formats |<--------.                   |formats |         ^
- *  |  ____  |     ____|________________   |  ____  |     ____|________________
- *  | |refs| |    |  __|_                  | |refs| |    |  __|_
- *  | |* * | |    | |  | |  AVFilterLink   | |* * | |    | |  | |  AVFilterLink
- *  | |* *--------->|*ref|                 | |*   | |    | |*ref|
- *  | |____| |    | |____|                 | |____| |    | |____|
- *  |________|    |_____________________   |________|    |_____________________
- */
-void avfilter_formats_unref(AVFilterFormats **ref);
-
-/**
- *
- *         Before                                 After
- *   ________                         ________
- *  |formats |<---------.            |formats |<---------.
- *  |  ____  |       ___|___         |  ____  |       ___|___
- *  | |refs| |      |   |   |        | |refs| |      |   |   |   NULL
- *  | |* *--------->|*oldref|        | |* *--------->|*newref|     ^
- *  | |* * | |      |_______|        | |* * | |      |_______|  ___|___
- *  | |____| |                       | |____| |                |   |   |
- *  |________|                       |________|                |*oldref|
- *                                                             |_______|
- */
-void avfilter_formats_changeref(AVFilterFormats **oldref,
-                                AVFilterFormats **newref);
-
-/**
- * A filter pad used for either input or output.
- */
-struct AVFilterPad {
-    /**
-     * Pad name. The name is unique among inputs and among outputs, but an
-     * input may have the same name as an output. This may be NULL if this
-     * pad has no need to ever be referenced by name.
-     */
-    const char *name;
-
-    /**
-     * AVFilterPad type. Only video supported now, hopefully someone will
-     * add audio in the future.
-     */
-    enum AVMediaType type;
-
-    /**
-     * Minimum required permissions on incoming buffers. Any buffer with
-     * insufficient permissions will be automatically copied by the filter
-     * system to a new buffer which provides the needed access permissions.
-     *
-     * Input pads only.
-     */
-    int min_perms;
-
-    /**
-     * Permissions which are not accepted on incoming buffers. Any buffer
-     * which has any of these permissions set will be automatically copied
-     * by the filter system to a new buffer which does not have those
-     * permissions. This can be used to easily disallow buffers with
-     * AV_PERM_REUSE.
-     *
-     * Input pads only.
-     */
-    int rej_perms;
-
-    /**
-     * Callback called before passing the first slice of a new frame. If
-     * NULL, the filter layer will default to storing a reference to the
-     * picture inside the link structure.
-     *
-     * Input video pads only.
-     */
-    void (*start_frame)(AVFilterLink *link, AVFilterBufferRef *picref);
-
-    /**
-     * Callback function to get a video buffer. If NULL, the filter system will
-     * use avfilter_default_get_video_buffer().
-     *
-     * Input video pads only.
-     */
-    AVFilterBufferRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h);
-
-    /**
-     * Callback function to get an audio buffer. If NULL, the filter system will
-     * use avfilter_default_get_audio_buffer().
-     *
-     * Input audio pads only.
-     */
-    AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms,
-                                           enum AVSampleFormat sample_fmt, int nb_samples,
-                                           int64_t channel_layout, int planar);
-
-    /**
-     * Callback called after the slices of a frame are completely sent. If
-     * NULL, the filter layer will default to releasing the reference stored
-     * in the link structure during start_frame().
-     *
-     * Input video pads only.
-     */
-    void (*end_frame)(AVFilterLink *link);
-
-    /**
-     * Slice drawing callback. This is where a filter receives video data
-     * and should do its processing.
-     *
-     * Input video pads only.
-     */
-    void (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
-
-    /**
-     * Samples filtering callback. This is where a filter receives audio data
-     * and should do its processing.
-     *
-     * Input audio pads only.
-     */
-    void (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
-    /**
-     * Frame poll callback. This returns the number of immediately available
-     * samples. It should return a positive value if the next request_frame()
-     * is guaranteed to return one frame (with no delay).
-     *
-     * Defaults to just calling the source poll_frame() method.
-     *
-     * Output video pads only.
-     */
-    int (*poll_frame)(AVFilterLink *link);
-
-    /**
-     * Frame request callback. A call to this should result in at least one
-     * frame being output over the given link. This should return zero on
-     * success, and another value on error.
-     *
-     * Output video pads only.
-     */
-    int (*request_frame)(AVFilterLink *link);
-
-    /**
-     * Link configuration callback.
-     *
-     * For output pads, this should set the link properties such as
-     * width/height. This should NOT set the format property - that is
-     * negotiated between filters by the filter system using the
-     * query_formats() callback before this function is called.
-     *
-     * For input pads, this should check the properties of the link, and update
-     * the filter's internal state as necessary.
-     *
-     * For both input and output filters, this should return zero on success,
-     * and another value on error.
-     */
-    int (*config_props)(AVFilterLink *link);
-};
-
-/** default handler for start_frame() for video inputs */
-void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/** default handler for draw_slice() for video inputs */
-void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-
-/** default handler for end_frame() for video inputs */
-void avfilter_default_end_frame(AVFilterLink *link);
-
-/** default handler for filter_samples() for audio inputs */
-void avfilter_default_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
-/** default handler for config_props() for audio/video outputs */
-int avfilter_default_config_output_link(AVFilterLink *link);
-
-/** default handler for config_props() for audio/video inputs */
-int avfilter_default_config_input_link (AVFilterLink *link);
-
-/** default handler for get_video_buffer() for video inputs */
-AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link,
-                                                     int perms, int w, int h);
-
-/** default handler for get_audio_buffer() for audio inputs */
-AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,
-                                                     enum AVSampleFormat sample_fmt, int nb_samples,
-                                                     int64_t channel_layout, int planar);
-
-/**
- * A helper for query_formats() which sets all links to the same list of
- * formats. If there are no links hooked to this filter, the list of formats is
- * freed.
- */
-void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
-
-/** Default handler for query_formats() */
-int avfilter_default_query_formats(AVFilterContext *ctx);
-
-/** start_frame() handler for filters which simply pass video along */
-void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/** draw_slice() handler for filters which simply pass video along */
-void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-
-/** end_frame() handler for filters which simply pass video along */
-void avfilter_null_end_frame(AVFilterLink *link);
-
-/** filter_samples() handler for filters which simply pass audio along */
-void avfilter_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
-/** get_video_buffer() handler for filters which simply pass video along */
-AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link,
-                                                  int perms, int w, int h);
-
-/** get_audio_buffer() handler for filters which simply pass audio along */
-AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms,
-                                                  enum AVSampleFormat sample_fmt, int size,
-                                                  int64_t channel_layout, int planar);
-
-/**
- * Filter definition. This defines the pads a filter contains, and all the
- * callback functions used to interact with the filter.
- */
-typedef struct AVFilter {
-    const char *name;         ///< filter name
-
-    int priv_size;      ///< size of private data to allocate for the filter
-
-    /**
-     * Filter initialization function. Args contains the user-supplied
-     * parameters. FIXME: maybe an AVOption-based system would be better?
-     * opaque is data provided by the code requesting creation of the filter,
-     * and is used to pass data to the filter.
-     */
-    int (*init)(AVFilterContext *ctx, const char *args, void *opaque);
-
-    /**
-     * Filter uninitialization function. Should deallocate any memory held
-     * by the filter, release any buffer references, etc. This does not need
-     * to deallocate the AVFilterContext->priv memory itself.
-     */
-    void (*uninit)(AVFilterContext *ctx);
-
-    /**
-     * Queries formats supported by the filter and its pads, and sets the
-     * in_formats for links connected to its output pads, and out_formats
-     * for links connected to its input pads.
-     *
-     * @return zero on success, a negative value corresponding to an
-     * AVERROR code otherwise
-     */
-    int (*query_formats)(AVFilterContext *);
-
-    const AVFilterPad *inputs;  ///< NULL terminated list of inputs. NULL if none
-    const AVFilterPad *outputs; ///< NULL terminated list of outputs. NULL if none
-
-    /**
-     * A description for the filter. You should use the
-     * NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *description;
-} AVFilter;
-
-/** An instance of a filter */
-struct AVFilterContext {
-    const AVClass *av_class;              ///< needed for av_log()
-
-    AVFilter *filter;               ///< the AVFilter of which this is an instance
-
-    char *name;                     ///< name of this filter instance
-
-    unsigned input_count;           ///< number of input pads
-    AVFilterPad   *input_pads;      ///< array of input pads
-    AVFilterLink **inputs;          ///< array of pointers to input links
-
-    unsigned output_count;          ///< number of output pads
-    AVFilterPad   *output_pads;     ///< array of output pads
-    AVFilterLink **outputs;         ///< array of pointers to output links
-
-    void *priv;                     ///< private data for use by the filter
-};
-
-/**
- * A link between two filters. This contains pointers to the source and
- * destination filters between which this link exists, and the indexes of
- * the pads involved. In addition, this link also contains the parameters
- * which have been negotiated and agreed upon between the filter, such as
- * image dimensions, format, etc.
- */
-struct AVFilterLink {
-    AVFilterContext *src;       ///< source filter
-    AVFilterPad *srcpad;        ///< output pad on the source filter
-
-    AVFilterContext *dst;       ///< dest filter
-    AVFilterPad *dstpad;        ///< input pad on the dest filter
-
-    /** stage of the initialization of the link properties (dimensions, etc) */
-    enum {
-        AVLINK_UNINIT = 0,      ///< not started
-        AVLINK_STARTINIT,       ///< started, but incomplete
-        AVLINK_INIT             ///< complete
-    } init_state;
-
-    enum AVMediaType type;      ///< filter media type
-
-    /* These parameters apply only to video */
-    int w;                      ///< agreed upon image width
-    int h;                      ///< agreed upon image height
-    AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
-    /* These two parameters apply only to audio */
-    int64_t channel_layout;     ///< channel layout of current buffer (see libavutil/audioconvert.h)
-    int64_t sample_rate;        ///< samples per second
-
-    int format;                 ///< agreed upon media format
-
-    /**
-     * Lists of formats supported by the input and output filters respectively.
-     * These lists are used for negotiating the format to actually be used,
-     * which will be loaded into the format member, above, when chosen.
-     */
-    AVFilterFormats *in_formats;
-    AVFilterFormats *out_formats;
-
-    /**
-     * The buffer reference currently being sent across the link by the source
-     * filter. This is used internally by the filter system to allow
-     * automatic copying of buffers which do not have sufficient permissions
-     * for the destination. This should not be accessed directly by the
-     * filters.
-     */
-    AVFilterBufferRef *src_buf;
-
-    AVFilterBufferRef *cur_buf;
-    AVFilterBufferRef *out_buf;
-
-    /**
-     * Define the time base used by the PTS of the frames/samples
-     * which will pass through this link.
-     * During the configuration stage, each filter is supposed to
-     * change only the output timebase, while the timebase of the
-     * input link is assumed to be an unchangeable property.
-     */
-    AVRational time_base;
-
-    struct AVFilterPool *pool;
-};
-
-/**
- * Link two filters together.
- *
- * @param src    the source filter
- * @param srcpad index of the output pad on the source filter
- * @param dst    the destination filter
- * @param dstpad index of the input pad on the destination filter
- * @return       zero on success
- */
-int avfilter_link(AVFilterContext *src, unsigned srcpad,
-                  AVFilterContext *dst, unsigned dstpad);
-
-/**
- * Free the link in *link, and set its pointer to NULL.
- */
-void avfilter_link_free(AVFilterLink **link);
-
-/**
- * Negotiate the media format, dimensions, etc of all inputs to a filter.
- *
- * @param filter the filter to negotiate the properties for its inputs
- * @return       zero on successful negotiation
- */
-int avfilter_config_links(AVFilterContext *filter);
-
-/**
- * Request a picture buffer with a specific set of permissions.
- *
- * @param link  the output link to the filter from which the buffer will
- *              be requested
- * @param perms the required access permissions
- * @param w     the minimum width of the buffer to allocate
- * @param h     the minimum height of the buffer to allocate
- * @return      A reference to the buffer. This must be unreferenced with
- *              avfilter_unref_buffer when you are finished with it.
- */
-AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
-                                          int w, int h);
-
-/**
- * Create a buffer reference wrapped around an already allocated image
- * buffer.
- *
- * @param data pointers to the planes of the image to reference
- * @param linesize linesizes for the planes of the image to reference
- * @param perms the required access permissions
- * @param w the width of the image specified by the data and linesize arrays
- * @param h the height of the image specified by the data and linesize arrays
- * @param format the pixel format of the image specified by the data and linesize arrays
- */
-AVFilterBufferRef *
-avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
-                                          int w, int h, enum PixelFormat format);
-
-/**
- * Request an audio samples buffer with a specific set of permissions.
- *
- * @param link           the output link to the filter from which the buffer will
- *                       be requested
- * @param perms          the required access permissions
- * @param sample_fmt     the format of each sample in the buffer to allocate
- * @param nb_samples     the number of samples per channel
- * @param channel_layout the number and type of channels per sample in the buffer to allocate
- * @param planar         audio data layout - planar or packed
- * @return               A reference to the samples. This must be unreferenced with
- *                       avfilter_unref_buffer when you are finished with it.
- */
-AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
-                                             enum AVSampleFormat sample_fmt, int nb_samples,
-                                             int64_t channel_layout, int planar);
-
-/**
- * Create an audio buffer reference wrapped around an already
- * allocated samples buffer.
- *
- * @param data           pointers to the samples plane buffers
- * @param linesize       linesize for the samples plane buffers
- * @param perms          the required access permissions
- * @param nb_samples     number of samples per channel
- * @param sample_fmt     the format of each sample in the buffer to allocate
- * @param channel_layout the channel layout of the buffer
- * @param planar         audio data layout - planar or packed
- */
-AVFilterBufferRef *
-avfilter_get_audio_buffer_ref_from_arrays(uint8_t *data[8], int linesize[8], int perms,
-                                          int nb_samples, enum AVSampleFormat sample_fmt,
-                                          int64_t channel_layout, int planar);
-
-/**
- * Request an input frame from the filter at the other end of the link.
- *
- * @param link the input link
- * @return     zero on success
- */
-int avfilter_request_frame(AVFilterLink *link);
-
-/**
- * Poll a frame from the filter chain.
- *
- * @param  link the input link
- * @return the number of immediately available frames, a negative
- * number in case of error
- */
-int avfilter_poll_frame(AVFilterLink *link);
-
-/**
- * Notifie the next filter of the start of a frame.
- *
- * @param link   the output link the frame will be sent over
- * @param picref A reference to the frame about to be sent. The data for this
- *               frame need only be valid once draw_slice() is called for that
- *               portion. The receiving filter will free this reference when
- *               it no longer needs it.
- */
-void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/**
- * Notifie the next filter that the current frame has finished.
- *
- * @param link the output link the frame was sent over
- */
-void avfilter_end_frame(AVFilterLink *link);
-
-/**
- * Send a slice to the next filter.
- *
- * Slices have to be provided in sequential order, either in
- * top-bottom or bottom-top order. If slices are provided in
- * non-sequential order the behavior of the function is undefined.
- *
- * @param link the output link over which the frame is being sent
- * @param y    offset in pixels from the top of the image for this slice
- * @param h    height of this slice in pixels
- * @param slice_dir the assumed direction for sending slices,
- *             from the top slice to the bottom slice if the value is 1,
- *             from the bottom slice to the top slice if the value is -1,
- *             for other values the behavior of the function is undefined.
- */
-void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
-
-/**
- * Send a buffer of audio samples to the next filter.
- *
- * @param link       the output link over which the audio samples are being sent
- * @param samplesref a reference to the buffer of audio samples being sent. The
- *                   receiving filter will free this reference when it no longer
- *                   needs it or pass it on to the next filter.
- */
-void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
-/** Initialize the filter system. Register all builtin filters. */
-void avfilter_register_all(void);
-
-/** Uninitialize the filter system. Unregister all filters. */
-void avfilter_uninit(void);
-
-/**
- * Register a filter. This is only needed if you plan to use
- * avfilter_get_by_name later to lookup the AVFilter structure by name. A
- * filter can still by instantiated with avfilter_open even if it is not
- * registered.
- *
- * @param filter the filter to register
- * @return 0 if the registration was succesfull, a negative value
- * otherwise
- */
-int avfilter_register(AVFilter *filter);
-
-/**
- * Get a filter definition matching the given name.
- *
- * @param name the filter name to find
- * @return     the filter definition, if any matching one is registered.
- *             NULL if none found.
- */
-AVFilter *avfilter_get_by_name(const char *name);
-
-/**
- * If filter is NULL, returns a pointer to the first registered filter pointer,
- * if filter is non-NULL, returns the next pointer after filter.
- * If the returned pointer points to NULL, the last registered filter
- * was already reached.
- */
-AVFilter **av_filter_next(AVFilter **filter);
-
-/**
- * Create a filter instance.
- *
- * @param filter_ctx put here a pointer to the created filter context
- * on success, NULL on failure
- * @param filter    the filter to create an instance of
- * @param inst_name Name to give to the new instance. Can be NULL for none.
- * @return >= 0 in case of success, a negative error code otherwise
- */
-int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
-
-/**
- * Initialize a filter.
- *
- * @param filter the filter to initialize
- * @param args   A string of parameters to use when initializing the filter.
- *               The format and meaning of this string varies by filter.
- * @param opaque Any extra non-string data needed by the filter. The meaning
- *               of this parameter varies by filter.
- * @return       zero on success
- */
-int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque);
-
-/**
- * Free a filter context.
- *
- * @param filter the filter to free
- */
-void avfilter_free(AVFilterContext *filter);
-
-/**
- * Insert a filter in the middle of an existing link.
- *
- * @param link the link into which the filter should be inserted
- * @param filt the filter to be inserted
- * @param filt_srcpad_idx the input pad on the filter to connect
- * @param filt_dstpad_idx the output pad on the filter to connect
- * @return     zero on success
- */
-int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
-                           unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
-
-/**
- * Insert a new pad.
- *
- * @param idx Insertion point. Pad is inserted at the end if this point
- *            is beyond the end of the list of pads.
- * @param count Pointer to the number of pads in the list
- * @param padidx_off Offset within an AVFilterLink structure to the element
- *                   to increment when inserting a new pad causes link
- *                   numbering to change
- * @param pads Pointer to the pointer to the beginning of the list of pads
- * @param links Pointer to the pointer to the beginning of the list of links
- * @param newpad The new pad to add. A copy is made when adding.
- */
-void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
-                         AVFilterPad **pads, AVFilterLink ***links,
-                         AVFilterPad *newpad);
-
-/** Insert a new input pad for the filter. */
-static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
-                                         AVFilterPad *p)
-{
-    avfilter_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad),
-                        &f->input_pads, &f->inputs, p);
-}
-
-/** Insert a new output pad for the filter. */
-static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
-                                          AVFilterPad *p)
-{
-    avfilter_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
-                        &f->output_pads, &f->outputs, p);
-}
-
-#endif /* AVFILTER_AVFILTER_H */
diff --git a/ffmpeg 0.7/include/libavfilter/avfiltergraph.h b/ffmpeg 0.7/include/libavfilter/avfiltergraph.h
deleted file mode 100644 (file)
index 8013b46..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Filter graphs
- * copyright (c) 2007 Bobby Bingham
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_AVFILTERGRAPH_H
-#define AVFILTER_AVFILTERGRAPH_H
-
-#include "avfilter.h"
-
-typedef struct AVFilterGraph {
-    unsigned filter_count;
-    AVFilterContext **filters;
-
-    char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
-} AVFilterGraph;
-
-/**
- * Allocate a filter graph.
- */
-AVFilterGraph *avfilter_graph_alloc(void);
-
-/**
- * Get a filter instance with name name from graph.
- *
- * @return the pointer to the found filter instance or NULL if it
- * cannot be found.
- */
-AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name);
-
-/**
- * Add an existing filter instance to a filter graph.
- *
- * @param graphctx  the filter graph
- * @param filter the filter to be added
- */
-int avfilter_graph_add_filter(AVFilterGraph *graphctx, AVFilterContext *filter);
-
-/**
- * Create and add a filter instance into an existing graph.
- * The filter instance is created from the filter filt and inited
- * with the parameters args and opaque.
- *
- * In case of success put in *filt_ctx the pointer to the created
- * filter instance, otherwise set *filt_ctx to NULL.
- *
- * @param name the instance name to give to the created filter instance
- * @param graph_ctx the filter graph
- * @return a negative AVERROR error code in case of failure, a non
- * negative value otherwise
- */
-int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt,
-                                 const char *name, const char *args, void *opaque,
-                                 AVFilterGraph *graph_ctx);
-
-/**
- * Check validity and configure all the links and formats in the graph.
- *
- * @param graphctx the filter graph
- * @param log_ctx context used for logging
- * @return 0 in case of success, a negative AVERROR code otherwise
- */
-int avfilter_graph_config(AVFilterGraph *graphctx, AVClass *log_ctx);
-
-/**
- * Free a graph, destroy its links, and set *graph to NULL.
- * If *graph is NULL, do nothing.
- */
-void avfilter_graph_free(AVFilterGraph **graph);
-
-/**
- * A linked-list of the inputs/outputs of the filter chain.
- *
- * This is mainly useful for avfilter_graph_parse(), since this
- * function may accept a description of a graph with not connected
- * input/output pads. This struct specifies, per each not connected
- * pad contained in the graph, the filter context and the pad index
- * required for establishing a link.
- */
-typedef struct AVFilterInOut {
-    /** unique name for this input/output in the list */
-    char *name;
-
-    /** filter context associated to this input/output */
-    AVFilterContext *filter_ctx;
-
-    /** index of the filt_ctx pad to use for linking */
-    int pad_idx;
-
-    /** next input/input in the list, NULL if this is the last */
-    struct AVFilterInOut *next;
-} AVFilterInOut;
-
-/**
- * Add a graph described by a string to a graph.
- *
- * @param graph   the filter graph where to link the parsed graph context
- * @param filters string to be parsed
- * @param inputs  linked list to the inputs of the graph
- * @param outputs linked list to the outputs of the graph
- * @return zero on success, a negative AVERROR code on error
- */
-int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
-                         AVFilterInOut *inputs, AVFilterInOut *outputs,
-                         AVClass *log_ctx);
-
-#endif /* AVFILTER_AVFILTERGRAPH_H */
diff --git a/ffmpeg 0.7/include/libavfilter/vsrc_buffer.h b/ffmpeg 0.7/include/libavfilter/vsrc_buffer.h
deleted file mode 100644 (file)
index b661d41..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2008 Vitor Sessak
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_VSRC_BUFFER_H
-#define AVFILTER_VSRC_BUFFER_H
-
-/**
- * @file
- * memory buffer source API for video
- */
-
-#include "avfilter.h"
-
-/**
- * Tell av_vsrc_buffer_add_video_buffer_ref() to overwrite the already
- * cached video buffer with the new added one, otherwise the function
- * will complain and exit.
- */
-#define AV_VSRC_BUF_FLAG_OVERWRITE 1
-
-/**
- * Add video buffer data in picref to buffer_src.
- *
- * @param buffer_src pointer to a buffer source context
- * @param flags a combination of AV_VSRC_BUF_FLAG_* flags
- * @return >= 0 in case of success, a negative AVERROR code in case of
- * failure
- */
-int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_src,
-                                        AVFilterBufferRef *picref, int flags);
-
-#endif /* AVFILTER_VSRC_BUFFER_H */
diff --git a/ffmpeg 0.7/include/libavformat/avformat.h b/ffmpeg 0.7/include/libavformat/avformat.h
deleted file mode 100644 (file)
index f00fce4..0000000
+++ /dev/null
@@ -1,1557 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVFORMAT_H
-#define AVFORMAT_AVFORMAT_H
-
-
-/**
- * Return the LIBAVFORMAT_VERSION_INT constant.
- */
-unsigned avformat_version(void);
-
-/**
- * Return the libavformat build-time configuration.
- */
-const char *avformat_configuration(void);
-
-/**
- * Return the libavformat license.
- */
-const char *avformat_license(void);
-
-#include <time.h>
-#include <stdio.h>  /* FILE */
-#include "libavcodec/avcodec.h"
-#include "libavutil/dict.h"
-
-#include "avio.h"
-#include "libavformat/version.h"
-
-struct AVFormatContext;
-
-
-/*
- * Public Metadata API.
- * The metadata API allows libavformat to export metadata tags to a client
- * application using a sequence of key/value pairs. Like all strings in FFmpeg,
- * metadata must be stored as UTF-8 encoded Unicode. Note that metadata
- * exported by demuxers isn't checked to be valid UTF-8 in most cases.
- * Important concepts to keep in mind:
- * 1. Keys are unique; there can never be 2 tags with the same key. This is
- *    also meant semantically, i.e., a demuxer should not knowingly produce
- *    several keys that are literally different but semantically identical.
- *    E.g., key=Author5, key=Author6. In this example, all authors must be
- *    placed in the same tag.
- * 2. Metadata is flat, not hierarchical; there are no subtags. If you
- *    want to store, e.g., the email address of the child of producer Alice
- *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
- * 3. Several modifiers can be applied to the tag name. This is done by
- *    appending a dash character ('-') and the modifier name in the order
- *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
- *    a) language -- a tag whose value is localized for a particular language
- *       is appended with the ISO 639-2/B 3-letter language code.
- *       For example: Author-ger=Michael, Author-eng=Mike
- *       The original/default language is in the unqualified "Author" tag.
- *       A demuxer should set a default if it sets any translated tag.
- *    b) sorting  -- a modified version of a tag that should be used for
- *       sorting will have '-sort' appended. E.g. artist="The Beatles",
- *       artist-sort="Beatles, The".
- *
- * 4. Demuxers attempt to export metadata in a generic format, however tags
- *    with no generic equivalents are left as they are stored in the container.
- *    Follows a list of generic tag names:
- *
- * album        -- name of the set this work belongs to
- * album_artist -- main creator of the set/album, if different from artist.
- *                 e.g. "Various Artists" for compilation albums.
- * artist       -- main creator of the work
- * comment      -- any additional description of the file.
- * composer     -- who composed the work, if different from artist.
- * copyright    -- name of copyright holder.
- * creation_time-- date when the file was created, preferably in ISO 8601.
- * date         -- date when the work was created, preferably in ISO 8601.
- * disc         -- number of a subset, e.g. disc in a multi-disc collection.
- * encoder      -- name/settings of the software/hardware that produced the file.
- * encoded_by   -- person/group who created the file.
- * filename     -- original name of the file.
- * genre        -- <self-evident>.
- * language     -- main language in which the work is performed, preferably
- *                 in ISO 639-2 format. Multiple languages can be specified by
- *                 separating them with commas.
- * performer    -- artist who performed the work, if different from artist.
- *                 E.g for "Also sprach Zarathustra", artist would be "Richard
- *                 Strauss" and performer "London Philharmonic Orchestra".
- * publisher    -- name of the label/publisher.
- * service_name     -- name of the service in broadcasting (channel name).
- * service_provider -- name of the service provider in broadcasting.
- * title        -- name of the work.
- * track        -- number of this work in the set, can be in form current/total.
- * variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
- */
-
-#if FF_API_OLD_METADATA2
-/**
- * @defgroup old_metadata Old metadata API
- * The following functions are deprecated, use
- * their equivalents from libavutil/dict.h instead.
- * @{
- */
-
-#define AV_METADATA_MATCH_CASE      AV_DICT_MATCH_CASE
-#define AV_METADATA_IGNORE_SUFFIX   AV_DICT_IGNORE_SUFFIX
-#define AV_METADATA_DONT_STRDUP_KEY AV_DICT_DONT_STRDUP_KEY
-#define AV_METADATA_DONT_STRDUP_VAL AV_DICT_DONT_STRDUP_VAL
-#define AV_METADATA_DONT_OVERWRITE  AV_DICT_DONT_OVERWRITE
-
-typedef attribute_deprecated AVDictionary AVMetadata;
-typedef attribute_deprecated AVDictionaryEntry  AVMetadataTag;
-
-typedef struct AVMetadataConv AVMetadataConv;
-
-/**
- * Get a metadata element with matching key.
- *
- * @param prev Set to the previous matching element to find the next.
- *             If set to NULL the first matching element is returned.
- * @param flags Allows case as well as suffix-insensitive comparisons.
- * @return Found tag or NULL, changing key or value leads to undefined behavior.
- */
-attribute_deprecated AVDictionaryEntry *
-av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
-
-/**
- * Set the given tag in *pm, overwriting an existing tag.
- *
- * @param pm pointer to a pointer to a metadata struct. If *pm is NULL
- * a metadata struct is allocated and put in *pm.
- * @param key tag key to add to *pm (will be av_strduped depending on flags)
- * @param value tag value to add to *pm (will be av_strduped depending on flags).
- *        Passing a NULL value will cause an existing tag to be deleted.
- * @return >= 0 on success otherwise an error code <0
- */
-attribute_deprecated int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags);
-
-/**
- * This function is provided for compatibility reason and currently does nothing.
- */
-attribute_deprecated void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv,
-                                                                        const AVMetadataConv *s_conv);
-
-/**
- * Copy metadata from one AVDictionary struct into another.
- * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
- *            this function will allocate a struct for you and put it in *dst
- * @param src pointer to source AVDictionary struct
- * @param flags flags to use when setting metadata in *dst
- * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
- */
-attribute_deprecated void av_metadata_copy(AVDictionary **dst, AVDictionary *src, int flags);
-
-/**
- * Free all the memory allocated for an AVDictionary struct.
- */
-attribute_deprecated void av_metadata_free(AVDictionary **m);
-/**
- * @}
- */
-#endif
-
-
-/* packet functions */
-
-
-/**
- * Allocate and read the payload of a packet and initialize its
- * fields with default values.
- *
- * @param pkt packet
- * @param size desired payload size
- * @return >0 (read size) if OK, AVERROR_xxx otherwise
- */
-int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
-
-
-/**
- * Read data and append it to the current content of the AVPacket.
- * If pkt->size is 0 this is identical to av_get_packet.
- * Note that this uses av_grow_packet and thus involves a realloc
- * which is inefficient. Thus this function should only be used
- * when there is no reasonable way to know (an upper bound of)
- * the final size.
- *
- * @param pkt packet
- * @param size amount of data to read
- * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
- *         will not be lost even if an error occurs.
- */
-int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
-
-/*************************************************/
-/* fractional numbers for exact pts handling */
-
-/**
- * The exact value of the fractional number is: 'val + num / den'.
- * num is assumed to be 0 <= num < den.
- */
-typedef struct AVFrac {
-    int64_t val, num, den;
-} AVFrac;
-
-/*************************************************/
-/* input/output formats */
-
-struct AVCodecTag;
-
-/**
- * This structure contains the data a format has to probe a file.
- */
-typedef struct AVProbeData {
-    const char *filename;
-    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
-    int buf_size;       /**< Size of buf except extra allocated bytes */
-} AVProbeData;
-
-#define AVPROBE_SCORE_MAX 100               ///< maximum score, half of that is used for file-extension-based detection
-#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
-
-typedef struct AVFormatParameters {
-#if FF_API_FORMAT_PARAMETERS
-    attribute_deprecated AVRational time_base;
-    attribute_deprecated int sample_rate;
-    attribute_deprecated int channels;
-    attribute_deprecated int width;
-    attribute_deprecated int height;
-    attribute_deprecated enum PixelFormat pix_fmt;
-    attribute_deprecated int channel; /**< Used to select DV channel. */
-    attribute_deprecated const char *standard; /**< deprecated, use demuxer-specific options instead. */
-    attribute_deprecated unsigned int mpeg2ts_raw:1;  /**< deprecated, use mpegtsraw demuxer */
-    /**< deprecated, use mpegtsraw demuxer-specific options instead */
-    attribute_deprecated unsigned int mpeg2ts_compute_pcr:1;
-    attribute_deprecated unsigned int initial_pause:1;       /**< Do not begin to play the stream
-                                                                  immediately (RTSP only). */
-#endif
-    unsigned int prealloced_context:1;
-} AVFormatParameters;
-
-//! Demuxer will use avio_open, no opened file should be provided by the caller.
-#define AVFMT_NOFILE        0x0001
-#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
-#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
-#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
-                                      raw picture data. */
-#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
-#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
-#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
-#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */
-#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
-#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
-#define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
-#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fallback to binary search via read_timestamp */
-#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fallback to generic search */
-#define AVFMT_TS_NONSTRICT  0x8000 /**< Format does not require strictly
-                                          increasing timestamps, but they must
-                                          still be monotonic */
-
-typedef struct AVOutputFormat {
-    const char *name;
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-    const char *mime_type;
-    const char *extensions; /**< comma-separated filename extensions */
-    /**
-     * size of private data so that it can be allocated in the wrapper
-     */
-    int priv_data_size;
-    /* output support */
-    enum CodecID audio_codec; /**< default audio codec */
-    enum CodecID video_codec; /**< default video codec */
-    int (*write_header)(struct AVFormatContext *);
-    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
-    int (*write_trailer)(struct AVFormatContext *);
-    /**
-     * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
-     * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
-     * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS
-     */
-    int flags;
-
-    void *dummy;
-
-    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
-                             AVPacket *in, int flush);
-
-    /**
-     * List of supported codec_id-codec_tag pairs, ordered by "better
-     * choice first". The arrays are all terminated by CODEC_ID_NONE.
-     */
-    const struct AVCodecTag * const *codec_tag;
-
-    enum CodecID subtitle_codec; /**< default subtitle codec */
-
-#if FF_API_OLD_METADATA2
-    const AVMetadataConv *metadata_conv;
-#endif
-
-    const AVClass *priv_class; ///< AVClass for the private context
-
-    /* private fields */
-    struct AVOutputFormat *next;
-} AVOutputFormat;
-
-typedef struct AVInputFormat {
-    /**
-     * A comma separated list of short names for the format. New names
-     * may be appended with a minor bump.
-     */
-    const char *name;
-
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-
-    /**
-     * Size of private data so that it can be allocated in the wrapper.
-     */
-    int priv_data_size;
-
-    /**
-     * Tell if a given file has a chance of being parsed as this format.
-     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
-     * big so you do not have to check for that unless you need more.
-     */
-    int (*read_probe)(AVProbeData *);
-
-    /**
-     * Read the format header and initialize the AVFormatContext
-     * structure. Return 0 if OK. 'ap' if non-NULL contains
-     * additional parameters. Only used in raw format right
-     * now. 'av_new_stream' should be called to create new streams.
-     */
-    int (*read_header)(struct AVFormatContext *,
-                       AVFormatParameters *ap);
-
-    /**
-     * Read one packet and put it in 'pkt'. pts and flags are also
-     * set. 'av_new_stream' can be called only if the flag
-     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
-     * background thread).
-     * @return 0 on success, < 0 on error.
-     *         When returning an error, pkt must not have been allocated
-     *         or must be freed before returning
-     */
-    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
-
-    /**
-     * Close the stream. The AVFormatContext and AVStreams are not
-     * freed by this function
-     */
-    int (*read_close)(struct AVFormatContext *);
-
-#if FF_API_READ_SEEK
-    /**
-     * Seek to a given timestamp relative to the frames in
-     * stream component stream_index.
-     * @param stream_index Must not be -1.
-     * @param flags Selects which direction should be preferred if no exact
-     *              match is available.
-     * @return >= 0 on success (but not necessarily the new offset)
-     */
-    attribute_deprecated int (*read_seek)(struct AVFormatContext *,
-                                          int stream_index, int64_t timestamp, int flags);
-#endif
-    /**
-     * Gets the next timestamp in stream[stream_index].time_base units.
-     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
-     */
-    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
-                              int64_t *pos, int64_t pos_limit);
-
-    /**
-     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER.
-     */
-    int flags;
-
-    /**
-     * If extensions are defined, then no probe is done. You should
-     * usually not use extension format guessing because it is not
-     * reliable enough
-     */
-    const char *extensions;
-
-    /**
-     * General purpose read-only value that the format can use.
-     */
-    int value;
-
-    /**
-     * Start/resume playing - only meaningful if using a network-based format
-     * (RTSP).
-     */
-    int (*read_play)(struct AVFormatContext *);
-
-    /**
-     * Pause playing - only meaningful if using a network-based format
-     * (RTSP).
-     */
-    int (*read_pause)(struct AVFormatContext *);
-
-    const struct AVCodecTag * const *codec_tag;
-
-    /**
-     * Seek to timestamp ts.
-     * Seeking will be done so that the point from which all active streams
-     * can be presented successfully will be closest to ts and within min/max_ts.
-     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
-     */
-    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
-#if FF_API_OLD_METADATA2
-    const AVMetadataConv *metadata_conv;
-#endif
-
-    const AVClass *priv_class; ///< AVClass for the private context
-
-    /* private fields */
-    struct AVInputFormat *next;
-} AVInputFormat;
-
-enum AVStreamParseType {
-    AVSTREAM_PARSE_NONE,
-    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
-    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
-    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
-    AVSTREAM_PARSE_FULL_ONCE,  /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
-};
-
-typedef struct AVIndexEntry {
-    int64_t pos;
-    int64_t timestamp;
-#define AVINDEX_KEYFRAME 0x0001
-    int flags:2;
-    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
-    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
-} AVIndexEntry;
-
-#define AV_DISPOSITION_DEFAULT   0x0001
-#define AV_DISPOSITION_DUB       0x0002
-#define AV_DISPOSITION_ORIGINAL  0x0004
-#define AV_DISPOSITION_COMMENT   0x0008
-#define AV_DISPOSITION_LYRICS    0x0010
-#define AV_DISPOSITION_KARAOKE   0x0020
-
-/**
- * Track should be used during playback by default.
- * Useful for subtitle track that should be displayed
- * even when user did not explicitly ask for subtitles.
- */
-#define AV_DISPOSITION_FORCED    0x0040
-#define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
-#define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
-#define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
-
-/**
- * Stream structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVStream) must not be used outside libav*.
- */
-typedef struct AVStream {
-    int index;    /**< stream index in AVFormatContext */
-    int id;       /**< format-specific stream ID */
-    AVCodecContext *codec; /**< codec context */
-    /**
-     * Real base framerate of the stream.
-     * This is the lowest framerate with which all timestamps can be
-     * represented accurately (it is the least common multiple of all
-     * framerates in the stream). Note, this value is just a guess!
-     * For example, if the time base is 1/90000 and all frames have either
-     * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
-     */
-    AVRational r_frame_rate;
-    void *priv_data;
-
-    /* internal data used in av_find_stream_info() */
-    int64_t first_dts;
-
-    /**
-     * encoding: pts generation when outputting stream
-     */
-    struct AVFrac pts;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * time base should be 1/framerate and timestamp increments should be 1.
-     * decoding: set by libavformat
-     * encoding: set by libavformat in av_write_header
-     */
-    AVRational time_base;
-    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-    /* ffmpeg.c private use */
-    int stream_copy; /**< If set, just copy stream. */
-    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
-
-    //FIXME move stuff to a flags field?
-    /**
-     * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.
-     * MN: dunno if that is the right place for it
-     */
-    float quality;
-
-    /**
-     * Decoding: pts of the first frame of the stream, in stream time base.
-     * Only set this if you are absolutely 100% sure that the value you set
-     * it to really is the pts of the first frame.
-     * This may be undefined (AV_NOPTS_VALUE).
-     * @note The ASF header does NOT contain a correct start_time the ASF
-     * demuxer must NOT set this.
-     */
-    int64_t start_time;
-
-    /**
-     * Decoding: duration of the stream, in stream time base.
-     * If a source file does not specify a duration, but does specify
-     * a bitrate, this value will be estimated from bitrate and file size.
-     */
-    int64_t duration;
-
-    /* av_read_frame() support */
-    enum AVStreamParseType need_parsing;
-    struct AVCodecParserContext *parser;
-
-    int64_t cur_dts;
-    int last_IP_duration;
-    int64_t last_IP_pts;
-    /* av_seek_frame() support */
-    AVIndexEntry *index_entries; /**< Only used if the format does not
-                                    support seeking natively. */
-    int nb_index_entries;
-    unsigned int index_entries_allocated_size;
-
-    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
-
-    int disposition; /**< AV_DISPOSITION_* bit field */
-
-    AVProbeData probe_data;
-#define MAX_REORDER_DELAY 16
-    int64_t pts_buffer[MAX_REORDER_DELAY+1];
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * - encoding: Set by user.
-     * - decoding: Set by libavformat.
-     */
-    AVRational sample_aspect_ratio;
-
-    AVDictionary *metadata;
-
-    /* Intended mostly for av_read_frame() support. Not supposed to be used by */
-    /* external applications; try to use something else if at all possible.    */
-    const uint8_t *cur_ptr;
-    int cur_len;
-    AVPacket cur_pkt;
-
-    // Timestamp generation support:
-    /**
-     * Timestamp corresponding to the last dts sync point.
-     *
-     * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
-     * a DTS is received from the underlying container. Otherwise set to
-     * AV_NOPTS_VALUE by default.
-     */
-    int64_t reference_dts;
-
-    /**
-     * Number of packets to buffer for codec probing
-     * NOT PART OF PUBLIC API
-     */
-#define MAX_PROBE_PACKETS 2500
-    int probe_packets;
-
-    /**
-     * last packet in packet_buffer for this stream when muxing.
-     * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
-     */
-    struct AVPacketList *last_in_packet_buffer;
-
-    /**
-     * Average framerate
-     */
-    AVRational avg_frame_rate;
-
-    /**
-     * Number of frames that have been demuxed during av_find_stream_info()
-     */
-    int codec_info_nb_frames;
-
-    /**
-     * Stream Identifier
-     * This is the MPEG-TS stream identifier +1
-     * 0 means unknown
-     */
-    int stream_identifier;
-
-    /**
-     * Stream informations used internally by av_find_stream_info()
-     */
-#define MAX_STD_TIMEBASES (60*12+5)
-    struct {
-        int64_t last_dts;
-        int64_t duration_gcd;
-        int duration_count;
-        double duration_error[MAX_STD_TIMEBASES];
-        int64_t codec_info_duration;
-    } *info;
-
-    /**
-     * flag to indicate that probing is requested
-     * NOT PART OF PUBLIC API
-     */
-    int request_probe;
-} AVStream;
-
-#define AV_PROGRAM_RUNNING 1
-
-/**
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVProgram) must not be used outside libav*.
- */
-typedef struct AVProgram {
-    int            id;
-    int            flags;
-    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
-    unsigned int   *stream_index;
-    unsigned int   nb_stream_indexes;
-    AVDictionary *metadata;
-
-    int program_num;
-    int pmt_pid;
-    int pcr_pid;
-} AVProgram;
-
-#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
-                                         (streams are added dynamically) */
-
-typedef struct AVChapter {
-    int id;                 ///< unique ID to identify the chapter
-    AVRational time_base;   ///< time base in which the start/end timestamps are specified
-    int64_t start, end;     ///< chapter start/end time in time_base units
-    AVDictionary *metadata;
-} AVChapter;
-
-/**
- * Format I/O context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVFormatContext) must not be used outside libav*.
- */
-typedef struct AVFormatContext {
-    const AVClass *av_class; /**< Set by avformat_alloc_context. */
-    /* Can only be iformat or oformat, not both at the same time. */
-    struct AVInputFormat *iformat;
-    struct AVOutputFormat *oformat;
-    void *priv_data;
-    AVIOContext *pb;
-    unsigned int nb_streams;
-    AVStream **streams;
-    char filename[1024]; /**< input or output filename */
-    /* stream info */
-    int64_t timestamp;
-
-    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
-    /* private data for pts handling (do not modify directly). */
-    /**
-     * This buffer is only needed when packets were already buffered but
-     * not decoded, for example to get the codec parameters in MPEG
-     * streams.
-     */
-    struct AVPacketList *packet_buffer;
-
-    /**
-     * Decoding: position of the first frame of the component, in
-     * AV_TIME_BASE fractional seconds. NEVER set this value directly:
-     * It is deduced from the AVStream values.
-     */
-    int64_t start_time;
-
-    /**
-     * Decoding: duration of the stream, in AV_TIME_BASE fractional
-     * seconds. Only set this value if you know none of the individual stream
-     * durations and also dont set any of them. This is deduced from the
-     * AVStream values if not set.
-     */
-    int64_t duration;
-
-    /**
-     * decoding: total file size, 0 if unknown
-     */
-    int64_t file_size;
-
-    /**
-     * Decoding: total stream bitrate in bit/s, 0 if not
-     * available. Never set it directly if the file_size and the
-     * duration are known as FFmpeg can compute it automatically.
-     */
-    int bit_rate;
-
-    /* av_read_frame() support */
-    AVStream *cur_st;
-
-    /* av_seek_frame() support */
-    int64_t data_offset; /**< offset of the first packet */
-
-    int mux_rate;
-    unsigned int packet_size;
-    int preload;
-    int max_delay;
-
-#define AVFMT_NOOUTPUTLOOP -1
-#define AVFMT_INFINITEOUTPUTLOOP 0
-    /**
-     * number of times to loop output in formats that support it
-     */
-    int loop_output;
-
-    int flags;
-#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
-#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
-#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
-#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
-#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
-#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
-#if FF_API_FLAG_RTP_HINT
-#define AVFMT_FLAG_RTP_HINT     0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead
-#endif
-#define AVFMT_FLAG_MP4A_LATM    0x0080 ///< Enable RTP MP4A-LATM payload
-#define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
-#define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
-#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Dont merge side data but keep it seperate.
-    int loop_input;
-
-    /**
-     * decoding: size of data to probe; encoding: unused.
-     */
-    unsigned int probesize;
-
-    /**
-     * Maximum time (in AV_TIME_BASE units) during which the input should
-     * be analyzed in av_find_stream_info().
-     */
-    int max_analyze_duration;
-
-    const uint8_t *key;
-    int keylen;
-
-    unsigned int nb_programs;
-    AVProgram **programs;
-
-    /**
-     * Forced video codec_id.
-     * Demuxing: Set by user.
-     */
-    enum CodecID video_codec_id;
-
-    /**
-     * Forced audio codec_id.
-     * Demuxing: Set by user.
-     */
-    enum CodecID audio_codec_id;
-
-    /**
-     * Forced subtitle codec_id.
-     * Demuxing: Set by user.
-     */
-    enum CodecID subtitle_codec_id;
-
-    /**
-     * Maximum amount of memory in bytes to use for the index of each stream.
-     * If the index exceeds this size, entries will be discarded as
-     * needed to maintain a smaller size. This can lead to slower or less
-     * accurate seeking (depends on demuxer).
-     * Demuxers for which a full in-memory index is mandatory will ignore
-     * this.
-     * muxing  : unused
-     * demuxing: set by user
-     */
-    unsigned int max_index_size;
-
-    /**
-     * Maximum amount of memory in bytes to use for buffering frames
-     * obtained from realtime capture devices.
-     */
-    unsigned int max_picture_buffer;
-
-    unsigned int nb_chapters;
-    AVChapter **chapters;
-
-    /**
-     * Flags to enable debugging.
-     */
-    int debug;
-#define FF_FDEBUG_TS        0x0001
-
-    /**
-     * Raw packets from the demuxer, prior to parsing and decoding.
-     * This buffer is used for buffering packets until the codec can
-     * be identified, as parsing cannot be done without knowing the
-     * codec.
-     */
-    struct AVPacketList *raw_packet_buffer;
-    struct AVPacketList *raw_packet_buffer_end;
-
-    struct AVPacketList *packet_buffer_end;
-
-    AVDictionary *metadata;
-
-    /**
-     * Remaining size available for raw_packet_buffer, in bytes.
-     * NOT PART OF PUBLIC API
-     */
-#define RAW_PACKET_BUFFER_SIZE 2500000
-    int raw_packet_buffer_remaining_size;
-
-    /**
-     * Start time of the stream in real world time, in microseconds
-     * since the unix epoch (00:00 1st January 1970). That is, pts=0
-     * in the stream was captured at this real world time.
-     * - encoding: Set by user.
-     * - decoding: Unused.
-     */
-    int64_t start_time_realtime;
-
-    /**
-     * decoding: number of frames used to probe fps
-     */
-    int fps_probe_size;
-
-    /**
-     * Transport stream id.
-     * This will be moved into demuxer private options. Thus no API/ABI compatibility
-     */
-    int ts_id;
-} AVFormatContext;
-
-typedef struct AVPacketList {
-    AVPacket pkt;
-    struct AVPacketList *next;
-} AVPacketList;
-
-/**
- * If f is NULL, returns the first registered input format,
- * if f is non-NULL, returns the next registered input format after f
- * or NULL if f is the last one.
- */
-AVInputFormat  *av_iformat_next(AVInputFormat  *f);
-
-/**
- * If f is NULL, returns the first registered output format,
- * if f is non-NULL, returns the next registered output format after f
- * or NULL if f is the last one.
- */
-AVOutputFormat *av_oformat_next(AVOutputFormat *f);
-
-#if FF_API_GUESS_IMG2_CODEC
-attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename);
-#endif
-
-/* XXX: Use automatic init with either ELF sections or C file parser */
-/* modules. */
-
-/* utils.c */
-void av_register_input_format(AVInputFormat *format);
-void av_register_output_format(AVOutputFormat *format);
-
-/**
- * Return the output format in the list of registered output formats
- * which best matches the provided parameters, or return NULL if
- * there is no match.
- *
- * @param short_name if non-NULL checks if short_name matches with the
- * names of the registered formats
- * @param filename if non-NULL checks if filename terminates with the
- * extensions of the registered formats
- * @param mime_type if non-NULL checks if mime_type matches with the
- * MIME type of the registered formats
- */
-AVOutputFormat *av_guess_format(const char *short_name,
-                                const char *filename,
-                                const char *mime_type);
-
-/**
- * Guess the codec ID based upon muxer and filename.
- */
-enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
-                            const char *filename, const char *mime_type,
-                            enum AVMediaType type);
-
-/**
- * Send a nice hexadecimal dump of a buffer to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
- */
-void av_hex_dump(FILE *f, uint8_t *buf, int size);
-
-/**
- * Send a nice hexadecimal dump of a buffer to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
- */
-void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
-
-/**
- * Send a nice dump of a packet to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- * @param st AVStream that the packet belongs to
- */
-void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
-
-
-/**
- * Send a nice dump of a packet to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- * @param st AVStream that the packet belongs to
- */
-void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
-                      AVStream *st);
-
-#if FF_API_PKT_DUMP
-attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
-attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt,
-                                          int dump_payload);
-#endif
-
-/**
- * Initialize libavformat and register all the muxers, demuxers and
- * protocols. If you do not call this function, then you can select
- * exactly which formats you want to support.
- *
- * @see av_register_input_format()
- * @see av_register_output_format()
- * @see av_register_protocol()
- */
-void av_register_all(void);
-
-/**
- * Get the CodecID for the given codec tag tag.
- * If no codec id is found returns CODEC_ID_NONE.
- *
- * @param tags list of supported codec_id-codec_tag pairs, as stored
- * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
- */
-enum CodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
-
-/**
- * Get the codec tag for the given codec id id.
- * If no codec tag is found returns 0.
- *
- * @param tags list of supported codec_id-codec_tag pairs, as stored
- * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
- */
-unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum CodecID id);
-
-/* media file input */
-
-/**
- * Find AVInputFormat based on the short name of the input format.
- */
-AVInputFormat *av_find_input_format(const char *short_name);
-
-/**
- * Guess the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- */
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
-
-/**
- * Guess the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- * @param score_max A probe score larger that this is required to accept a
- *                  detection, the variable is set to the actual detection
- *                  score afterwards.
- *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
- *                  to retry with a larger probe buffer.
- */
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
-
-/**
- * Guess the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- * @param score_ret The score of the best detection.
- */
-AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret);
-
-/**
- * Probe a bytestream to determine the input format. Each time a probe returns
- * with a score that is too low, the probe buffer size is increased and another
- * attempt is made. When the maximum probe size is reached, the input format
- * with the highest score is returned.
- *
- * @param pb the bytestream to probe
- * @param fmt the input format is put here
- * @param filename the filename of the stream
- * @param logctx the log context
- * @param offset the offset within the bytestream to probe from
- * @param max_probe_size the maximum probe buffer size (zero for default)
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
-                          const char *filename, void *logctx,
-                          unsigned int offset, unsigned int max_probe_size);
-
-/**
- * Allocate all the structures needed to read an input stream.
- *        This does not open the needed codecs for decoding the stream[s].
- */
-int av_open_input_stream(AVFormatContext **ic_ptr,
-                         AVIOContext *pb, const char *filename,
-                         AVInputFormat *fmt, AVFormatParameters *ap);
-
-/**
- * Open a media file as input. The codecs are not opened. Only the file
- * header (if present) is read.
- *
- * @param ic_ptr The opened media file handle is put here.
- * @param filename filename to open
- * @param fmt If non-NULL, force the file format to use.
- * @param buf_size optional buffer size (zero if default is OK)
- * @param ap Additional parameters needed when opening the file
- *           (NULL if default).
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
-                       AVInputFormat *fmt,
-                       int buf_size,
-                       AVFormatParameters *ap);
-
-int av_demuxer_open(AVFormatContext *ic, AVFormatParameters *ap);
-
-/**
- * Allocate an AVFormatContext.
- * avformat_free_context() can be used to free the context and everything
- * allocated by the framework within it.
- */
-AVFormatContext *avformat_alloc_context(void);
-
-#if FF_API_ALLOC_OUTPUT_CONTEXT
-/**
- * @deprecated deprecated in favor of avformat_alloc_output_context2()
- */
-attribute_deprecated
-AVFormatContext *avformat_alloc_output_context(const char *format,
-                                               AVOutputFormat *oformat,
-                                               const char *filename);
-#endif
-
-/**
- * Allocate an AVFormatContext for an output format.
- * avformat_free_context() can be used to free the context and
- * everything allocated by the framework within it.
- *
- * @param *ctx is set to the created format context, or to NULL in
- * case of failure
- * @param oformat format to use for allocating the context, if NULL
- * format_name and filename are used instead
- * @param format_name the name of output format to use for allocating the
- * context, if NULL filename is used instead
- * @param filename the name of the filename to use for allocating the
- * context, may be NULL
- * @return >= 0 in case of success, a negative AVERROR code in case of
- * failure
- */
-int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat,
-                                   const char *format_name, const char *filename);
-
-/**
- * Read packets of a media file to get stream information. This
- * is useful for file formats with no headers such as MPEG. This
- * function also computes the real framerate in case of MPEG-2 repeat
- * frame mode.
- * The logical file position is not changed by this function;
- * examined packets may be buffered for later processing.
- *
- * @param ic media file handle
- * @return >=0 if OK, AVERROR_xxx on error
- * @todo Let the user decide somehow what information is needed so that
- *       we do not waste time getting stuff the user does not need.
- */
-int av_find_stream_info(AVFormatContext *ic);
-
-/**
- * Find the "best" stream in the file.
- * The best stream is determined according to various heuristics as the most
- * likely to be what the user expects.
- * If the decoder parameter is non-NULL, av_find_best_stream will find the
- * default decoder for the stream's codec; streams for which no decoder can
- * be found are ignored.
- *
- * @param ic                media file handle
- * @param type              stream type: video, audio, subtitles, etc.
- * @param wanted_stream_nb  user-requested stream number,
- *                          or -1 for automatic selection
- * @param related_stream    try to find a stream related (eg. in the same
- *                          program) to this one, or -1 if none
- * @param decoder_ret       if non-NULL, returns the decoder for the
- *                          selected stream
- * @param flags             flags; none are currently defined
- * @return  the non-negative stream number in case of success,
- *          AVERROR_STREAM_NOT_FOUND if no stream with the requested type
- *          could be found,
- *          AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
- * @note  If av_find_best_stream returns successfully and decoder_ret is not
- *        NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
- */
-int av_find_best_stream(AVFormatContext *ic,
-                        enum AVMediaType type,
-                        int wanted_stream_nb,
-                        int related_stream,
-                        AVCodec **decoder_ret,
-                        int flags);
-
-/**
- * Read a transport packet from a media file.
- *
- * This function is obsolete and should never be used.
- * Use av_read_frame() instead.
- *
- * @param s media file handle
- * @param pkt is filled
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_read_packet(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Return the next frame of a stream.
- * This function returns what is stored in the file, and does not validate
- * that what is there are valid frames for the decoder. It will split what is
- * stored in the file into frames and return one for each call. It will not
- * omit invalid data between valid frames so as to give the decoder the maximum
- * information possible for decoding.
- *
- * The returned packet is valid
- * until the next av_read_frame() or until av_close_input_file() and
- * must be freed with av_free_packet. For video, the packet contains
- * exactly one frame. For audio, it contains an integer number of
- * frames if each frame has a known fixed size (e.g. PCM or ADPCM
- * data). If the audio frames have a variable size (e.g. MPEG audio),
- * then it contains one frame.
- *
- * pkt->pts, pkt->dts and pkt->duration are always set to correct
- * values in AVStream.time_base units (and guessed if the format cannot
- * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
- * has B-frames, so it is better to rely on pkt->dts if you do not
- * decompress the payload.
- *
- * @return 0 if OK, < 0 on error or end of file
- */
-int av_read_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Seek to the keyframe at timestamp.
- * 'timestamp' in 'stream_index'.
- * @param stream_index If stream_index is (-1), a default
- * stream is selected, and timestamp is automatically converted
- * from AV_TIME_BASE units to the stream specific time_base.
- * @param timestamp Timestamp in AVStream.time_base units
- *        or, if no stream is specified, in AV_TIME_BASE units.
- * @param flags flags which select direction and seeking mode
- * @return >= 0 on success
- */
-int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
-                  int flags);
-
-/**
- * Seek to timestamp ts.
- * Seeking will be done so that the point from which all active streams
- * can be presented successfully will be closest to ts and within min/max_ts.
- * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
- *
- * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
- * are the file position (this may not be supported by all demuxers).
- * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
- * in the stream with stream_index (this may not be supported by all demuxers).
- * Otherwise all timestamps are in units of the stream selected by stream_index
- * or if stream_index is -1, in AV_TIME_BASE units.
- * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
- * keyframes (this may not be supported by all demuxers).
- *
- * @param stream_index index of the stream which is used as time base reference
- * @param min_ts smallest acceptable timestamp
- * @param ts target timestamp
- * @param max_ts largest acceptable timestamp
- * @param flags flags
- * @return >=0 on success, error code otherwise
- *
- * @note This is part of the new seek API which is still under construction.
- *       Thus do not use this yet. It may change at any time, do not expect
- *       ABI compatibility yet!
- */
-int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
-/**
- * Start playing a network-based stream (e.g. RTSP stream) at the
- * current position.
- */
-int av_read_play(AVFormatContext *s);
-
-/**
- * Pause a network-based stream (e.g. RTSP stream).
- *
- * Use av_read_play() to resume it.
- */
-int av_read_pause(AVFormatContext *s);
-
-/**
- * Free a AVFormatContext allocated by av_open_input_stream.
- * @param s context to free
- */
-void av_close_input_stream(AVFormatContext *s);
-
-/**
- * Close a media file (but not its codecs).
- *
- * @param s media file handle
- */
-void av_close_input_file(AVFormatContext *s);
-
-/**
- * Free an AVFormatContext and all its streams.
- * @param s context to free
- */
-void avformat_free_context(AVFormatContext *s);
-
-/**
- * Add a new stream to a media file.
- *
- * Can only be called in the read_header() function. If the flag
- * AVFMTCTX_NOHEADER is in the format context, then new streams
- * can be added in read_packet too.
- *
- * @param s media file handle
- * @param id file-format-dependent stream ID
- */
-AVStream *av_new_stream(AVFormatContext *s, int id);
-AVProgram *av_new_program(AVFormatContext *s, int id);
-
-/**
- * Set the pts for a given stream. If the new values would be invalid
- * (<= 0), it leaves the AVStream unchanged.
- *
- * @param s stream
- * @param pts_wrap_bits number of bits effectively used by the pts
- *        (used for wrap control, 33 is the value for MPEG)
- * @param pts_num numerator to convert to seconds (MPEG: 1)
- * @param pts_den denominator to convert to seconds (MPEG: 90000)
- */
-void av_set_pts_info(AVStream *s, int pts_wrap_bits,
-                     unsigned int pts_num, unsigned int pts_den);
-
-#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
-#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
-#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
-#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
-
-int av_find_default_stream_index(AVFormatContext *s);
-
-/**
- * Get the index for a specific timestamp.
- * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
- *                 to the timestamp which is <= the requested one, if backward
- *                 is 0, then it will be >=
- *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
- * @return < 0 if no such timestamp could be found
- */
-int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
-
-/**
- * Add an index entry into a sorted list. Update the entry if the list
- * already contains it.
- *
- * @param timestamp timestamp in the time base of the given stream
- */
-int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
-                       int size, int distance, int flags);
-
-/**
- * Perform a binary search using av_index_search_timestamp() and
- * AVInputFormat.read_timestamp().
- * This is not supposed to be called directly by a user application,
- * but by demuxers.
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int av_seek_frame_binary(AVFormatContext *s, int stream_index,
-                         int64_t target_ts, int flags);
-
-/**
- * Update cur_dts of all streams based on the given timestamp and AVStream.
- *
- * Stream ref_st unchanged, others set cur_dts in their native time base.
- * Only needed for timestamp wrapping or if (dts not set and pts!=dts).
- * @param timestamp new dts expressed in time_base of param ref_st
- * @param ref_st reference stream giving time_base of param timestamp
- */
-void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
-
-/**
- * Perform a binary search using read_timestamp().
- * This is not supposed to be called directly by a user application,
- * but by demuxers.
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int64_t av_gen_search(AVFormatContext *s, int stream_index,
-                      int64_t target_ts, int64_t pos_min,
-                      int64_t pos_max, int64_t pos_limit,
-                      int64_t ts_min, int64_t ts_max,
-                      int flags, int64_t *ts_ret,
-                      int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
-
-/**
- * media file output
- */
-attribute_deprecated int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
-
-/**
- * Split a URL string into components.
- *
- * The pointers to buffers for storing individual components may be null,
- * in order to ignore that component. Buffers for components not found are
- * set to empty strings. If the port is not found, it is set to a negative
- * value.
- *
- * @param proto the buffer for the protocol
- * @param proto_size the size of the proto buffer
- * @param authorization the buffer for the authorization
- * @param authorization_size the size of the authorization buffer
- * @param hostname the buffer for the host name
- * @param hostname_size the size of the hostname buffer
- * @param port_ptr a pointer to store the port number in
- * @param path the buffer for the path
- * @param path_size the size of the path buffer
- * @param url the URL to split
- */
-void av_url_split(char *proto,         int proto_size,
-                  char *authorization, int authorization_size,
-                  char *hostname,      int hostname_size,
-                  int *port_ptr,
-                  char *path,          int path_size,
-                  const char *url);
-
-/**
- * Allocate the stream private data and write the stream header to an
- * output media file.
- * @note: this sets stream time-bases, if possible to stream->codec->time_base
- * but for some formats it might also be some other time base
- *
- * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_write_header(AVFormatContext *s);
-
-/**
- * Write a packet to an output media file.
- *
- * The packet shall contain one audio or video frame.
- * The packet must be correctly interleaved according to the container
- * specification, if not then av_interleaved_write_frame must be used.
- *
- * @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
-              dts/pts, ...
- * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
- */
-int av_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Write a packet to an output media file ensuring correct interleaving.
- *
- * The packet must contain one audio or video frame.
- * If the packets are already correctly interleaved, the application should
- * call av_write_frame() instead as it is slightly faster. It is also important
- * to keep in mind that completely non-interleaved input will need huge amounts
- * of memory to interleave with this, so it is preferable to interleave at the
- * demuxer level.
- *
- * @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
-              dts/pts, ...
- * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
- */
-int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Interleave a packet per dts in an output media file.
- *
- * Packets with pkt->destruct == av_destruct_packet will be freed inside this
- * function, so they cannot be used after it. Note that calling av_free_packet()
- * on them is still safe.
- *
- * @param s media file handle
- * @param out the interleaved packet will be output here
- * @param pkt the input packet
- * @param flush 1 if no further packets are available as input and all
- *              remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
- *         < 0 if an error occurred
- */
-int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
-                                 AVPacket *pkt, int flush);
-
-/**
- * Write the stream trailer to an output media file and free the
- * file private data.
- *
- * May only be called after a successful call to av_write_header.
- *
- * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_write_trailer(AVFormatContext *s);
-
-#if FF_API_DUMP_FORMAT
-/**
- * @deprecated Deprecated in favor of av_dump_format().
- */
-attribute_deprecated void dump_format(AVFormatContext *ic,
-                                      int index,
-                                      const char *url,
-                                      int is_output);
-#endif
-
-void av_dump_format(AVFormatContext *ic,
-                    int index,
-                    const char *url,
-                    int is_output);
-
-#if FF_API_PARSE_DATE
-/**
- * Parse datestr and return a corresponding number of microseconds.
- *
- * @param datestr String representing a date or a duration.
- * See av_parse_time() for the syntax of the provided string.
- * @deprecated in favor of av_parse_time()
- */
-attribute_deprecated
-int64_t parse_date(const char *datestr, int duration);
-#endif
-
-/**
- * Get the current time in microseconds.
- */
-int64_t av_gettime(void);
-
-#if FF_API_FIND_INFO_TAG
-/**
- * @deprecated use av_find_info_tag in libavutil instead.
- */
-attribute_deprecated int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
-#endif
-
-/**
- * Return in 'buf' the path with '%d' replaced by a number.
- *
- * Also handles the '%0nd' format where 'n' is the total number
- * of digits and '%%'.
- *
- * @param buf destination buffer
- * @param buf_size destination buffer size
- * @param path numbered sequence string
- * @param number frame number
- * @return 0 if OK, -1 on format error
- */
-int av_get_frame_filename(char *buf, int buf_size,
-                          const char *path, int number);
-
-/**
- * Check whether filename actually is a numbered sequence generator.
- *
- * @param filename possible numbered sequence string
- * @return 1 if a valid numbered sequence string, 0 otherwise
- */
-int av_filename_number_test(const char *filename);
-
-/**
- * Generate an SDP for an RTP session.
- *
- * @param ac array of AVFormatContexts describing the RTP streams. If the
- *           array is composed by only one context, such context can contain
- *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
- *           all the contexts in the array (an AVCodecContext per RTP stream)
- *           must contain only one AVStream.
- * @param n_files number of AVCodecContexts contained in ac
- * @param buf buffer where the SDP will be stored (must be allocated by
- *            the caller)
- * @param size the size of the buffer
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
-
-#if FF_API_SDP_CREATE
-attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
-#endif
-
-/**
- * Return a positive value if the given filename has one of the given
- * extensions, 0 otherwise.
- *
- * @param extensions a comma-separated list of filename extensions
- */
-int av_match_ext(const char *filename, const char *extensions);
-
-#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/ffmpeg 0.7/include/libavformat/avio.h b/ffmpeg 0.7/include/libavformat/avio.h
deleted file mode 100644 (file)
index bf1ea30..0000000
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_AVIO_H
-#define AVFORMAT_AVIO_H
-
-/**
- * @file
- * Buffered I/O operations
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/log.h"
-
-#include "libavformat/version.h"
-
-
-#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
-
-/**
- * Bytestream IO Context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVIOContext) must not be used outside libav*.
- *
- * @note None of the function pointers in AVIOContext should be called
- *       directly, they should only be set by the client application
- *       when implementing custom I/O. Normally these are set to the
- *       function pointers specified in avio_alloc_context()
- */
-typedef struct {
-    unsigned char *buffer;  /**< Start of the buffer. */
-    int buffer_size;        /**< Maximum buffer size */
-    unsigned char *buf_ptr; /**< Current position in the buffer */
-    unsigned char *buf_end; /**< End of the data, may be less than
-                                 buffer+buffer_size if the read function returned
-                                 less data than requested, e.g. for streams where
-                                 no more data has been received yet. */
-    void *opaque;           /**< A private pointer, passed to the read/write/seek/...
-                                 functions. */
-    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int64_t (*seek)(void *opaque, int64_t offset, int whence);
-    int64_t pos;            /**< position in the file of the current buffer */
-    int must_flush;         /**< true if the next seek should flush */
-    int eof_reached;        /**< true if eof reached */
-    int write_flag;         /**< true if open for writing */
-#if FF_API_OLD_AVIO
-    attribute_deprecated int is_streamed;
-#endif
-    int max_packet_size;
-    unsigned long checksum;
-    unsigned char *checksum_ptr;
-    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
-    int error;              /**< contains the error code or 0 if no error happened */
-    /**
-     * Pause or resume playback for network streaming protocols - e.g. MMS.
-     */
-    int (*read_pause)(void *opaque, int pause);
-    /**
-     * Seek to a given timestamp in stream with the specified stream_index.
-     * Needed for some network streaming protocols which don't support seeking
-     * to byte position.
-     */
-    int64_t (*read_seek)(void *opaque, int stream_index,
-                         int64_t timestamp, int flags);
-    /**
-     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
-     */
-    int seekable;
-} AVIOContext;
-
-/* unbuffered I/O */
-
-#if FF_API_OLD_AVIO
-/**
- * URL Context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(URLContext) must not be used outside libav*.
- * @deprecated This struct will be made private
- */
-typedef struct URLContext {
-    const AVClass *av_class; ///< information for av_log(). Set by url_open().
-    struct URLProtocol *prot;
-    int flags;
-    int is_streamed;  /**< true if streamed (no seek possible), default = false */
-    int max_packet_size;  /**< if non zero, the stream is packetized with this max packet size */
-    void *priv_data;
-    char *filename; /**< specified URL */
-    int is_connected;
-} URLContext;
-
-#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
-
-/**
- * @deprecated This struct is to be made private. Use the higher-level
- *             AVIOContext-based API instead.
- */
-typedef struct URLProtocol {
-    const char *name;
-    int (*url_open)(URLContext *h, const char *url, int flags);
-    int (*url_read)(URLContext *h, unsigned char *buf, int size);
-    int (*url_write)(URLContext *h, const unsigned char *buf, int size);
-    int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
-    int (*url_close)(URLContext *h);
-    struct URLProtocol *next;
-    int (*url_read_pause)(URLContext *h, int pause);
-    int64_t (*url_read_seek)(URLContext *h, int stream_index,
-                             int64_t timestamp, int flags);
-    int (*url_get_file_handle)(URLContext *h);
-    int priv_data_size;
-    const AVClass *priv_data_class;
-    int flags;
-    int (*url_check)(URLContext *h, int mask);
-} URLProtocol;
-
-typedef struct URLPollEntry {
-    URLContext *handle;
-    int events;
-    int revents;
-} URLPollEntry;
-
-/* not implemented */
-attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
-
-/**
- * @defgroup open_modes URL open modes
- * The flags argument to url_open and cosins must be one of the following
- * constants, optionally ORed with other flags.
- * @{
- */
-#define URL_RDONLY 1  /**< read-only */
-#define URL_WRONLY 2  /**< write-only */
-#define URL_RDWR   (URL_RDONLY|URL_WRONLY)  /**< read-write */
-/**
- * @}
- */
-
-/**
- * Use non-blocking mode.
- * If this flag is set, operations on the context will return
- * AVERROR(EAGAIN) if they can not be performed immediately.
- * If this flag is not set, operations on the context will never return
- * AVERROR(EAGAIN).
- * Note that this flag does not affect the opening/connecting of the
- * context. Connecting a protocol will always block if necessary (e.g. on
- * network protocols) but never hang (e.g. on busy devices).
- * Warning: non-blocking protocols is work-in-progress; this flag may be
- * silently ignored.
- */
-#define URL_FLAG_NONBLOCK 4
-
-typedef int URLInterruptCB(void);
-extern URLInterruptCB *url_interrupt_cb;
-
-/**
- * @defgroup old_url_funcs Old url_* functions
- * @deprecated use the buffered API based on AVIOContext instead
- * @{
- */
-attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
-                                            const char *url, int flags);
-attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags);
-attribute_deprecated int url_connect(URLContext *h);
-attribute_deprecated int url_open(URLContext **h, const char *url, int flags);
-attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size);
-attribute_deprecated int url_read_complete(URLContext *h, unsigned char *buf, int size);
-attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int size);
-attribute_deprecated int64_t url_seek(URLContext *h, int64_t pos, int whence);
-attribute_deprecated int url_close(URLContext *h);
-attribute_deprecated int64_t url_filesize(URLContext *h);
-attribute_deprecated int url_get_file_handle(URLContext *h);
-attribute_deprecated int url_get_max_packet_size(URLContext *h);
-attribute_deprecated void url_get_filename(URLContext *h, char *buf, int buf_size);
-attribute_deprecated int av_url_read_pause(URLContext *h, int pause);
-attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,
-                                              int64_t timestamp, int flags);
-attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));
-
-/**
- * returns the next registered protocol after the given protocol (the first if
- * NULL is given), or NULL if protocol is the last one.
- */
-URLProtocol *av_protocol_next(URLProtocol *p);
-
-/**
- * Register the URLProtocol protocol.
- *
- * @param size the size of the URLProtocol struct referenced
- */
-attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size);
-/**
- * @}
- */
-
-
-typedef attribute_deprecated AVIOContext ByteIOContext;
-
-attribute_deprecated int init_put_byte(AVIOContext *s,
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-attribute_deprecated AVIOContext *av_alloc_put_byte(
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-
-/**
- * @defgroup old_avio_funcs Old put_/get_*() functions
- * @deprecated use the avio_ -prefixed functions instead.
- * @{
- */
-attribute_deprecated int          get_buffer(AVIOContext *s, unsigned char *buf, int size);
-attribute_deprecated int          get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
-attribute_deprecated int          get_byte(AVIOContext *s);
-attribute_deprecated unsigned int get_le16(AVIOContext *s);
-attribute_deprecated unsigned int get_le24(AVIOContext *s);
-attribute_deprecated unsigned int get_le32(AVIOContext *s);
-attribute_deprecated uint64_t     get_le64(AVIOContext *s);
-attribute_deprecated unsigned int get_be16(AVIOContext *s);
-attribute_deprecated unsigned int get_be24(AVIOContext *s);
-attribute_deprecated unsigned int get_be32(AVIOContext *s);
-attribute_deprecated uint64_t     get_be64(AVIOContext *s);
-
-attribute_deprecated void         put_byte(AVIOContext *s, int b);
-attribute_deprecated void         put_nbyte(AVIOContext *s, int b, int count);
-attribute_deprecated void         put_buffer(AVIOContext *s, const unsigned char *buf, int size);
-attribute_deprecated void         put_le64(AVIOContext *s, uint64_t val);
-attribute_deprecated void         put_be64(AVIOContext *s, uint64_t val);
-attribute_deprecated void         put_le32(AVIOContext *s, unsigned int val);
-attribute_deprecated void         put_be32(AVIOContext *s, unsigned int val);
-attribute_deprecated void         put_le24(AVIOContext *s, unsigned int val);
-attribute_deprecated void         put_be24(AVIOContext *s, unsigned int val);
-attribute_deprecated void         put_le16(AVIOContext *s, unsigned int val);
-attribute_deprecated void         put_be16(AVIOContext *s, unsigned int val);
-attribute_deprecated void         put_tag(AVIOContext *s, const char *tag);
-/**
- * @}
- */
-
-attribute_deprecated int     av_url_read_fpause(AVIOContext *h,    int pause);
-attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h,    int stream_index,
-                                                int64_t timestamp, int flags);
-
-/**
- * @defgroup old_url_f_funcs Old url_f* functions
- * @deprecated use the avio_ -prefixed functions instead.
- * @{
- */
-attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
-attribute_deprecated int url_fclose(AVIOContext *s);
-attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
-attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset);
-attribute_deprecated int64_t url_ftell(AVIOContext *s);
-attribute_deprecated int64_t url_fsize(AVIOContext *s);
-#define URL_EOF (-1)
-attribute_deprecated int url_fgetc(AVIOContext *s);
-attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
-#ifdef __GNUC__
-attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
-#else
-attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
-#endif
-attribute_deprecated void put_flush_packet(AVIOContext *s);
-attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
-attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
-attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
-attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h);
-/**
- * @}
- */
-
-attribute_deprecated int url_ferror(AVIOContext *s);
-
-attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri);
-attribute_deprecated int udp_get_local_port(URLContext *h);
-
-attribute_deprecated void init_checksum(AVIOContext *s,
-                   unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
-                   unsigned long checksum);
-attribute_deprecated unsigned long get_checksum(AVIOContext *s);
-attribute_deprecated void put_strz(AVIOContext *s, const char *buf);
-/** @note unlike fgets, the EOL character is not returned and a whole
-    line is parsed. return NULL if first char read was EOF */
-attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
-/**
- * @deprecated use avio_get_str instead
- */
-attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen);
-/**
- * @deprecated Use AVIOContext.seekable field directly.
- */
-attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
-{
-    return !s->seekable;
-}
-attribute_deprecated URLContext *url_fileno(AVIOContext *s);
-
-/**
- * @deprecated use AVIOContext.max_packet_size directly.
- */
-attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);
-
-attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
-
-/** return the written or read size */
-attribute_deprecated int url_close_buf(AVIOContext *s);
-
-/**
- * Return a non-zero value if the resource indicated by url
- * exists, 0 otherwise.
- * @deprecated Use avio_check instead.
- */
-attribute_deprecated int url_exist(const char *url);
-#endif // FF_API_OLD_AVIO
-
-/**
- * Return AVIO_FLAG_* access flags corresponding to the access permissions
- * of the resource in url, or a negative value corresponding to an
- * AVERROR code in case of failure. The returned access flags are
- * masked by the value in flags.
- *
- * @note This function is intrinsically unsafe, in the sense that the
- * checked resource may change its existence or permission status from
- * one call to another. Thus you should not trust the returned value,
- * unless you are sure that no other processes are accessing the
- * checked resource.
- */
-int avio_check(const char *url, int flags);
-
-/**
- * The callback is called in blocking functions to test regulary if
- * asynchronous interruption is needed. AVERROR_EXIT is returned
- * in this case by the interrupted function. 'NULL' means no interrupt
- * callback is given.
- */
-void avio_set_interrupt_cb(int (*interrupt_cb)(void));
-
-/**
- * Allocate and initialize an AVIOContext for buffered I/O. It must be later
- * freed with av_free().
- *
- * @param buffer Memory block for input/output operations via AVIOContext.
- *        The buffer must be allocated with av_malloc() and friends.
- * @param buffer_size The buffer size is very important for performance.
- *        For protocols with fixed blocksize it should be set to this blocksize.
- *        For others a typical size is a cache page, e.g. 4kb.
- * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
- * @param opaque An opaque pointer to user-specific data.
- * @param read_packet  A function for refilling the buffer, may be NULL.
- * @param write_packet A function for writing the buffer contents, may be NULL.
- * @param seek A function for seeking to specified byte position, may be NULL.
- *
- * @return Allocated AVIOContext or NULL on failure.
- */
-AVIOContext *avio_alloc_context(
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-
-void avio_w8(AVIOContext *s, int b);
-void avio_write(AVIOContext *s, const unsigned char *buf, int size);
-void avio_wl64(AVIOContext *s, uint64_t val);
-void avio_wb64(AVIOContext *s, uint64_t val);
-void avio_wl32(AVIOContext *s, unsigned int val);
-void avio_wb32(AVIOContext *s, unsigned int val);
-void avio_wl24(AVIOContext *s, unsigned int val);
-void avio_wb24(AVIOContext *s, unsigned int val);
-void avio_wl16(AVIOContext *s, unsigned int val);
-void avio_wb16(AVIOContext *s, unsigned int val);
-
-/**
- * Write a NULL-terminated string.
- * @return number of bytes written.
- */
-int avio_put_str(AVIOContext *s, const char *str);
-
-/**
- * Convert an UTF-8 string to UTF-16LE and write it.
- * @return number of bytes written.
- */
-int avio_put_str16le(AVIOContext *s, const char *str);
-
-/**
- * Passing this as the "whence" parameter to a seek function causes it to
- * return the filesize without seeking anywhere. Supporting this is optional.
- * If it is not supported then the seek function will return <0.
- */
-#define AVSEEK_SIZE 0x10000
-
-/**
- * Oring this flag as into the "whence" parameter to a seek function causes it to
- * seek by any means (like reopening and linear reading) or other normally unreasonble
- * means that can be extreemly slow.
- * This may be ignored by the seek code.
- */
-#define AVSEEK_FORCE 0x20000
-
-/**
- * fseek() equivalent for AVIOContext.
- * @return new position or AVERROR.
- */
-int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
-
-/**
- * Skip given number of bytes forward
- * @return new position or AVERROR.
- */
-int64_t avio_skip(AVIOContext *s, int64_t offset);
-
-/**
- * ftell() equivalent for AVIOContext.
- * @return position or AVERROR.
- */
-static av_always_inline int64_t avio_tell(AVIOContext *s)
-{
-    return avio_seek(s, 0, SEEK_CUR);
-}
-
-/**
- * Get the filesize.
- * @return filesize or AVERROR
- */
-int64_t avio_size(AVIOContext *s);
-
-/**
- * feof() equivalent for AVIOContext.
- * @return non zero if and only if end of file
- */
-int url_feof(AVIOContext *s);
-
-/** @warning currently size is limited */
-#ifdef __GNUC__
-int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
-#else
-int avio_printf(AVIOContext *s, const char *fmt, ...);
-#endif
-
-void avio_flush(AVIOContext *s);
-
-
-/**
- * Read size bytes from AVIOContext into buf.
- * @return number of bytes read or AVERROR
- */
-int avio_read(AVIOContext *s, unsigned char *buf, int size);
-
-/**
- * @defgroup avio_read Functions for reading from AVIOContext.
- * @{
- *
- * @note return 0 if EOF, so you cannot use it if EOF handling is
- *       necessary
- */
-int          avio_r8  (AVIOContext *s);
-unsigned int avio_rl16(AVIOContext *s);
-unsigned int avio_rl24(AVIOContext *s);
-unsigned int avio_rl32(AVIOContext *s);
-uint64_t     avio_rl64(AVIOContext *s);
-unsigned int avio_rb16(AVIOContext *s);
-unsigned int avio_rb24(AVIOContext *s);
-unsigned int avio_rb32(AVIOContext *s);
-uint64_t     avio_rb64(AVIOContext *s);
-/**
- * @}
- */
-
-/**
- * Read a string from pb into buf. The reading will terminate when either
- * a NULL character was encountered, maxlen bytes have been read, or nothing
- * more can be read from pb. The result is guaranteed to be NULL-terminated, it
- * will be truncated if buf is too small.
- * Note that the string is not interpreted or validated in any way, it
- * might get truncated in the middle of a sequence for multi-byte encodings.
- *
- * @return number of bytes read (is always <= maxlen).
- * If reading ends on EOF or error, the return value will be one more than
- * bytes actually read.
- */
-int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
-
-/**
- * Read a UTF-16 string from pb and convert it to UTF-8.
- * The reading will terminate when either a null or invalid character was
- * encountered or maxlen bytes have been read.
- * @return number of bytes read (is always <= maxlen)
- */
-int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
-int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
-
-
-/**
- * @defgroup open_modes URL open modes
- * The flags argument to avio_open must be one of the following
- * constants, optionally ORed with other flags.
- * @{
- */
-#define AVIO_FLAG_READ  1                                      /**< read-only */
-#define AVIO_FLAG_WRITE 2                                      /**< write-only */
-#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE)  /**< read-write pseudo flag */
-/**
- * @}
- */
-
-/**
- * Use non-blocking mode.
- * If this flag is set, operations on the context will return
- * AVERROR(EAGAIN) if they can not be performed immediately.
- * If this flag is not set, operations on the context will never return
- * AVERROR(EAGAIN).
- * Note that this flag does not affect the opening/connecting of the
- * context. Connecting a protocol will always block if necessary (e.g. on
- * network protocols) but never hang (e.g. on busy devices).
- * Warning: non-blocking protocols is work-in-progress; this flag may be
- * silently ignored.
- */
-#define AVIO_FLAG_NONBLOCK 8
-
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource indicated by url.
- * @note When the resource indicated by url has been opened in
- * read+write mode, the AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int avio_open(AVIOContext **s, const char *url, int flags);
-
-/**
- * Close the resource accessed by the AVIOContext s and free it.
- * This function can only be used if s was opened by avio_open().
- *
- * @return 0 on success, an AVERROR < 0 on error.
- */
-int avio_close(AVIOContext *s);
-
-/**
- * Open a write only memory stream.
- *
- * @param s new IO context
- * @return zero if no error.
- */
-int avio_open_dyn_buf(AVIOContext **s);
-
-/**
- * Return the written size and a pointer to the buffer. The buffer
- * must be freed with av_free().
- * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
- *
- * @param s IO context
- * @param pbuffer pointer to a byte buffer
- * @return the length of the byte buffer
- */
-int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
-
-/**
- * Iterate through names of available protocols.
- * @note it is recommanded to use av_protocol_next() instead of this
- *
- * @param opaque A private pointer representing current protocol.
- *        It must be a pointer to NULL on first iteration and will
- *        be updated by successive calls to avio_enum_protocols.
- * @param output If set to 1, iterate over output protocols,
- *               otherwise over input protocols.
- *
- * @return A static string containing the name of current protocol or NULL
- */
-const char *avio_enum_protocols(void **opaque, int output);
-
-/**
- * Pause and resume playing - only meaningful if using a network streaming
- * protocol (e.g. MMS).
- * @param pause 1 for pause, 0 for resume
- */
-int     avio_pause(AVIOContext *h, int pause);
-
-/**
- * Seek to a given timestamp relative to some component stream.
- * Only meaningful if using a network streaming protocol (e.g. MMS.).
- * @param stream_index The stream index that the timestamp is relative to.
- *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
- *        units from the beginning of the presentation.
- *        If a stream_index >= 0 is used and the protocol does not support
- *        seeking based on component streams, the call will fail with ENOTSUP.
- * @param timestamp timestamp in AVStream.time_base units
- *        or if there is no stream specified then in AV_TIME_BASE units.
- * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
- *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
- *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
- *        fail with ENOTSUP if used and not supported.
- * @return >= 0 on success
- * @see AVInputFormat::read_seek
- */
-int64_t avio_seek_time(AVIOContext *h, int stream_index,
-                       int64_t timestamp, int flags);
-
-#endif /* AVFORMAT_AVIO_H */
diff --git a/ffmpeg 0.7/include/libavformat/version.h b/ffmpeg 0.7/include/libavformat/version.h
deleted file mode 100644 (file)
index 50c39dc..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Version macros.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_VERSION_H
-#define AVFORMAT_VERSION_H
-
-#include "libavutil/avutil.h"
-
-#define LIBAVFORMAT_VERSION_MAJOR 53
-#define LIBAVFORMAT_VERSION_MINOR  3
-#define LIBAVFORMAT_VERSION_MICRO  0
-
-#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-                                               LIBAVFORMAT_VERSION_MINOR, \
-                                               LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
-                                           LIBAVFORMAT_VERSION_MINOR,   \
-                                           LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
-
-#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
-
-/**
- * Those FF_API_* defines are not part of public API.
- * They may change, break or disappear at any time.
- */
-#ifndef FF_API_OLD_METADATA2
-#define FF_API_OLD_METADATA2           (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_READ_SEEK
-#define FF_API_READ_SEEK               (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_OLD_AVIO
-#define FF_API_OLD_AVIO                (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_DUMP_FORMAT
-#define FF_API_DUMP_FORMAT             (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_PARSE_DATE
-#define FF_API_PARSE_DATE              (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_FIND_INFO_TAG
-#define FF_API_FIND_INFO_TAG           (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_PKT_DUMP
-#define FF_API_PKT_DUMP                (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_GUESS_IMG2_CODEC
-#define FF_API_GUESS_IMG2_CODEC        (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_SDP_CREATE
-#define FF_API_SDP_CREATE              (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_ALLOC_OUTPUT_CONTEXT
-#define FF_API_ALLOC_OUTPUT_CONTEXT    (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_FORMAT_PARAMETERS
-#define FF_API_FORMAT_PARAMETERS       (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_FLAG_RTP_HINT
-#define FF_API_FLAG_RTP_HINT           (LIBAVFORMAT_VERSION_MAJOR < 54)
-#endif
-
-#endif /* AVFORMAT_VERSION_H */
diff --git a/ffmpeg 0.7/include/libavutil/adler32.h b/ffmpeg 0.7/include/libavutil/adler32.h
deleted file mode 100644 (file)
index 0b890bc..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * copyright (c) 2006 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ADLER32_H
-#define AVUTIL_ADLER32_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-/**
- * Calculate the Adler32 checksum of a buffer.
- *
- * Passing the return value to a subsequent av_adler32_update() call
- * allows the checksum of multiple buffers to be calculated as though
- * they were concatenated.
- *
- * @param adler initial checksum value
- * @param buf   pointer to input buffer
- * @param len   size of input buffer
- * @return      updated checksum
- */
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
-                                unsigned int len) av_pure;
-
-#endif /* AVUTIL_ADLER32_H */
diff --git a/ffmpeg 0.7/include/libavutil/aes.h b/ffmpeg 0.7/include/libavutil/aes.h
deleted file mode 100644 (file)
index 368f70c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * copyright (c) 2007 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AES_H
-#define AVUTIL_AES_H
-
-#include <stdint.h>
-
-extern const int av_aes_size;
-
-struct AVAES;
-
-/**
- * Initialize an AVAES context.
- * @param key_bits 128, 192 or 256
- * @param decrypt 0 for encryption, 1 for decryption
- */
-int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
-
-/**
- * Encrypt or decrypt a buffer using a previously initialized context.
- * @param count number of 16 byte blocks
- * @param dst destination array, can be equal to src
- * @param src source array, can be equal to dst
- * @param iv initialization vector for CBC mode, if NULL then ECB will be used
- * @param decrypt 0 for encryption, 1 for decryption
- */
-void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
-
-#endif /* AVUTIL_AES_H */
diff --git a/ffmpeg 0.7/include/libavutil/attributes.h b/ffmpeg 0.7/include/libavutil/attributes.h
deleted file mode 100644 (file)
index 517b129..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Macro definitions for various function/variable attributes
- */
-
-#ifndef AVUTIL_ATTRIBUTES_H
-#define AVUTIL_ATTRIBUTES_H
-
-#ifdef __GNUC__
-#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
-#else
-#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
-#endif
-
-#ifndef av_always_inline
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_always_inline __attribute__((always_inline)) inline
-#else
-#    define av_always_inline inline
-#endif
-#endif
-
-#ifndef av_noinline
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_noinline __attribute__((noinline))
-#else
-#    define av_noinline
-#endif
-#endif
-
-#ifndef av_pure
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_pure __attribute__((pure))
-#else
-#    define av_pure
-#endif
-#endif
-
-#ifndef av_const
-#if AV_GCC_VERSION_AT_LEAST(2,6)
-#    define av_const __attribute__((const))
-#else
-#    define av_const
-#endif
-#endif
-
-#ifndef av_cold
-#if AV_GCC_VERSION_AT_LEAST(4,3)
-#    define av_cold __attribute__((cold))
-#else
-#    define av_cold
-#endif
-#endif
-
-#ifndef av_flatten
-#if AV_GCC_VERSION_AT_LEAST(4,1)
-#    define av_flatten __attribute__((flatten))
-#else
-#    define av_flatten
-#endif
-#endif
-
-#ifndef attribute_deprecated
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define attribute_deprecated __attribute__((deprecated))
-#else
-#    define attribute_deprecated
-#endif
-#endif
-
-#ifndef av_unused
-#if defined(__GNUC__)
-#    define av_unused __attribute__((unused))
-#else
-#    define av_unused
-#endif
-#endif
-
-/**
- * Mark a variable as used and prevent the compiler from optimizing it
- * away.  This is useful for variables accessed only from inline
- * assembler without the compiler being aware.
- */
-#ifndef av_used
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_used __attribute__((used))
-#else
-#    define av_used
-#endif
-#endif
-
-#ifndef av_alias
-#if AV_GCC_VERSION_AT_LEAST(3,3)
-#   define av_alias __attribute__((may_alias))
-#else
-#   define av_alias
-#endif
-#endif
-
-#ifndef av_uninit
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-#    define av_uninit(x) x=x
-#else
-#    define av_uninit(x) x
-#endif
-#endif
-
-#ifdef __GNUC__
-#    define av_builtin_constant_p __builtin_constant_p
-#else
-#    define av_builtin_constant_p(x) 0
-#endif
-
-#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/ffmpeg 0.7/include/libavutil/audioconvert.h b/ffmpeg 0.7/include/libavutil/audioconvert.h
deleted file mode 100644 (file)
index 134c610..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- * Copyright (c) 2008 Peter Ross
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AUDIOCONVERT_H
-#define AVUTIL_AUDIOCONVERT_H
-
-#include <stdint.h>
-
-/**
- * @file
- * audio conversion routines
- */
-
-/* Audio channel masks */
-#define AV_CH_FRONT_LEFT             0x00000001
-#define AV_CH_FRONT_RIGHT            0x00000002
-#define AV_CH_FRONT_CENTER           0x00000004
-#define AV_CH_LOW_FREQUENCY          0x00000008
-#define AV_CH_BACK_LEFT              0x00000010
-#define AV_CH_BACK_RIGHT             0x00000020
-#define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
-#define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
-#define AV_CH_BACK_CENTER            0x00000100
-#define AV_CH_SIDE_LEFT              0x00000200
-#define AV_CH_SIDE_RIGHT             0x00000400
-#define AV_CH_TOP_CENTER             0x00000800
-#define AV_CH_TOP_FRONT_LEFT         0x00001000
-#define AV_CH_TOP_FRONT_CENTER       0x00002000
-#define AV_CH_TOP_FRONT_RIGHT        0x00004000
-#define AV_CH_TOP_BACK_LEFT          0x00008000
-#define AV_CH_TOP_BACK_CENTER        0x00010000
-#define AV_CH_TOP_BACK_RIGHT         0x00020000
-#define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
-#define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
-
-/** Channel mask value used for AVCodecContext.request_channel_layout
-    to indicate that the user requests the channel order of the decoder output
-    to be the native codec channel order. */
-#define AV_CH_LAYOUT_NATIVE          0x8000000000000000LL
-
-/* Audio channel convenience macros */
-#define AV_CH_LAYOUT_MONO              (AV_CH_FRONT_CENTER)
-#define AV_CH_LAYOUT_STEREO            (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
-#define AV_CH_LAYOUT_2_1               (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_SURROUND          (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
-#define AV_CH_LAYOUT_4POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_2_2               (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
-#define AV_CH_LAYOUT_QUAD              (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
-#define AV_CH_LAYOUT_5POINT1           (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_5POINT0_BACK      (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT1_BACK      (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_7POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
-
-/**
- * Return a channel layout id that matches name, 0 if no match.
- */
-int64_t av_get_channel_layout(const char *name);
-
-/**
- * Return a description of a channel layout.
- * If nb_channels is <= 0, it is guessed from the channel_layout.
- *
- * @param buf put here the string containing the channel layout
- * @param buf_size size in bytes of the buffer
- */
-void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout);
-
-/**
- * Return the number of channels in the channel layout.
- */
-int av_get_channel_layout_nb_channels(int64_t channel_layout);
-
-#endif /* AVUTIL_AUDIOCONVERT_H */
diff --git a/ffmpeg 0.7/include/libavutil/avassert.h b/ffmpeg 0.7/include/libavutil/avassert.h
deleted file mode 100644 (file)
index e100d0b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple assert() macros that are a bit more flexible than ISO C assert().
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef AVUTIL_AVASSERT_H
-#define AVUTIL_AVASSERT_H
-
-#include <stdlib.h>
-#include "avutil.h"
-#include "log.h"
-
-/**
- * assert() equivalent, that is always enabled.
- */
-#define av_assert0(cond) do {                                           \
-    if (!(cond)) {                                                      \
-        av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n",    \
-               AV_STRINGIFY(cond), __FILE__, __LINE__);                 \
-        abort();                                                        \
-    }                                                                   \
-} while (0)
-
-
-/**
- * assert() equivalent, that does not lie in speed critical code.
- * These asserts() thus can be enabled without fearing speedloss.
- */
-#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
-#define av_assert1(cond) av_assert0(cond)
-#else
-#define av_assert1(cond) ((void)0)
-#endif
-
-
-/**
- * assert() equivalent, that does lie in speed critical code.
- */
-#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
-#define av_assert2(cond) av_assert0(cond)
-#else
-#define av_assert2(cond) ((void)0)
-#endif
-
-#endif /* AVUTIL_AVASSERT_H */
diff --git a/ffmpeg 0.7/include/libavutil/avconfig.h b/ffmpeg 0.7/include/libavutil/avconfig.h
deleted file mode 100644 (file)
index f10aa61..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Generated by ffconf */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-#define AV_HAVE_BIGENDIAN 0
-#define AV_HAVE_FAST_UNALIGNED 1
-#endif /* AVUTIL_AVCONFIG_H */
diff --git a/ffmpeg 0.7/include/libavutil/avstring.h b/ffmpeg 0.7/include/libavutil/avstring.h
deleted file mode 100644 (file)
index 04d1197..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2007 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVSTRING_H
-#define AVUTIL_AVSTRING_H
-
-#include <stddef.h>
-
-/**
- * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
- * the address of the first character in str after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated if the prefix is matched inside str
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_strstart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Return non-zero if pfx is a prefix of str independent of case. If
- * it is, *ptr is set to the address of the first character in str
- * after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated if the prefix is matched inside str
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_stristart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Locate the first case-independent occurrence in the string haystack
- * of the string needle.  A zero-length string needle is considered to
- * match at the start of haystack.
- *
- * This function is a case-insensitive version of the standard strstr().
- *
- * @param haystack string to search in
- * @param needle   string to search for
- * @return         pointer to the located match within haystack
- *                 or a null pointer if no match
- */
-char *av_stristr(const char *haystack, const char *needle);
-
-/**
- * Copy the string src to dst, but no more than size - 1 bytes, and
- * null-terminate dst.
- *
- * This function is the same as BSD strlcpy().
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the length of src
- *
- * WARNING: since the return value is the length of src, src absolutely
- * _must_ be a properly 0-terminated string, otherwise this will read beyond
- * the end of the buffer and possibly crash.
- */
-size_t av_strlcpy(char *dst, const char *src, size_t size);
-
-/**
- * Append the string src to the string dst, but to a total length of
- * no more than size - 1 bytes, and null-terminate dst.
- *
- * This function is similar to BSD strlcat(), but differs when
- * size <= strlen(dst).
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the total length of src and dst
- *
- * WARNING: since the return value use the length of src and dst, these absolutely
- * _must_ be a properly 0-terminated strings, otherwise this will read beyond
- * the end of the buffer and possibly crash.
- */
-size_t av_strlcat(char *dst, const char *src, size_t size);
-
-/**
- * Append output to a string, according to a format. Never write out of
- * the destination buffer, and always put a terminating 0 within
- * the buffer.
- * @param dst destination buffer (string to which the output is
- *  appended)
- * @param size total size of the destination buffer
- * @param fmt printf-compatible format string, specifying how the
- *  following parameters are used
- * @return the length of the string that would have been generated
- *  if enough space had been available
- */
-size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
-
-/**
- * Convert a number to a av_malloced string.
- */
-char *av_d2str(double d);
-
-/**
- * Unescape the given string until a non escaped terminating char,
- * and return the token corresponding to the unescaped string.
- *
- * The normal \ and ' escaping is supported. Leading and trailing
- * whitespaces are removed, unless they are escaped with '\' or are
- * enclosed between ''.
- *
- * @param buf the buffer to parse, buf will be updated to point to the
- * terminating char
- * @param term a 0-terminated list of terminating chars
- * @return the malloced unescaped string, which must be av_freed by
- * the user, NULL in case of allocation failure
- */
-char *av_get_token(const char **buf, const char *term);
-
-#endif /* AVUTIL_AVSTRING_H */
diff --git a/ffmpeg 0.7/include/libavutil/avutil.h b/ffmpeg 0.7/include/libavutil/avutil.h
deleted file mode 100644 (file)
index 500c700..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVUTIL_H
-#define AVUTIL_AVUTIL_H
-
-/**
- * @file
- * external API header
- */
-
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-#define AV_PRAGMA(s) _Pragma(#s)
-
-#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
-#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-
-#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR  8
-#define LIBAVUTIL_VERSION_MICRO  0
-
-#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-                                               LIBAVUTIL_VERSION_MINOR, \
-                                               LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
-                                           LIBAVUTIL_VERSION_MINOR,     \
-                                           LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-/**
- * Those FF_API_* defines are not part of public API.
- * They may change, break or disappear at any time.
- */
-#ifndef FF_API_OLD_EVAL_NAMES
-#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
-#endif
-#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
-#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
-#endif
-
-/**
- * Return the LIBAVUTIL_VERSION_INT constant.
- */
-unsigned avutil_version(void);
-
-/**
- * Return the libavutil build-time configuration.
- */
-const char *avutil_configuration(void);
-
-/**
- * Return the libavutil license.
- */
-const char *avutil_license(void);
-
-enum AVMediaType {
-    AVMEDIA_TYPE_UNKNOWN = -1,
-    AVMEDIA_TYPE_VIDEO,
-    AVMEDIA_TYPE_AUDIO,
-    AVMEDIA_TYPE_DATA,
-    AVMEDIA_TYPE_SUBTITLE,
-    AVMEDIA_TYPE_ATTACHMENT,
-    AVMEDIA_TYPE_NB
-};
-
-#define FF_LAMBDA_SHIFT 7
-#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
-#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
-#define FF_LAMBDA_MAX (256*128-1)
-
-#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
-
-#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
-#define AV_TIME_BASE            1000000
-#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
-
-enum AVPictureType {
-    AV_PICTURE_TYPE_I = 1, ///< Intra
-    AV_PICTURE_TYPE_P,     ///< Predicted
-    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
-    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
-    AV_PICTURE_TYPE_SI,    ///< Switching Intra
-    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
-    AV_PICTURE_TYPE_BI,    ///< BI type
-};
-
-/**
- * Return a single letter to describe the given picture type
- * pict_type.
- *
- * @param[in] pict_type the picture type @return a single character
- * representing the picture type, '?' if pict_type is unknown
- */
-char av_get_picture_type_char(enum AVPictureType pict_type);
-
-#include "common.h"
-#include "error.h"
-#include "mathematics.h"
-#include "rational.h"
-#include "intfloat_readwrite.h"
-#include "log.h"
-#include "pixfmt.h"
-
-#endif /* AVUTIL_AVUTIL_H */
diff --git a/ffmpeg 0.7/include/libavutil/base64.h b/ffmpeg 0.7/include/libavutil/base64.h
deleted file mode 100644 (file)
index 092980b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BASE64_H
-#define AVUTIL_BASE64_H
-
-#include <stdint.h>
-
-/**
- * Decode a base64-encoded string.
- *
- * @param out      buffer for decoded data
- * @param in       null-terminated input string
- * @param out_size size in bytes of the out buffer, must be at
- *                 least 3/4 of the length of in
- * @return         number of bytes written, or a negative value in case of
- *                 invalid input
- */
-int av_base64_decode(uint8_t *out, const char *in, int out_size);
-
-/**
- * Encode data to base64 and null-terminate.
- *
- * @param out      buffer for encoded data
- * @param out_size size in bytes of the output buffer, must be at
- *                 least AV_BASE64_SIZE(in_size)
- * @param in_size  size in bytes of the 'in' buffer
- * @return         'out' or NULL in case of error
- */
-char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
-
-/**
- * Calculate the output size needed to base64-encode x bytes.
- */
-#define AV_BASE64_SIZE(x)  (((x)+2) / 3 * 4 + 1)
-
-#endif /* AVUTIL_BASE64_H */
diff --git a/ffmpeg 0.7/include/libavutil/bswap.h b/ffmpeg 0.7/include/libavutil/bswap.h
deleted file mode 100644 (file)
index 303bcf3..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * byte swapping routines
- */
-
-#ifndef AVUTIL_BSWAP_H
-#define AVUTIL_BSWAP_H
-
-#include <stdint.h>
-#include "libavutil/avconfig.h"
-#include "attributes.h"
-
-#ifdef HAVE_AV_CONFIG_H
-
-#include "config.h"
-
-#if   ARCH_ARM
-#   include "arm/bswap.h"
-#elif ARCH_AVR32
-#   include "avr32/bswap.h"
-#elif ARCH_BFIN
-#   include "bfin/bswap.h"
-#elif ARCH_SH4
-#   include "sh4/bswap.h"
-#elif ARCH_X86
-#   include "x86/bswap.h"
-#endif
-
-#endif /* HAVE_AV_CONFIG_H */
-
-#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
-#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
-#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
-
-#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
-
-#ifndef av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
-{
-    x= (x>>8) | (x<<8);
-    return x;
-}
-#endif
-
-#ifndef av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
-    x= (x>>16) | (x<<16);
-    return x;
-}
-#endif
-
-#ifndef av_bswap64
-static inline uint64_t av_const av_bswap64(uint64_t x)
-{
-#if 0
-    x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
-    x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
-    return (x>>32) | (x<<32);
-#else
-    union {
-        uint64_t ll;
-        uint32_t l[2];
-    } w, r;
-    w.ll = x;
-    r.l[0] = av_bswap32 (w.l[1]);
-    r.l[1] = av_bswap32 (w.l[0]);
-    return r.ll;
-#endif
-}
-#endif
-
-// be2ne ... big-endian to native-endian
-// le2ne ... little-endian to native-endian
-
-#if AV_HAVE_BIGENDIAN
-#define av_be2ne16(x) (x)
-#define av_be2ne32(x) (x)
-#define av_be2ne64(x) (x)
-#define av_le2ne16(x) av_bswap16(x)
-#define av_le2ne32(x) av_bswap32(x)
-#define av_le2ne64(x) av_bswap64(x)
-#define AV_BE2NEC(s, x) (x)
-#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
-#else
-#define av_be2ne16(x) av_bswap16(x)
-#define av_be2ne32(x) av_bswap32(x)
-#define av_be2ne64(x) av_bswap64(x)
-#define av_le2ne16(x) (x)
-#define av_le2ne32(x) (x)
-#define av_le2ne64(x) (x)
-#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
-#define AV_LE2NEC(s, x) (x)
-#endif
-
-#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
-#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
-#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
-#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
-#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
-#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
-
-#endif /* AVUTIL_BSWAP_H */
diff --git a/ffmpeg 0.7/include/libavutil/common.h b/ffmpeg 0.7/include/libavutil/common.h
deleted file mode 100644 (file)
index 1cd2de2..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common internal and external API header
- */
-
-#ifndef AVUTIL_COMMON_H
-#define AVUTIL_COMMON_H
-
-#include <ctype.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "attributes.h"
-#include "libavutil/avconfig.h"
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_NE(be, le) (be)
-#else
-#   define AV_NE(be, le) (le)
-#endif
-
-//rounded division & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
-/* assume b>0 */
-#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
-#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
-#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
-#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
-
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
-#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
-
-#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
-
-/* misc math functions */
-extern const uint8_t ff_log2_tab[256];
-
-extern const uint8_t av_reverse[256];
-
-static av_always_inline av_const int av_log2_c(unsigned int v)
-{
-    int n = 0;
-    if (v & 0xffff0000) {
-        v >>= 16;
-        n += 16;
-    }
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-
-static av_always_inline av_const int av_log2_16bit_c(unsigned int v)
-{
-    int n = 0;
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-
-#ifdef HAVE_AV_CONFIG_H
-#   include "config.h"
-#   include "intmath.h"
-#endif
-
-/* Pull in unguarded fallback defines at the end of this file. */
-#include "common.h"
-
-/**
- * Clip a signed integer value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/**
- * Clip a signed integer value into the 0-255 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
-{
-    if (a&(~0xFF)) return (-a)>>31;
-    else           return a;
-}
-
-/**
- * Clip a signed integer value into the -128,127 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int8_t av_clip_int8_c(int a)
-{
-    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
-    else                  return a;
-}
-
-/**
- * Clip a signed integer value into the 0-65535 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
-{
-    if (a&(~0xFFFF)) return (-a)>>31;
-    else             return a;
-}
-
-/**
- * Clip a signed integer value into the -32768,32767 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int16_t av_clip_int16_c(int a)
-{
-    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
-    else                      return a;
-}
-
-/**
- * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
-{
-    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
-    else                                         return a;
-}
-
-/**
- * Clip a signed integer to an unsigned power of two range.
- * @param  a value to clip
- * @param  p bit position to clip at
- * @return clipped value
- */
-static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
-{
-    if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
-    else                   return  a;
-}
-
-/**
- * Clip a float value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/** Compute ceil(log2(x)).
- * @param x value used to compute ceil(log2(x))
- * @return computed ceiling of log2(x)
- */
-static av_always_inline av_const int av_ceil_log2_c(int x)
-{
-    return av_log2((x - 1) << 1);
-}
-
-/**
- * Count number of bits set to one in x
- * @param x value to count bits of
- * @return the number of bits set to one in x
- */
-static av_always_inline av_const int av_popcount_c(uint32_t x)
-{
-    x -= (x >> 1) & 0x55555555;
-    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
-    x = (x + (x >> 4)) & 0x0F0F0F0F;
-    x += x >> 8;
-    return (x + (x >> 16)) & 0x3F;
-}
-
-#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
-#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
-
-/**
- * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
- *
- * @param val      Output value, must be an lvalue of type uint32_t.
- * @param GET_BYTE Expression reading one byte from the input.
- *                 Evaluated up to 7 times (4 for the currently
- *                 assigned Unicode range).  With a memory buffer
- *                 input, this could be *ptr++.
- * @param ERROR    Expression to be evaluated on invalid input,
- *                 typically a goto statement.
- */
-#define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= GET_BYTE;\
-    {\
-        int ones= 7 - av_log2(val ^ 255);\
-        if(ones==1)\
-            ERROR\
-        val&= 127>>ones;\
-        while(--ones > 0){\
-            int tmp= GET_BYTE - 128;\
-            if(tmp>>6)\
-                ERROR\
-            val= (val<<6) + tmp;\
-        }\
-    }
-
-/**
- * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
- *
- * @param val       Output value, must be an lvalue of type uint32_t.
- * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
- *                  to native byte order.  Evaluated one or two times.
- * @param ERROR     Expression to be evaluated on invalid input,
- *                  typically a goto statement.
- */
-#define GET_UTF16(val, GET_16BIT, ERROR)\
-    val = GET_16BIT;\
-    {\
-        unsigned int hi = val - 0xD800;\
-        if (hi < 0x800) {\
-            val = GET_16BIT - 0xDC00;\
-            if (val > 0x3FFU || hi > 0x3FFU)\
-                ERROR\
-            val += (hi<<10) + 0x10000;\
-        }\
-    }\
-
-/*!
- * \def PUT_UTF8(val, tmp, PUT_BYTE)
- * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
- * \param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
- * val is given as a function it is executed only once.
- * \param tmp is a temporary variable and should be of type uint8_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_BYTE.
- * \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
- * It could be a function or a statement, and uses tmp as the input byte.
- * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
- * executed up to 4 times for values in the valid UTF-8 range and up to
- * 7 times in the general case, depending on the length of the converted
- * Unicode character.
- */
-#define PUT_UTF8(val, tmp, PUT_BYTE)\
-    {\
-        int bytes, shift;\
-        uint32_t in = val;\
-        if (in < 0x80) {\
-            tmp = in;\
-            PUT_BYTE\
-        } else {\
-            bytes = (av_log2(in) + 4) / 5;\
-            shift = (bytes - 1) * 6;\
-            tmp = (256 - (256 >> bytes)) | (in >> shift);\
-            PUT_BYTE\
-            while (shift >= 6) {\
-                shift -= 6;\
-                tmp = 0x80 | ((in >> shift) & 0x3f);\
-                PUT_BYTE\
-            }\
-        }\
-    }
-
-/*!
- * \def PUT_UTF16(val, tmp, PUT_16BIT)
- * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
- * \param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
- * val is given as a function it is executed only once.
- * \param tmp is a temporary variable and should be of type uint16_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_16BIT.
- * \param PUT_16BIT writes the converted UTF-16 data to any proper destination
- * in desired endianness. It could be a function or a statement, and uses tmp
- * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
- * PUT_BYTE will be executed 1 or 2 times depending on input character.
- */
-#define PUT_UTF16(val, tmp, PUT_16BIT)\
-    {\
-        uint32_t in = val;\
-        if (in < 0x10000) {\
-            tmp = in;\
-            PUT_16BIT\
-        } else {\
-            tmp = 0xD800 | ((in - 0x10000) >> 10);\
-            PUT_16BIT\
-            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
-            PUT_16BIT\
-        }\
-    }\
-
-
-
-#include "mem.h"
-
-#ifdef HAVE_AV_CONFIG_H
-#    include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
-
-#endif /* AVUTIL_COMMON_H */
-
-/*
- * The following definitions are outside the multiple inclusion guard
- * to ensure they are immediately available in intmath.h.
- */
-
-#ifndef av_log2
-#   define av_log2       av_log2_c
-#endif
-#ifndef av_log2_16bit
-#   define av_log2_16bit av_log2_16bit_c
-#endif
-#ifndef av_ceil_log2
-#   define av_ceil_log2     av_ceil_log2_c
-#endif
-#ifndef av_clip
-#   define av_clip          av_clip_c
-#endif
-#ifndef av_clip_uint8
-#   define av_clip_uint8    av_clip_uint8_c
-#endif
-#ifndef av_clip_int8
-#   define av_clip_int8     av_clip_int8_c
-#endif
-#ifndef av_clip_uint16
-#   define av_clip_uint16   av_clip_uint16_c
-#endif
-#ifndef av_clip_int16
-#   define av_clip_int16    av_clip_int16_c
-#endif
-#ifndef av_clipl_int32
-#   define av_clipl_int32   av_clipl_int32_c
-#endif
-#ifndef av_clip_uintp2
-#   define av_clip_uintp2   av_clip_uintp2_c
-#endif
-#ifndef av_clipf
-#   define av_clipf         av_clipf_c
-#endif
-#ifndef av_popcount
-#   define av_popcount      av_popcount_c
-#endif
diff --git a/ffmpeg 0.7/include/libavutil/cpu.h b/ffmpeg 0.7/include/libavutil/cpu.h
deleted file mode 100644 (file)
index da93fb5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CPU_H
-#define AVUTIL_CPU_H
-
-#define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
-
-    /* lower 16 bits - CPU features */
-#define AV_CPU_FLAG_MMX          0x0001 ///< standard MMX
-#define AV_CPU_FLAG_MMX2         0x0002 ///< SSE integer functions or AMD MMX ext
-#define AV_CPU_FLAG_3DNOW        0x0004 ///< AMD 3DNOW
-#define AV_CPU_FLAG_SSE          0x0008 ///< SSE functions
-#define AV_CPU_FLAG_SSE2         0x0010 ///< PIV SSE2 functions
-#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
-#define AV_CPU_FLAG_3DNOWEXT     0x0020 ///< AMD 3DNowExt
-#define AV_CPU_FLAG_SSE3         0x0040 ///< Prescott SSE3 functions
-#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
-#define AV_CPU_FLAG_SSSE3        0x0080 ///< Conroe SSSE3 functions
-#define AV_CPU_FLAG_ATOM     0x10000000 ///< Atom processor, some SSSE3 instructions are slower
-#define AV_CPU_FLAG_SSE4         0x0100 ///< Penryn SSE4.1 functions
-#define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
-#define AV_CPU_FLAG_AVX          0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
-#define AV_CPU_FLAG_IWMMXT       0x0100 ///< XScale IWMMXT
-#define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
-
-/**
- * Return the flags which specify extensions supported by the CPU.
- */
-int av_get_cpu_flags(void);
-
-
-/**
- * Disables cpu detection and forces the specified flags.
- */
-void av_force_cpu_flags(int flags);
-
-
-/* The following CPU-specific functions shall not be called directly. */
-int ff_get_cpu_flags_arm(void);
-int ff_get_cpu_flags_ppc(void);
-int ff_get_cpu_flags_x86(void);
-
-#endif /* AVUTIL_CPU_H */
diff --git a/ffmpeg 0.7/include/libavutil/crc.h b/ffmpeg 0.7/include/libavutil/crc.h
deleted file mode 100644 (file)
index 6c0baab..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CRC_H
-#define AVUTIL_CRC_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include "attributes.h"
-
-typedef uint32_t AVCRC;
-
-typedef enum {
-    AV_CRC_8_ATM,
-    AV_CRC_16_ANSI,
-    AV_CRC_16_CCITT,
-    AV_CRC_32_IEEE,
-    AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of AV_CRC_32_IEEE */
-    AV_CRC_MAX,         /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
-
-int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
-const AVCRC *av_crc_get_table(AVCRCId crc_id);
-uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
-
-#endif /* AVUTIL_CRC_H */
-
diff --git a/ffmpeg 0.7/include/libavutil/dict.h b/ffmpeg 0.7/include/libavutil/dict.h
deleted file mode 100644 (file)
index 19cc091..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file Public dictionary API.
- */
-
-#ifndef AVUTIL_DICT_H
-#define AVUTIL_DICT_H
-
-#define AV_DICT_MATCH_CASE      1
-#define AV_DICT_IGNORE_SUFFIX   2
-#define AV_DICT_DONT_STRDUP_KEY 4
-#define AV_DICT_DONT_STRDUP_VAL 8
-#define AV_DICT_DONT_OVERWRITE 16   ///< Don't overwrite existing entries.
-
-typedef struct {
-    char *key;
-    char *value;
-} AVDictionaryEntry;
-
-typedef struct AVDictionary AVDictionary;
-
-/**
- * Get a dictionary entry with matching key.
- *
- * @param prev Set to the previous matching element to find the next.
- *             If set to NULL the first matching element is returned.
- * @param flags Allows case as well as suffix-insensitive comparisons.
- * @return Found entry or NULL, changing key or value leads to undefined behavior.
- */
-AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
-
-/**
- * Set the given entry in *pm, overwriting an existing entry.
- *
- * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
- * a dictionary struct is allocated and put in *pm.
- * @param key entry key to add to *pm (will be av_strduped depending on flags)
- * @param value entry value to add to *pm (will be av_strduped depending on flags).
- *        Passing a NULL value will cause an existing tag to be deleted.
- * @return >= 0 on success otherwise an error code <0
- */
-int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
-
-/**
- * Copy entries from one AVDictionary struct into another.
- * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
- *            this function will allocate a struct for you and put it in *dst
- * @param src pointer to source AVDictionary struct
- * @param flags flags to use when setting entries in *dst
- * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
- */
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
-
-/**
- * Free all the memory allocated for an AVDictionary struct.
- */
-void av_dict_free(AVDictionary **m);
-
-#endif // AVUTIL_DICT_H
diff --git a/ffmpeg 0.7/include/libavutil/error.h b/ffmpeg 0.7/include/libavutil/error.h
deleted file mode 100644 (file)
index 47d366e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * error code definitions
- */
-
-#ifndef AVUTIL_ERROR_H
-#define AVUTIL_ERROR_H
-
-#include <errno.h>
-#include "avutil.h"
-
-/* error handling */
-#if EDOM > 0
-#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
-#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
-#else
-/* Some platforms have E* and errno already negated. */
-#define AVERROR(e) (e)
-#define AVUNERROR(e) (e)
-#endif
-
-#define AVERROR_BSF_NOT_FOUND      (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
-#define AVERROR_DECODER_NOT_FOUND  (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found
-#define AVERROR_DEMUXER_NOT_FOUND  (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
-#define AVERROR_ENCODER_NOT_FOUND  (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found
-#define AVERROR_EOF                (-MKTAG( 'E','O','F',' ')) ///< End of file
-#define AVERROR_EXIT               (-MKTAG( 'E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
-#define AVERROR_FILTER_NOT_FOUND   (-MKTAG(0xF8,'F','I','L')) ///< Filter not found
-#define AVERROR_INVALIDDATA        (-MKTAG( 'I','N','D','A')) ///< Invalid data found when processing input
-#define AVERROR_MUXER_NOT_FOUND    (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
-#define AVERROR_OPTION_NOT_FOUND   (-MKTAG(0xF8,'O','P','T')) ///< Option not found
-#define AVERROR_PATCHWELCOME       (-MKTAG( 'P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
-#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
-#define AVERROR_STREAM_NOT_FOUND   (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
-
-/**
- * Put a description of the AVERROR code errnum in errbuf.
- * In case of failure the global variable errno is set to indicate the
- * error. Even in case of failure av_strerror() will print a generic
- * error message indicating the errnum provided to errbuf.
- *
- * @param errnum      error code to describe
- * @param errbuf      buffer to which description is written
- * @param errbuf_size the size in bytes of errbuf
- * @return 0 on success, a negative value if a description for errnum
- * cannot be found
- */
-int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
-
-#endif /* AVUTIL_ERROR_H */
diff --git a/ffmpeg 0.7/include/libavutil/eval.h b/ffmpeg 0.7/include/libavutil/eval.h
deleted file mode 100644 (file)
index ee378a2..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple arithmetic expression evaluator
- */
-
-#ifndef AVUTIL_EVAL_H
-#define AVUTIL_EVAL_H
-
-#include "avutil.h"
-
-typedef struct AVExpr AVExpr;
-
-/**
- * Parse and evaluate an expression.
- * Note, this is significantly slower than av_expr_eval().
- *
- * @param res a pointer to a double where is put the result value of
- * the expression, or NAN in case of error
- * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
- * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
- * @param const_values a zero terminated array of values for the identifiers from const_names
- * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
- * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
- * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
- * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
- * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
- * @param log_ctx parent logging context
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_expr_parse_and_eval(double *res, const char *s,
-                           const char * const *const_names, const double *const_values,
-                           const char * const *func1_names, double (* const *funcs1)(void *, double),
-                           const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                           void *opaque, int log_offset, void *log_ctx);
-
-/**
- * Parse an expression.
- *
- * @param expr a pointer where is put an AVExpr containing the parsed
- * value in case of successfull parsing, or NULL otherwise.
- * The pointed to AVExpr must be freed with av_expr_free() by the user
- * when it is not needed anymore.
- * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
- * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
- * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
- * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
- * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
- * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
- * @param log_ctx parent logging context
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_expr_parse(AVExpr **expr, const char *s,
-                  const char * const *const_names,
-                  const char * const *func1_names, double (* const *funcs1)(void *, double),
-                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                  int log_offset, void *log_ctx);
-
-/**
- * Evaluate a previously parsed expression.
- *
- * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
- * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
- * @return the value of the expression
- */
-double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
-
-/**
- * Free a parsed expression previously created with av_expr_parse().
- */
-void av_expr_free(AVExpr *e);
-
-#if FF_API_OLD_EVAL_NAMES
-/**
- * @deprecated Deprecated in favor of av_expr_parse_and_eval().
- */
-attribute_deprecated
-int av_parse_and_eval_expr(double *res, const char *s,
-                           const char * const *const_names, const double *const_values,
-                           const char * const *func1_names, double (* const *funcs1)(void *, double),
-                           const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                           void *opaque, int log_offset, void *log_ctx);
-
-/**
- * @deprecated Deprecated in favor of av_expr_parse().
- */
-attribute_deprecated
-int av_parse_expr(AVExpr **expr, const char *s,
-                  const char * const *const_names,
-                  const char * const *func1_names, double (* const *funcs1)(void *, double),
-                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                  int log_offset, void *log_ctx);
-/**
- * @deprecated Deprecated in favor of av_expr_eval().
- */
-attribute_deprecated
-double av_eval_expr(AVExpr *e, const double *const_values, void *opaque);
-
-/**
- * @deprecated Deprecated in favor of av_expr_free().
- */
-attribute_deprecated
-void av_free_expr(AVExpr *e);
-#endif /* FF_API_OLD_EVAL_NAMES */
-
-/**
- * Parse the string in numstr and return its value as a double. If
- * the string is empty, contains only whitespaces, or does not contain
- * an initial substring that has the expected syntax for a
- * floating-point number, no conversion is performed. In this case,
- * returns a value of zero and the value returned in tail is the value
- * of numstr.
- *
- * @param numstr a string representing a number, may contain one of
- * the International System number postfixes, for example 'K', 'M',
- * 'G'. If 'i' is appended after the postfix, powers of 2 are used
- * instead of powers of 10. The 'B' postfix multiplies the value for
- * 8, and can be appended after another postfix or used alone. This
- * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
- * @param tail if non-NULL puts here the pointer to the char next
- * after the last parsed character
- */
-double av_strtod(const char *numstr, char **tail);
-
-#endif /* AVUTIL_EVAL_H */
diff --git a/ffmpeg 0.7/include/libavutil/fifo.h b/ffmpeg 0.7/include/libavutil/fifo.h
deleted file mode 100644 (file)
index 999d0bf..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a very simple circular buffer FIFO implementation
- */
-
-#ifndef AVUTIL_FIFO_H
-#define AVUTIL_FIFO_H
-
-#include <stdint.h>
-
-typedef struct AVFifoBuffer {
-    uint8_t *buffer;
-    uint8_t *rptr, *wptr, *end;
-    uint32_t rndx, wndx;
-} AVFifoBuffer;
-
-/**
- * Initialize an AVFifoBuffer.
- * @param size of FIFO
- * @return AVFifoBuffer or NULL in case of memory allocation failure
- */
-AVFifoBuffer *av_fifo_alloc(unsigned int size);
-
-/**
- * Free an AVFifoBuffer.
- * @param *f AVFifoBuffer to free
- */
-void av_fifo_free(AVFifoBuffer *f);
-
-/**
- * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
- * @param *f AVFifoBuffer to reset
- */
-void av_fifo_reset(AVFifoBuffer *f);
-
-/**
- * Return the amount of data in bytes in the AVFifoBuffer, that is the
- * amount of data you can read from it.
- * @param *f AVFifoBuffer to read from
- * @return size
- */
-int av_fifo_size(AVFifoBuffer *f);
-
-/**
- * Return the amount of space in bytes in the AVFifoBuffer, that is the
- * amount of data you can write into it.
- * @param *f AVFifoBuffer to write into
- * @return size
- */
-int av_fifo_space(AVFifoBuffer *f);
-
-/**
- * Feed data from an AVFifoBuffer to a user-supplied callback.
- * @param *f AVFifoBuffer to read from
- * @param buf_size number of bytes to read
- * @param *func generic read function
- * @param *dest data destination
- */
-int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
-
-/**
- * Feed data from a user-supplied callback to an AVFifoBuffer.
- * @param *f AVFifoBuffer to write to
- * @param *src data source; non-const since it may be used as a
- * modifiable context by the function defined in func
- * @param size number of bytes to write
- * @param *func generic write function; the first parameter is src,
- * the second is dest_buf, the third is dest_buf_size.
- * func must return the number of bytes written to dest_buf, or <= 0 to
- * indicate no more data available to write.
- * If func is NULL, src is interpreted as a simple byte array for source data.
- * @return the number of bytes written to the FIFO
- */
-int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
-
-/**
- * Resize an AVFifoBuffer.
- * @param *f AVFifoBuffer to resize
- * @param size new AVFifoBuffer size in bytes
- * @return <0 for failure, >=0 otherwise
- */
-int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
-
-/**
- * Read and discard the specified amount of data from an AVFifoBuffer.
- * @param *f AVFifoBuffer to read from
- * @param size amount of data to read in bytes
- */
-void av_fifo_drain(AVFifoBuffer *f, int size);
-
-static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
-{
-    uint8_t *ptr = f->rptr + offs;
-    if (ptr >= f->end)
-        ptr -= f->end - f->buffer;
-    return *ptr;
-}
-#endif /* AVUTIL_FIFO_H */
diff --git a/ffmpeg 0.7/include/libavutil/file.h b/ffmpeg 0.7/include/libavutil/file.h
deleted file mode 100644 (file)
index f94d780..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_FILE_H
-#define AVUTIL_FILE_H
-
-#include "avutil.h"
-
-/**
- * @file misc file utilities
- */
-
-/**
- * Read the file with name filename, and put its content in a newly
- * allocated buffer or map it with mmap() when available.
- * In case of success set *bufptr to the read or mmapped buffer, and
- * *size to the size in bytes of the buffer in *bufptr.
- * The returned buffer must be released with av_file_unmap().
- *
- * @param log_offset loglevel offset used for logging
- * @param log_ctx context used for logging
- * @return a non negative number in case of success, a negative value
- * corresponding to an AVERROR error code in case of failure
- */
-int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
-                int log_offset, void *log_ctx);
-
-/**
- * Unmap or free the buffer bufptr created by av_file_map().
- *
- * @param size size in bytes of bufptr, must be the same as returned
- * by av_file_map()
- */
-void av_file_unmap(uint8_t *bufptr, size_t size);
-
-#endif /* AVUTIL_FILE_H */
diff --git a/ffmpeg 0.7/include/libavutil/imgutils.h b/ffmpeg 0.7/include/libavutil/imgutils.h
deleted file mode 100644 (file)
index f34cb2d..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_IMGUTILS_H
-#define AVUTIL_IMGUTILS_H
-
-/**
- * @file
- * misc image utilities
- */
-
-#include "avutil.h"
-#include "pixdesc.h"
-
-/**
- * Compute the max pixel step for each plane of an image with a
- * format described by pixdesc.
- *
- * The pixel step is the distance in bytes between the first byte of
- * the group of bytes which describe a pixel component and the first
- * byte of the successive group in the same plane for the same
- * component.
- *
- * @param max_pixsteps an array which is filled with the max pixel step
- * for each plane. Since a plane may contain different pixel
- * components, the computed max_pixsteps[plane] is relative to the
- * component in the plane with the max pixel step.
- * @param max_pixstep_comps an array which is filled with the component
- * for each plane which has the max pixel step. May be NULL.
- */
-void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
-                                const AVPixFmtDescriptor *pixdesc);
-
-/**
- * Compute the size of an image line with format pix_fmt and width
- * width for the plane plane.
- *
- * @return the computed size in bytes
- */
-int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane);
-
-/**
- * Fill plane linesizes for an image with pixel format pix_fmt and
- * width width.
- *
- * @param linesizes array to be filled with the linesize for each plane
- * @return >= 0 in case of success, a negative error code otherwise
- */
-int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width);
-
-/**
- * Fill plane data pointers for an image with pixel format pix_fmt and
- * height height.
- *
- * @param data pointers array to be filled with the pointer for each image plane
- * @param ptr the pointer to a buffer which will contain the image
- * @param linesizes[4] the array containing the linesize for each
- * plane, should be filled by av_image_fill_linesizes()
- * @return the size in bytes required for the image buffer, a negative
- * error code in case of failure
- */
-int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,
-                           uint8_t *ptr, const int linesizes[4]);
-
-/**
- * Allocate an image with size w and h and pixel format pix_fmt, and
- * fill pointers and linesizes accordingly.
- * The allocated image buffer has to be freed by using
- * av_freep(&pointers[0]).
- *
- * @param align the value to use for buffer size alignment
- * @return the size in bytes required for the image buffer, a negative
- * error code in case of failure
- */
-int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
-                   int w, int h, enum PixelFormat pix_fmt, int align);
-
-/**
- * Copy image plane from src to dst.
- * That is, copy "height" number of lines of "bytewidth" bytes each.
- * The first byte of each successive line is separated by *_linesize
- * bytes.
- *
- * @param dst_linesize linesize for the image plane in dst
- * @param src_linesize linesize for the image plane in src
- */
-void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
-                         const uint8_t *src, int src_linesize,
-                         int bytewidth, int height);
-
-/**
- * Copy image in src_data to dst_data.
- *
- * @param dst_linesize linesizes for the image in dst_data
- * @param src_linesize linesizes for the image in src_data
- */
-void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
-                   const uint8_t *src_data[4], const int src_linesizes[4],
-                   enum PixelFormat pix_fmt, int width, int height);
-
-/**
- * Check if the given dimension of an image is valid, meaning that all
- * bytes of the image can be addressed with a signed int.
- *
- * @param w the width of the picture
- * @param h the height of the picture
- * @param log_offset the offset to sum to the log level for logging with log_ctx
- * @param log_ctx the parent logging context, it may be NULL
- * @return >= 0 if valid, a negative error code otherwise
- */
-int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
-
-int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt);
-
-#endif /* AVUTIL_IMGUTILS_H */
diff --git a/ffmpeg 0.7/include/libavutil/intfloat_readwrite.h b/ffmpeg 0.7/include/libavutil/intfloat_readwrite.h
deleted file mode 100644 (file)
index 1b80fc6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTFLOAT_READWRITE_H
-#define AVUTIL_INTFLOAT_READWRITE_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-/* IEEE 80 bits extended float */
-typedef struct AVExtFloat  {
-    uint8_t exponent[2];
-    uint8_t mantissa[8];
-} AVExtFloat;
-
-double av_int2dbl(int64_t v) av_const;
-float av_int2flt(int32_t v) av_const;
-double av_ext2dbl(const AVExtFloat ext) av_const;
-int64_t av_dbl2int(double d) av_const;
-int32_t av_flt2int(float d) av_const;
-AVExtFloat av_dbl2ext(double d) av_const;
-
-#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/ffmpeg 0.7/include/libavutil/intreadwrite.h b/ffmpeg 0.7/include/libavutil/intreadwrite.h
deleted file mode 100644 (file)
index 1849a64..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTREADWRITE_H
-#define AVUTIL_INTREADWRITE_H
-
-#include <stdint.h>
-#include "libavutil/avconfig.h"
-#include "attributes.h"
-#include "bswap.h"
-
-typedef union {
-    uint64_t u64;
-    uint32_t u32[2];
-    uint16_t u16[4];
-    uint8_t  u8 [8];
-    double   f64;
-    float    f32[2];
-} av_alias av_alias64;
-
-typedef union {
-    uint32_t u32;
-    uint16_t u16[2];
-    uint8_t  u8 [4];
-    float    f32;
-} av_alias av_alias32;
-
-typedef union {
-    uint16_t u16;
-    uint8_t  u8 [2];
-} av_alias av_alias16;
-
-/*
- * Arch-specific headers can provide any combination of
- * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
- * Preprocessor symbols must be defined, even if these are implemented
- * as inline functions.
- */
-
-#ifdef HAVE_AV_CONFIG_H
-
-#include "config.h"
-
-#if   ARCH_ARM
-#   include "arm/intreadwrite.h"
-#elif ARCH_AVR32
-#   include "avr32/intreadwrite.h"
-#elif ARCH_MIPS
-#   include "mips/intreadwrite.h"
-#elif ARCH_PPC
-#   include "ppc/intreadwrite.h"
-#elif ARCH_TOMI
-#   include "tomi/intreadwrite.h"
-#elif ARCH_X86
-#   include "x86/intreadwrite.h"
-#endif
-
-#endif /* HAVE_AV_CONFIG_H */
-
-/*
- * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
- */
-
-#if AV_HAVE_BIGENDIAN
-
-#   if    defined(AV_RN16) && !defined(AV_RB16)
-#       define AV_RB16(p) AV_RN16(p)
-#   elif !defined(AV_RN16) &&  defined(AV_RB16)
-#       define AV_RN16(p) AV_RB16(p)
-#   endif
-
-#   if    defined(AV_WN16) && !defined(AV_WB16)
-#       define AV_WB16(p, v) AV_WN16(p, v)
-#   elif !defined(AV_WN16) &&  defined(AV_WB16)
-#       define AV_WN16(p, v) AV_WB16(p, v)
-#   endif
-
-#   if    defined(AV_RN24) && !defined(AV_RB24)
-#       define AV_RB24(p) AV_RN24(p)
-#   elif !defined(AV_RN24) &&  defined(AV_RB24)
-#       define AV_RN24(p) AV_RB24(p)
-#   endif
-
-#   if    defined(AV_WN24) && !defined(AV_WB24)
-#       define AV_WB24(p, v) AV_WN24(p, v)
-#   elif !defined(AV_WN24) &&  defined(AV_WB24)
-#       define AV_WN24(p, v) AV_WB24(p, v)
-#   endif
-
-#   if    defined(AV_RN32) && !defined(AV_RB32)
-#       define AV_RB32(p) AV_RN32(p)
-#   elif !defined(AV_RN32) &&  defined(AV_RB32)
-#       define AV_RN32(p) AV_RB32(p)
-#   endif
-
-#   if    defined(AV_WN32) && !defined(AV_WB32)
-#       define AV_WB32(p, v) AV_WN32(p, v)
-#   elif !defined(AV_WN32) &&  defined(AV_WB32)
-#       define AV_WN32(p, v) AV_WB32(p, v)
-#   endif
-
-#   if    defined(AV_RN64) && !defined(AV_RB64)
-#       define AV_RB64(p) AV_RN64(p)
-#   elif !defined(AV_RN64) &&  defined(AV_RB64)
-#       define AV_RN64(p) AV_RB64(p)
-#   endif
-
-#   if    defined(AV_WN64) && !defined(AV_WB64)
-#       define AV_WB64(p, v) AV_WN64(p, v)
-#   elif !defined(AV_WN64) &&  defined(AV_WB64)
-#       define AV_WN64(p, v) AV_WB64(p, v)
-#   endif
-
-#else /* AV_HAVE_BIGENDIAN */
-
-#   if    defined(AV_RN16) && !defined(AV_RL16)
-#       define AV_RL16(p) AV_RN16(p)
-#   elif !defined(AV_RN16) &&  defined(AV_RL16)
-#       define AV_RN16(p) AV_RL16(p)
-#   endif
-
-#   if    defined(AV_WN16) && !defined(AV_WL16)
-#       define AV_WL16(p, v) AV_WN16(p, v)
-#   elif !defined(AV_WN16) &&  defined(AV_WL16)
-#       define AV_WN16(p, v) AV_WL16(p, v)
-#   endif
-
-#   if    defined(AV_RN24) && !defined(AV_RL24)
-#       define AV_RL24(p) AV_RN24(p)
-#   elif !defined(AV_RN24) &&  defined(AV_RL24)
-#       define AV_RN24(p) AV_RL24(p)
-#   endif
-
-#   if    defined(AV_WN24) && !defined(AV_WL24)
-#       define AV_WL24(p, v) AV_WN24(p, v)
-#   elif !defined(AV_WN24) &&  defined(AV_WL24)
-#       define AV_WN24(p, v) AV_WL24(p, v)
-#   endif
-
-#   if    defined(AV_RN32) && !defined(AV_RL32)
-#       define AV_RL32(p) AV_RN32(p)
-#   elif !defined(AV_RN32) &&  defined(AV_RL32)
-#       define AV_RN32(p) AV_RL32(p)
-#   endif
-
-#   if    defined(AV_WN32) && !defined(AV_WL32)
-#       define AV_WL32(p, v) AV_WN32(p, v)
-#   elif !defined(AV_WN32) &&  defined(AV_WL32)
-#       define AV_WN32(p, v) AV_WL32(p, v)
-#   endif
-
-#   if    defined(AV_RN64) && !defined(AV_RL64)
-#       define AV_RL64(p) AV_RN64(p)
-#   elif !defined(AV_RN64) &&  defined(AV_RL64)
-#       define AV_RN64(p) AV_RL64(p)
-#   endif
-
-#   if    defined(AV_WN64) && !defined(AV_WL64)
-#       define AV_WL64(p, v) AV_WN64(p, v)
-#   elif !defined(AV_WN64) &&  defined(AV_WL64)
-#       define AV_WN64(p, v) AV_WL64(p, v)
-#   endif
-
-#endif /* !AV_HAVE_BIGENDIAN */
-
-/*
- * Define AV_[RW]N helper macros to simplify definitions not provided
- * by per-arch headers.
- */
-
-#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
-
-union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
-union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
-union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
-
-#   define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
-#   define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
-
-#elif defined(__DECC)
-
-#   define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
-#   define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
-
-#elif AV_HAVE_FAST_UNALIGNED
-
-#   define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
-#   define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
-
-#else
-
-#ifndef AV_RB16
-#   define AV_RB16(x)                           \
-    ((((const uint8_t*)(x))[0] << 8) |          \
-      ((const uint8_t*)(x))[1])
-#endif
-#ifndef AV_WB16
-#   define AV_WB16(p, d) do {                   \
-        ((uint8_t*)(p))[1] = (d);               \
-        ((uint8_t*)(p))[0] = (d)>>8;            \
-    } while(0)
-#endif
-
-#ifndef AV_RL16
-#   define AV_RL16(x)                           \
-    ((((const uint8_t*)(x))[1] << 8) |          \
-      ((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL16
-#   define AV_WL16(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-    } while(0)
-#endif
-
-#ifndef AV_RB32
-#   define AV_RB32(x)                           \
-    ((((const uint8_t*)(x))[0] << 24) |         \
-     (((const uint8_t*)(x))[1] << 16) |         \
-     (((const uint8_t*)(x))[2] <<  8) |         \
-      ((const uint8_t*)(x))[3])
-#endif
-#ifndef AV_WB32
-#   define AV_WB32(p, d) do {                   \
-        ((uint8_t*)(p))[3] = (d);               \
-        ((uint8_t*)(p))[2] = (d)>>8;            \
-        ((uint8_t*)(p))[1] = (d)>>16;           \
-        ((uint8_t*)(p))[0] = (d)>>24;           \
-    } while(0)
-#endif
-
-#ifndef AV_RL32
-#   define AV_RL32(x)                           \
-    ((((const uint8_t*)(x))[3] << 24) |         \
-     (((const uint8_t*)(x))[2] << 16) |         \
-     (((const uint8_t*)(x))[1] <<  8) |         \
-      ((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL32
-#   define AV_WL32(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[2] = (d)>>16;           \
-        ((uint8_t*)(p))[3] = (d)>>24;           \
-    } while(0)
-#endif
-
-#ifndef AV_RB64
-#   define AV_RB64(x)                                   \
-    (((uint64_t)((const uint8_t*)(x))[0] << 56) |       \
-     ((uint64_t)((const uint8_t*)(x))[1] << 48) |       \
-     ((uint64_t)((const uint8_t*)(x))[2] << 40) |       \
-     ((uint64_t)((const uint8_t*)(x))[3] << 32) |       \
-     ((uint64_t)((const uint8_t*)(x))[4] << 24) |       \
-     ((uint64_t)((const uint8_t*)(x))[5] << 16) |       \
-     ((uint64_t)((const uint8_t*)(x))[6] <<  8) |       \
-      (uint64_t)((const uint8_t*)(x))[7])
-#endif
-#ifndef AV_WB64
-#   define AV_WB64(p, d) do {                   \
-        ((uint8_t*)(p))[7] = (d);               \
-        ((uint8_t*)(p))[6] = (d)>>8;            \
-        ((uint8_t*)(p))[5] = (d)>>16;           \
-        ((uint8_t*)(p))[4] = (d)>>24;           \
-        ((uint8_t*)(p))[3] = (d)>>32;           \
-        ((uint8_t*)(p))[2] = (d)>>40;           \
-        ((uint8_t*)(p))[1] = (d)>>48;           \
-        ((uint8_t*)(p))[0] = (d)>>56;           \
-    } while(0)
-#endif
-
-#ifndef AV_RL64
-#   define AV_RL64(x)                                   \
-    (((uint64_t)((const uint8_t*)(x))[7] << 56) |       \
-     ((uint64_t)((const uint8_t*)(x))[6] << 48) |       \
-     ((uint64_t)((const uint8_t*)(x))[5] << 40) |       \
-     ((uint64_t)((const uint8_t*)(x))[4] << 32) |       \
-     ((uint64_t)((const uint8_t*)(x))[3] << 24) |       \
-     ((uint64_t)((const uint8_t*)(x))[2] << 16) |       \
-     ((uint64_t)((const uint8_t*)(x))[1] <<  8) |       \
-      (uint64_t)((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL64
-#   define AV_WL64(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[2] = (d)>>16;           \
-        ((uint8_t*)(p))[3] = (d)>>24;           \
-        ((uint8_t*)(p))[4] = (d)>>32;           \
-        ((uint8_t*)(p))[5] = (d)>>40;           \
-        ((uint8_t*)(p))[6] = (d)>>48;           \
-        ((uint8_t*)(p))[7] = (d)>>56;           \
-    } while(0)
-#endif
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_RN(s, p)    AV_RB##s(p)
-#   define AV_WN(s, p, v) AV_WB##s(p, v)
-#else
-#   define AV_RN(s, p)    AV_RL##s(p)
-#   define AV_WN(s, p, v) AV_WL##s(p, v)
-#endif
-
-#endif /* HAVE_FAST_UNALIGNED */
-
-#ifndef AV_RN16
-#   define AV_RN16(p) AV_RN(16, p)
-#endif
-
-#ifndef AV_RN32
-#   define AV_RN32(p) AV_RN(32, p)
-#endif
-
-#ifndef AV_RN64
-#   define AV_RN64(p) AV_RN(64, p)
-#endif
-
-#ifndef AV_WN16
-#   define AV_WN16(p, v) AV_WN(16, p, v)
-#endif
-
-#ifndef AV_WN32
-#   define AV_WN32(p, v) AV_WN(32, p, v)
-#endif
-
-#ifndef AV_WN64
-#   define AV_WN64(p, v) AV_WN(64, p, v)
-#endif
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_RB(s, p)    AV_RN##s(p)
-#   define AV_WB(s, p, v) AV_WN##s(p, v)
-#   define AV_RL(s, p)    av_bswap##s(AV_RN##s(p))
-#   define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
-#else
-#   define AV_RB(s, p)    av_bswap##s(AV_RN##s(p))
-#   define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
-#   define AV_RL(s, p)    AV_RN##s(p)
-#   define AV_WL(s, p, v) AV_WN##s(p, v)
-#endif
-
-#define AV_RB8(x)     (((const uint8_t*)(x))[0])
-#define AV_WB8(p, d)  do { ((uint8_t*)(p))[0] = (d); } while(0)
-
-#define AV_RL8(x)     AV_RB8(x)
-#define AV_WL8(p, d)  AV_WB8(p, d)
-
-#ifndef AV_RB16
-#   define AV_RB16(p)    AV_RB(16, p)
-#endif
-#ifndef AV_WB16
-#   define AV_WB16(p, v) AV_WB(16, p, v)
-#endif
-
-#ifndef AV_RL16
-#   define AV_RL16(p)    AV_RL(16, p)
-#endif
-#ifndef AV_WL16
-#   define AV_WL16(p, v) AV_WL(16, p, v)
-#endif
-
-#ifndef AV_RB32
-#   define AV_RB32(p)    AV_RB(32, p)
-#endif
-#ifndef AV_WB32
-#   define AV_WB32(p, v) AV_WB(32, p, v)
-#endif
-
-#ifndef AV_RL32
-#   define AV_RL32(p)    AV_RL(32, p)
-#endif
-#ifndef AV_WL32
-#   define AV_WL32(p, v) AV_WL(32, p, v)
-#endif
-
-#ifndef AV_RB64
-#   define AV_RB64(p)    AV_RB(64, p)
-#endif
-#ifndef AV_WB64
-#   define AV_WB64(p, v) AV_WB(64, p, v)
-#endif
-
-#ifndef AV_RL64
-#   define AV_RL64(p)    AV_RL(64, p)
-#endif
-#ifndef AV_WL64
-#   define AV_WL64(p, v) AV_WL(64, p, v)
-#endif
-
-#ifndef AV_RB24
-#   define AV_RB24(x)                           \
-    ((((const uint8_t*)(x))[0] << 16) |         \
-     (((const uint8_t*)(x))[1] <<  8) |         \
-      ((const uint8_t*)(x))[2])
-#endif
-#ifndef AV_WB24
-#   define AV_WB24(p, d) do {                   \
-        ((uint8_t*)(p))[2] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[0] = (d)>>16;           \
-    } while(0)
-#endif
-
-#ifndef AV_RL24
-#   define AV_RL24(x)                           \
-    ((((const uint8_t*)(x))[2] << 16) |         \
-     (((const uint8_t*)(x))[1] <<  8) |         \
-      ((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL24
-#   define AV_WL24(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[2] = (d)>>16;           \
-    } while(0)
-#endif
-
-/*
- * The AV_[RW]NA macros access naturally aligned data
- * in a type-safe way.
- */
-
-#define AV_RNA(s, p)    (((const av_alias##s*)(p))->u##s)
-#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
-
-#ifndef AV_RN16A
-#   define AV_RN16A(p) AV_RNA(16, p)
-#endif
-
-#ifndef AV_RN32A
-#   define AV_RN32A(p) AV_RNA(32, p)
-#endif
-
-#ifndef AV_RN64A
-#   define AV_RN64A(p) AV_RNA(64, p)
-#endif
-
-#ifndef AV_WN16A
-#   define AV_WN16A(p, v) AV_WNA(16, p, v)
-#endif
-
-#ifndef AV_WN32A
-#   define AV_WN32A(p, v) AV_WNA(32, p, v)
-#endif
-
-#ifndef AV_WN64A
-#   define AV_WN64A(p, v) AV_WNA(64, p, v)
-#endif
-
-/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
- * naturally aligned. They may be implemented using MMX,
- * so emms_c() must be called before using any float code
- * afterwards.
- */
-
-#define AV_COPY(n, d, s) \
-    (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
-
-#ifndef AV_COPY16
-#   define AV_COPY16(d, s) AV_COPY(16, d, s)
-#endif
-
-#ifndef AV_COPY32
-#   define AV_COPY32(d, s) AV_COPY(32, d, s)
-#endif
-
-#ifndef AV_COPY64
-#   define AV_COPY64(d, s) AV_COPY(64, d, s)
-#endif
-
-#ifndef AV_COPY128
-#   define AV_COPY128(d, s)                    \
-    do {                                       \
-        AV_COPY64(d, s);                       \
-        AV_COPY64((char*)(d)+8, (char*)(s)+8); \
-    } while(0)
-#endif
-
-#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
-
-#ifndef AV_SWAP64
-#   define AV_SWAP64(a, b) AV_SWAP(64, a, b)
-#endif
-
-#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
-
-#ifndef AV_ZERO16
-#   define AV_ZERO16(d) AV_ZERO(16, d)
-#endif
-
-#ifndef AV_ZERO32
-#   define AV_ZERO32(d) AV_ZERO(32, d)
-#endif
-
-#ifndef AV_ZERO64
-#   define AV_ZERO64(d) AV_ZERO(64, d)
-#endif
-
-#ifndef AV_ZERO128
-#   define AV_ZERO128(d)         \
-    do {                         \
-        AV_ZERO64(d);            \
-        AV_ZERO64((char*)(d)+8); \
-    } while(0)
-#endif
-
-#endif /* AVUTIL_INTREADWRITE_H */
diff --git a/ffmpeg 0.7/include/libavutil/lfg.h b/ffmpeg 0.7/include/libavutil/lfg.h
deleted file mode 100644 (file)
index 0e89ea3..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Lagged Fibonacci PRNG
- * Copyright (c) 2008 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LFG_H
-#define AVUTIL_LFG_H
-
-typedef struct {
-    unsigned int state[64];
-    int index;
-} AVLFG;
-
-void av_lfg_init(AVLFG *c, unsigned int seed);
-
-/**
- * Get the next random unsigned 32-bit number using an ALFG.
- *
- * Please also consider a simple LCG like state= state*1664525+1013904223,
- * it may be good enough and faster for your specific use case.
- */
-static inline unsigned int av_lfg_get(AVLFG *c){
-    c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
-    return c->state[c->index++ & 63];
-}
-
-/**
- * Get the next random unsigned 32-bit number using a MLFG.
- *
- * Please also consider av_lfg_get() above, it is faster.
- */
-static inline unsigned int av_mlfg_get(AVLFG *c){
-    unsigned int a= c->state[(c->index-55) & 63];
-    unsigned int b= c->state[(c->index-24) & 63];
-    return c->state[c->index++ & 63] = 2*a*b+a+b;
-}
-
-/**
- * Get the next two numbers generated by a Box-Muller Gaussian
- * generator using the random numbers issued by lfg.
- *
- * @param out[2] array where the two generated numbers are placed
- */
-void av_bmg_get(AVLFG *lfg, double out[2]);
-
-#endif /* AVUTIL_LFG_H */
diff --git a/ffmpeg 0.7/include/libavutil/log.h b/ffmpeg 0.7/include/libavutil/log.h
deleted file mode 100644 (file)
index c87125d..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LOG_H
-#define AVUTIL_LOG_H
-
-#include <stdarg.h>
-#include "avutil.h"
-
-/**
- * Describe the class of an AVClass context structure. That is an
- * arbitrary struct of which the first field is a pointer to an
- * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
- */
-typedef struct {
-    /**
-     * The name of the class; usually it is the same name as the
-     * context structure type to which the AVClass is associated.
-     */
-    const char* class_name;
-
-    /**
-     * A pointer to a function which returns the name of a context
-     * instance ctx associated with the class.
-     */
-    const char* (*item_name)(void* ctx);
-
-    /**
-     * a pointer to the first option specified in the class if any or NULL
-     *
-     * @see av_set_default_options()
-     */
-    const struct AVOption *option;
-
-    /**
-     * LIBAVUTIL_VERSION with which this structure was created.
-     * This is used to allow fields to be added without requiring major
-     * version bumps everywhere.
-     */
-
-    int version;
-
-    /**
-     * Offset in the structure where log_level_offset is stored.
-     * 0 means there is no such variable
-     */
-    int log_level_offset_offset;
-
-    /**
-     * Offset in the structure where a pointer to the parent context for loging is stored.
-     * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such
-     * parent context. And a av_log() implementation could then display the parent context
-     * can be NULL of course
-     */
-    int parent_log_context_offset;
-} AVClass;
-
-/* av_log API */
-
-#define AV_LOG_QUIET    -8
-
-/**
- * Something went really wrong and we will crash now.
- */
-#define AV_LOG_PANIC     0
-
-/**
- * Something went wrong and recovery is not possible.
- * For example, no header was found for a format which depends
- * on headers or an illegal combination of parameters is used.
- */
-#define AV_LOG_FATAL     8
-
-/**
- * Something went wrong and cannot losslessly be recovered.
- * However, not all future data is affected.
- */
-#define AV_LOG_ERROR    16
-
-/**
- * Something somehow does not look correct. This may or may not
- * lead to problems. An example would be the use of '-vstrict -2'.
- */
-#define AV_LOG_WARNING  24
-
-#define AV_LOG_INFO     32
-#define AV_LOG_VERBOSE  40
-
-/**
- * Stuff which is only useful for libav* developers.
- */
-#define AV_LOG_DEBUG    48
-
-/**
- * Send the specified message to the log if the level is less than or equal
- * to the current av_log_level. By default, all logging messages are sent to
- * stderr. This behavior can be altered by setting a different av_vlog callback
- * function.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param fmt The format string (printf-compatible) that specifies how
- * subsequent arguments are converted to output.
- * @see av_vlog
- */
-#ifdef __GNUC__
-void av_log(void *avcl, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-#else
-void av_log(void *avcl, int level, const char *fmt, ...);
-#endif
-
-void av_vlog(void *avcl, int level, const char *fmt, va_list);
-int av_log_get_level(void);
-void av_log_set_level(int);
-void av_log_set_callback(void (*)(void*, int, const char*, va_list));
-void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
-const char* av_default_item_name(void* ctx);
-
-/**
- * av_dlog macros
- * Useful to print debug messages that shouldn't get compiled in normally.
- */
-
-#ifdef DEBUG
-#    define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
-#else
-#    define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
-#endif
-
-/**
- * Skip repeated messages, this requires the user app to use av_log() instead of
- * (f)printf as the 2 would otherwise interfere and lead to
- * "Last message repeated x times" messages below (f)printf messages with some
- * bad luck.
- * Also to receive the last, "last repeated" line if any, the user app must
- * call av_log(NULL, AV_LOG_QUIET, ""); at the end
- */
-#define AV_LOG_SKIP_REPEATED 1
-void av_log_set_flags(int arg);
-
-#endif /* AVUTIL_LOG_H */
diff --git a/ffmpeg 0.7/include/libavutil/lzo.h b/ffmpeg 0.7/include/libavutil/lzo.h
deleted file mode 100644 (file)
index 6788054..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * LZO 1x decompression
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LZO_H
-#define AVUTIL_LZO_H
-
-#include <stdint.h>
-
-/** \defgroup errflags Error flags returned by av_lzo1x_decode
-  * \{ */
-//! end of the input buffer reached before decoding finished
-#define AV_LZO_INPUT_DEPLETED 1
-//! decoded data did not fit into output buffer
-#define AV_LZO_OUTPUT_FULL 2
-//! a reference to previously decoded data was wrong
-#define AV_LZO_INVALID_BACKPTR 4
-//! a non-specific error in the compressed bitstream
-#define AV_LZO_ERROR 8
-/** \} */
-
-#define AV_LZO_INPUT_PADDING 8
-#define AV_LZO_OUTPUT_PADDING 12
-
-/**
- * \brief Decodes LZO 1x compressed data.
- * \param out output buffer
- * \param outlen size of output buffer, number of bytes left are returned here
- * \param in input buffer
- * \param inlen size of input buffer, number of bytes left are returned here
- * \return 0 on success, otherwise a combination of the error flags above
- *
- * Make sure all buffers are appropriately padded, in must provide
- * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
- */
-int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
-
-/**
- * \brief deliberately overlapping memcpy implementation
- * \param dst destination buffer; must be padded with 12 additional bytes
- * \param back how many bytes back we start (the initial size of the overlapping window)
- * \param cnt number of bytes to copy, must be >= 0
- *
- * cnt > back is valid, this will copy the bytes we just copied,
- * thus creating a repeating pattern with a period length of back.
- */
-void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
-
-#endif /* AVUTIL_LZO_H */
diff --git a/ffmpeg 0.7/include/libavutil/mathematics.h b/ffmpeg 0.7/include/libavutil/mathematics.h
deleted file mode 100644 (file)
index 882a516..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MATHEMATICS_H
-#define AVUTIL_MATHEMATICS_H
-
-#include <stdint.h>
-#include <math.h>
-#include "attributes.h"
-#include "rational.h"
-
-#ifndef M_E
-#define M_E            2.7182818284590452354   /* e */
-#endif
-#ifndef M_LN2
-#define M_LN2          0.69314718055994530942  /* log_e 2 */
-#endif
-#ifndef M_LN10
-#define M_LN10         2.30258509299404568402  /* log_e 10 */
-#endif
-#ifndef M_LOG2_10
-#define M_LOG2_10      3.32192809488736234787  /* log_2 10 */
-#endif
-#ifndef M_PHI
-#define M_PHI          1.61803398874989484820   /* phi / golden ratio */
-#endif
-#ifndef M_PI
-#define M_PI           3.14159265358979323846  /* pi */
-#endif
-#ifndef M_SQRT1_2
-#define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2) */
-#endif
-#ifndef M_SQRT2
-#define M_SQRT2        1.41421356237309504880  /* sqrt(2) */
-#endif
-#ifndef NAN
-#define NAN            (0.0/0.0)
-#endif
-#ifndef INFINITY
-#define INFINITY       (1.0/0.0)
-#endif
-
-enum AVRounding {
-    AV_ROUND_ZERO     = 0, ///< Round toward zero.
-    AV_ROUND_INF      = 1, ///< Round away from zero.
-    AV_ROUND_DOWN     = 2, ///< Round toward -infinity.
-    AV_ROUND_UP       = 3, ///< Round toward +infinity.
-    AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
-};
-
-/**
- * Return the greatest common divisor of a and b.
- * If both a and b are 0 or either or both are <0 then behavior is
- * undefined.
- */
-int64_t av_const av_gcd(int64_t a, int64_t b);
-
-/**
- * Rescale a 64-bit integer with rounding to nearest.
- * A simple a*b/c isn't possible as it can overflow.
- */
-int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
-
-/**
- * Rescale a 64-bit integer with specified rounding.
- * A simple a*b/c isn't possible as it can overflow.
- */
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
-
-/**
- * Rescale a 64-bit integer by 2 rational numbers.
- */
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
-
-/**
- * Compare 2 timestamps each in its own timebases.
- * The result of the function is undefined if one of the timestamps
- * is outside the int64_t range when represented in the others timebase.
- * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
- */
-int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
-
-/**
- * Compare 2 integers modulo mod.
- * That is we compare integers a and b for which only the least
- * significant log2(mod) bits are known.
- *
- * @param mod must be a power of 2
- * @return a negative value if a is smaller than b
- *         a positive value if a is greater than b
- *         0                if a equals          b
- */
-int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
-
-#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/ffmpeg 0.7/include/libavutil/md5.h b/ffmpeg 0.7/include/libavutil/md5.h
deleted file mode 100644 (file)
index 969202a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MD5_H
-#define AVUTIL_MD5_H
-
-#include <stdint.h>
-
-extern const int av_md5_size;
-
-struct AVMD5;
-
-void av_md5_init(struct AVMD5 *ctx);
-void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
-void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
-
-#endif /* AVUTIL_MD5_H */
-
diff --git a/ffmpeg 0.7/include/libavutil/mem.h b/ffmpeg 0.7/include/libavutil/mem.h
deleted file mode 100644 (file)
index 7c30e16..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * memory handling functions
- */
-
-#ifndef AVUTIL_MEM_H
-#define AVUTIL_MEM_H
-
-#include "attributes.h"
-#include "avutil.h"
-
-#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
-#elif defined(__TI_COMPILER_VERSION__)
-    #define DECLARE_ALIGNED(n,t,v)                      \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        t __attribute__((aligned(n))) v
-    #define DECLARE_ASM_CONST(n,t,v)                    \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        static const t __attribute__((aligned(n))) v
-#elif defined(__GNUC__)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
-#elif defined(_MSC_VER)
-    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
-    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
-#else
-    #define DECLARE_ALIGNED(n,t,v)      t v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t v
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-    #define av_malloc_attrib __attribute__((__malloc__))
-#else
-    #define av_malloc_attrib
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,3)
-    #define av_alloc_size(n) __attribute__((alloc_size(n)))
-#else
-    #define av_alloc_size(n)
-#endif
-
-/**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU).
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_mallocz()
- */
-void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Allocate or reallocate a block of memory.
- * If ptr is NULL and size > 0, allocate a new block. If
- * size is zero, free the memory block pointed to by ptr.
- * @param size Size in bytes for the memory block to be allocated or
- * reallocated.
- * @param ptr Pointer to a memory block already allocated with
- * av_malloc(z)() or av_realloc() or NULL.
- * @return Pointer to a newly reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory block.
- * @see av_fast_realloc()
- */
-void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
-
-/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc().
- * @param ptr Pointer to the memory block which should be freed.
- * @note ptr = NULL is explicitly allowed.
- * @note It is recommended that you use av_freep() instead.
- * @see av_freep()
- */
-void av_free(void *ptr);
-
-/**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU) and
- * zero all the bytes of the block.
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if it cannot be allocated.
- * @see av_malloc()
- */
-void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Duplicate the string s.
- * @param s string to be duplicated
- * @return Pointer to a newly allocated string containing a
- * copy of s or NULL if the string cannot be allocated.
- */
-char *av_strdup(const char *s) av_malloc_attrib;
-
-/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc() and set the pointer pointing to it to NULL.
- * @param ptr Pointer to the pointer to the memory block which should
- * be freed.
- * @see av_free()
- */
-void av_freep(void *ptr);
-
-/**
- * Add an element to a dynamic array.
- *
- * @param tab_ptr Pointer to the array.
- * @param nb_ptr  Pointer to the number of elements in the array.
- * @param elem    Element to be added.
- */
-void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
-
-#endif /* AVUTIL_MEM_H */
diff --git a/ffmpeg 0.7/include/libavutil/opt.h b/ffmpeg 0.7/include/libavutil/opt.h
deleted file mode 100644 (file)
index c967ed5..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * AVOptions
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_OPT_H
-#define AVUTIL_OPT_H
-
-/**
- * @file
- * AVOptions
- */
-
-#include "rational.h"
-#include "avutil.h"
-
-enum AVOptionType{
-    FF_OPT_TYPE_FLAGS,
-    FF_OPT_TYPE_INT,
-    FF_OPT_TYPE_INT64,
-    FF_OPT_TYPE_DOUBLE,
-    FF_OPT_TYPE_FLOAT,
-    FF_OPT_TYPE_STRING,
-    FF_OPT_TYPE_RATIONAL,
-    FF_OPT_TYPE_BINARY,  ///< offset must point to a pointer immediately followed by an int for the length
-    FF_OPT_TYPE_CONST=128,
-};
-
-/**
- * AVOption
- */
-typedef struct AVOption {
-    const char *name;
-
-    /**
-     * short English help text
-     * @todo What about other languages?
-     */
-    const char *help;
-
-    /**
-     * The offset relative to the context structure where the option
-     * value is stored. It should be 0 for named constants.
-     */
-    int offset;
-    enum AVOptionType type;
-
-    /**
-     * the default value for scalar options
-     */
-    union {
-        double dbl;
-        const char *str;
-        /* TODO those are unused now */
-        int64_t i64;
-        AVRational q;
-    } default_val;
-    double min;                 ///< minimum valid value for the option
-    double max;                 ///< maximum valid value for the option
-
-    int flags;
-#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM     8
-#define AV_OPT_FLAG_VIDEO_PARAM     16
-#define AV_OPT_FLAG_SUBTITLE_PARAM  32
-//FIXME think about enc-audio, ... style flags
-
-    /**
-     * The logical unit to which the option belongs. Non-constant
-     * options and corresponding named constants share the same
-     * unit. May be NULL.
-     */
-    const char *unit;
-} AVOption;
-
-/**
- * Look for an option in obj. Look only for the options which
- * have the flags set as specified in mask and flags (that is,
- * for which it is the case that opt->flags & mask == flags).
- *
- * @param[in] obj a pointer to a struct whose first element is a
- * pointer to an AVClass
- * @param[in] name the name of the option to look for
- * @param[in] unit the unit of the option to look for, or any if NULL
- * @return a pointer to the option found, or NULL if no option
- * has been found
- */
-const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
-
-/**
- * Set the field of obj with the given name to value.
- *
- * @param[in] obj A struct whose first element is a pointer to an
- * AVClass.
- * @param[in] name the name of the field to set
- * @param[in] val The value to set. If the field is not of a string
- * type, then the given string is parsed.
- * SI postfixes and some named scalars are supported.
- * If the field is of a numeric type, it has to be a numeric or named
- * scalar. Behavior with more than one scalar and +- infix operators
- * is undefined.
- * If the field is of a flags type, it has to be a sequence of numeric
- * scalars or named flags separated by '+' or '-'. Prefixing a flag
- * with '+' causes it to be set without affecting the other flags;
- * similarly, '-' unsets a flag.
- * @param[out] o_out if non-NULL put here a pointer to the AVOption
- * found
- * @param alloc when 1 then the old value will be av_freed() and the
- *                     new av_strduped()
- *              when 0 then no av_free() nor av_strdup() will be used
- * @return 0 if the value has been set, or an AVERROR code in case of
- * error:
- * AVERROR(ENOENT) if no matching option exists
- * AVERROR(ERANGE) if the value is out of range
- * AVERROR(EINVAL) if the value is not valid
- */
-int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
-
-const AVOption *av_set_double(void *obj, const char *name, double n);
-const AVOption *av_set_q(void *obj, const char *name, AVRational n);
-const AVOption *av_set_int(void *obj, const char *name, int64_t n);
-double av_get_double(void *obj, const char *name, const AVOption **o_out);
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
-const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
-const AVOption *av_next_option(void *obj, const AVOption *last);
-
-/**
- * Show the obj options.
- *
- * @param req_flags requested flags for the options to show. Show only the
- * options for which it is opt->flags & req_flags.
- * @param rej_flags rejected flags for the options to show. Show only the
- * options for which it is !(opt->flags & req_flags).
- * @param av_log_obj log context to use for showing the options
- */
-int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
-
-void av_opt_set_defaults(void *s);
-void av_opt_set_defaults2(void *s, int mask, int flags);
-
-/**
- * Parse the key/value pairs list in opts. For each key/value pair
- * found, stores the value in the field in ctx that is named like the
- * key. ctx must be an AVClass context, storing is done using
- * AVOptions.
- *
- * @param key_val_sep a 0-terminated list of characters used to
- * separate key from value
- * @param pairs_sep a 0-terminated list of characters used to separate
- * two pairs from each other
- * @return the number of successfully set key/value pairs, or a negative
- * value corresponding to an AVERROR code in case of error:
- * AVERROR(EINVAL) if opts cannot be parsed,
- * the error code issued by av_set_string3() if a key/value pair
- * cannot be set
- */
-int av_set_options_string(void *ctx, const char *opts,
-                          const char *key_val_sep, const char *pairs_sep);
-
-/**
- * Free all string and binary options in obj.
- */
-void av_opt_free(void *obj);
-
-#endif /* AVUTIL_OPT_H */
diff --git a/ffmpeg 0.7/include/libavutil/parseutils.h b/ffmpeg 0.7/include/libavutil/parseutils.h
deleted file mode 100644 (file)
index d31212e..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PARSEUTILS_H
-#define AVUTIL_PARSEUTILS_H
-
-#include "rational.h"
-
-/**
- * @file
- * misc parsing utilities
- */
-
-/**
- * Parse str and put in width_ptr and height_ptr the detected values.
- *
- * @param[in,out] width_ptr pointer to the variable which will contain the detected
- * width value
- * @param[in,out] height_ptr pointer to the variable which will contain the detected
- * height value
- * @param[in] str the string to parse: it has to be a string in the format
- * width x height or a valid video size abbreviation.
- * @return >= 0 on success, a negative error code otherwise
- */
-int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
-
-/**
- * Parse str and store the detected values in *rate.
- *
- * @param[in,out] rate pointer to the AVRational which will contain the detected
- * frame rate
- * @param[in] str the string to parse: it has to be a string in the format
- * rate_num / rate_den, a float number or a valid video rate abbreviation
- * @return >= 0 on success, a negative error code otherwise
- */
-int av_parse_video_rate(AVRational *rate, const char *str);
-
-/**
- * Put the RGBA values that correspond to color_string in rgba_color.
- *
- * @param color_string a string specifying a color. It can be the name of
- * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
- * possibly followed by "@" and a string representing the alpha
- * component.
- * The alpha component may be a string composed by "0x" followed by an
- * hexadecimal number or a decimal number between 0.0 and 1.0, which
- * represents the opacity value (0x00/0.0 means completely transparent,
- * 0xff/1.0 completely opaque).
- * If the alpha component is not specified then 0xff is assumed.
- * The string "random" will result in a random color.
- * @param slen length of the initial part of color_string containing the
- * color. It can be set to -1 if color_string is a null terminated string
- * containing nothing else than the color.
- * @return >= 0 in case of success, a negative value in case of
- * failure (for example if color_string cannot be parsed).
- */
-int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
-                   void *log_ctx);
-
-/**
- * Parses timestr and returns in *time a corresponding number of
- * microseconds.
- *
- * @param timeval puts here the number of microseconds corresponding
- * to the string in timestr. If the string represents a duration, it
- * is the number of microseconds contained in the time interval.  If
- * the string is a date, is the number of microseconds since 1st of
- * January, 1970 up to the time of the parsed date.  If timestr cannot
- * be successfully parsed, set *time to INT64_MIN.
-
- * @param datestr a string representing a date or a duration.
- * - If a date the syntax is:
- * @code
- * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
- * now
- * @endcode
- * If the value is "now" it takes the current time.
- * Time is local time unless Z is appended, in which case it is
- * interpreted as UTC.
- * If the year-month-day part is not specified it takes the current
- * year-month-day.
- * - If a duration the syntax is:
- * @code
- * [-]HH[:MM[:SS[.m...]]]
- * [-]S+[.m...]
- * @endcode
- * @param duration flag which tells how to interpret timestr, if not
- * zero timestr is interpreted as a duration, otherwise as a date
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_parse_time(int64_t *timeval, const char *timestr, int duration);
-
-/**
- * Attempt to find a specific tag in a URL.
- *
- * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
- * Return 1 if found.
- */
-int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
-
-#endif /* AVUTIL_PARSEUTILS_H */
diff --git a/ffmpeg 0.7/include/libavutil/pixdesc.h b/ffmpeg 0.7/include/libavutil/pixdesc.h
deleted file mode 100644 (file)
index f0de998..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * pixel format descriptor
- * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXDESC_H
-#define AVUTIL_PIXDESC_H
-
-#include <inttypes.h>
-#include "pixfmt.h"
-
-typedef struct AVComponentDescriptor{
-    uint16_t plane        :2;            ///< which of the 4 planes contains the component
-
-    /**
-     * Number of elements between 2 horizontally consecutive pixels minus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t step_minus1  :3;
-
-    /**
-     * Number of elements before the component of the first pixel plus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t offset_plus1 :3;
-    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
-    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
-}AVComponentDescriptor;
-
-/**
- * Descriptor that unambiguously describes how the bits of a pixel are
- * stored in the up to 4 data planes of an image. It also stores the
- * subsampling factors and number of components.
- *
- * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
- *       and all the YUV variants) AVPixFmtDescriptor just stores how values
- *       are stored not what these values represent.
- */
-typedef struct AVPixFmtDescriptor{
-    const char *name;
-    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
-
-    /**
-     * Amount to shift the luma width right to find the chroma width.
-     * For YV12 this is 1 for example.
-     * chroma_width = -((-luma_width) >> log2_chroma_w)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
-
-    /**
-     * Amount to shift the luma height right to find the chroma height.
-     * For YV12 this is 1 for example.
-     * chroma_height= -((-luma_height) >> log2_chroma_h)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_h;
-    uint8_t flags;
-
-    /**
-     * Parameters that describe how pixels are packed. If the format
-     * has chroma components, they must be stored in comp[1] and
-     * comp[2].
-     */
-    AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
-
-#define PIX_FMT_BE        1 ///< Pixel format is big-endian.
-#define PIX_FMT_PAL       2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
-#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
-#define PIX_FMT_HWACCEL   8 ///< Pixel format is an HW accelerated format.
-
-/**
- * The array of all the pixel format descriptors.
- */
-extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-
-/**
- * Read a line from an image, and write the values of the
- * pixel format component c to dst.
- *
- * @param data the array containing the pointers to the planes of the image
- * @param linesize the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to read
- * @param y the vertical coordinate of the first pixel to read
- * @param w the width of the line to read, that is the number of
- * values to write to dst
- * @param read_pal_component if not zero and the format is a paletted
- * format writes the values corresponding to the palette
- * component c in data[1] to dst, rather than the palette indexes in
- * data[0]. The behavior is undefined if the format is not paletted.
- */
-void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
-                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
-
-/**
- * Write the values from src to the pixel format component c of an
- * image line.
- *
- * @param src array containing the values to write
- * @param data the array containing the pointers to the planes of the
- * image to write into. It is supposed to be zeroed.
- * @param linesize the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to write
- * @param y the vertical coordinate of the first pixel to write
- * @param w the width of the line to write, that is the number of
- * values to write to the image line
- */
-void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
-                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
-
-/**
- * Return the pixel format corresponding to name.
- *
- * If there is no pixel format with name name, then looks for a
- * pixel format with the name corresponding to the native endian
- * format of name.
- * For example in a little-endian system, first looks for "gray16",
- * then for "gray16le".
- *
- * Finally if no pixel format has been found, returns PIX_FMT_NONE.
- */
-enum PixelFormat av_get_pix_fmt(const char *name);
-
-/**
- * Return the short name for a pixel format, NULL in case pix_fmt is
- * unknown.
- *
- * @see av_get_pix_fmt(), av_get_pix_fmt_string()
- */
-const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);
-
-/**
- * Print in buf the string corresponding to the pixel format with
- * number pix_fmt, or an header if pix_fmt is negative.
- *
- * @param buf the buffer where to write the string
- * @param buf_size the size of buf
- * @param pix_fmt the number of the pixel format to print the
- * corresponding info string, or a negative value to print the
- * corresponding header.
- */
-char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
-
-/**
- * Return the number of bits per pixel used by the pixel format
- * described by pixdesc.
- *
- * The returned number of bits refers to the number of bits actually
- * used for storing the pixel information, that is padding bits are
- * not counted.
- */
-int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
-
-#endif /* AVUTIL_PIXDESC_H */
diff --git a/ffmpeg 0.7/include/libavutil/pixfmt.h b/ffmpeg 0.7/include/libavutil/pixfmt.h
deleted file mode 100644 (file)
index 6e4f161..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXFMT_H
-#define AVUTIL_PIXFMT_H
-
-/**
- * @file
- * pixel format definitions
- *
- * @warning This file has to be considered an internal but installed
- * header, so it should not be directly included in your projects.
- */
-
-#include "libavutil/avconfig.h"
-
-/**
- * Pixel format. Notes:
- *
- * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
- * color is put together as:
- *  (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little-endian CPU architectures and ARGB on
- * big-endian CPUs.
- *
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- *
- * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
- * for pal8. This palette is filled in automatically by the function
- * allocating the picture.
- *
- * Note, make sure that all newly added big endian formats have pix_fmt&1==1
- *       and that all newly added little endian formats have pix_fmt&1==0
- *       this allows simpler detection of big vs little endian.
- */
-enum PixelFormat {
-    PIX_FMT_NONE= -1,
-    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
-    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
-    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
-    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
-    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
-    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
-    PIX_FMT_XVMC_MPEG2_IDCT,
-    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
-    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
-    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
-    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
-    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
-    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
-    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
-    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
-    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    PIX_FMT_GRAY8A,    ///< 8bit gray, 8bit alpha
-    PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-
-    //the following 6 formats have the disadvantage of needing 1 format for each bit depth, thus
-    //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately
-    //is better
-    PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-
-    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-};
-
-#define PIX_FMT_Y400A PIX_FMT_GRAY8A
-
-#if AV_HAVE_BIGENDIAN
-#   define PIX_FMT_NE(be, le) PIX_FMT_##be
-#else
-#   define PIX_FMT_NE(be, le) PIX_FMT_##le
-#endif
-
-#define PIX_FMT_RGB32   PIX_FMT_NE(ARGB, BGRA)
-#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
-#define PIX_FMT_BGR32   PIX_FMT_NE(ABGR, RGBA)
-#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
-
-#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
-#define PIX_FMT_RGB48  PIX_FMT_NE(RGB48BE,  RGB48LE)
-#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
-#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
-#define PIX_FMT_RGB444 PIX_FMT_NE(RGB444BE, RGB444LE)
-#define PIX_FMT_BGR48  PIX_FMT_NE(BGR48BE,  BGR48LE)
-#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
-#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
-#define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE)
-
-#define PIX_FMT_YUV420P9  PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
-#define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
-#define PIX_FMT_YUV422P10 PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
-#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
-#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
-#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
-
-#endif /* AVUTIL_PIXFMT_H */
diff --git a/ffmpeg 0.7/include/libavutil/random_seed.h b/ffmpeg 0.7/include/libavutil/random_seed.h
deleted file mode 100644 (file)
index 7f75063..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier@gmail.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_RANDOM_SEED_H
-#define AVUTIL_RANDOM_SEED_H
-
-#include <stdint.h>
-
-/**
- * Get a seed to use in conjunction with random functions.
- */
-uint32_t av_get_random_seed(void);
-
-#endif /* AVUTIL_RANDOM_SEED_H */
diff --git a/ffmpeg 0.7/include/libavutil/rational.h b/ffmpeg 0.7/include/libavutil/rational.h
deleted file mode 100644 (file)
index 789e4ac..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * rational numbers
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef AVUTIL_RATIONAL_H
-#define AVUTIL_RATIONAL_H
-
-#include <stdint.h>
-#include <limits.h>
-#include "attributes.h"
-
-/**
- * rational number numerator/denominator
- */
-typedef struct AVRational{
-    int num; ///< numerator
-    int den; ///< denominator
-} AVRational;
-
-/**
- * Compare two rationals.
- * @param a first rational
- * @param b second rational
- * @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
- * values is of the form 0/0
- */
-static inline int av_cmp_q(AVRational a, AVRational b){
-    const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
-
-    if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
-    else if(b.den && a.den) return 0;
-    else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
-    else                    return INT_MIN;
-}
-
-/**
- * Convert rational to double.
- * @param a rational to convert
- * @return (double) a
- */
-static inline double av_q2d(AVRational a){
-    return a.num / (double) a.den;
-}
-
-/**
- * Reduce a fraction.
- * This is useful for framerate calculations.
- * @param dst_num destination numerator
- * @param dst_den destination denominator
- * @param num source numerator
- * @param den source denominator
- * @param max the maximum allowed for dst_num & dst_den
- * @return 1 if exact, 0 otherwise
- */
-int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
-
-/**
- * Multiply two rationals.
- * @param b first rational
- * @param c second rational
- * @return b*c
- */
-AVRational av_mul_q(AVRational b, AVRational c) av_const;
-
-/**
- * Divide one rational by another.
- * @param b first rational
- * @param c second rational
- * @return b/c
- */
-AVRational av_div_q(AVRational b, AVRational c) av_const;
-
-/**
- * Add two rationals.
- * @param b first rational
- * @param c second rational
- * @return b+c
- */
-AVRational av_add_q(AVRational b, AVRational c) av_const;
-
-/**
- * Subtract one rational from another.
- * @param b first rational
- * @param c second rational
- * @return b-c
- */
-AVRational av_sub_q(AVRational b, AVRational c) av_const;
-
-/**
- * Convert a double precision floating point number to a rational.
- * inf is expressed as {1,0} or {-1,0} depending on the sign.
- *
- * @param d double to convert
- * @param max the maximum allowed numerator and denominator
- * @return (AVRational) d
- */
-AVRational av_d2q(double d, int max) av_const;
-
-/**
- * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
- * than q1, 0 if they have the same distance.
- */
-int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
-
-/**
- * Find the nearest value in q_list to q.
- * @param q_list an array of rationals terminated by {0, 0}
- * @return the index of the nearest value found in the array
- */
-int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
-
-#endif /* AVUTIL_RATIONAL_H */
diff --git a/ffmpeg 0.7/include/libavutil/samplefmt.h b/ffmpeg 0.7/include/libavutil/samplefmt.h
deleted file mode 100644 (file)
index b06755d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_SAMPLEFMT_H
-#define AVUTIL_SAMPLEFMT_H
-
-#include "avutil.h"
-
-/**
- * all in native-endian format
- */
-enum AVSampleFormat {
-    AV_SAMPLE_FMT_NONE = -1,
-    AV_SAMPLE_FMT_U8,          ///< unsigned 8 bits
-    AV_SAMPLE_FMT_S16,         ///< signed 16 bits
-    AV_SAMPLE_FMT_S32,         ///< signed 32 bits
-    AV_SAMPLE_FMT_FLT,         ///< float
-    AV_SAMPLE_FMT_DBL,         ///< double
-    AV_SAMPLE_FMT_NB           ///< Number of sample formats. DO NOT USE if linking dynamically
-};
-
-/**
- * Return the name of sample_fmt, or NULL if sample_fmt is not
- * recognized.
- */
-const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
-
-/**
- * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
- * on error.
- */
-enum AVSampleFormat av_get_sample_fmt(const char *name);
-
-/**
- * Generate a string corresponding to the sample format with
- * sample_fmt, or a header if sample_fmt is negative.
- *
- * @param buf the buffer where to write the string
- * @param buf_size the size of buf
- * @param sample_fmt the number of the sample format to print the
- * corresponding info string, or a negative value to print the
- * corresponding header.
- * @return the pointer to the filled buffer or NULL if sample_fmt is
- * unknown or in case of other errors
- */
-char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
-
-#if FF_API_GET_BITS_PER_SAMPLE_FMT
-/**
- * @deprecated Use av_get_bytes_per_sample() instead.
- */
-attribute_deprecated
-int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
-#endif
-
-/**
- * Return number of bytes per sample.
- *
- * @param sample_fmt the sample format
- * @return number of bytes per sample or zero if unknown for the given
- * sample format
- */
-int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
-
-/**
- * Fill channel data pointers and linesizes for samples with sample
- * format sample_fmt.
- *
- * The pointers array is filled with the pointers to the samples data:
- * for planar, set the start point of each plane's data within the buffer,
- * for packed, set the start point of the entire buffer only.
- *
- * The linesize array is filled with the aligned size of each samples
- * plane, that is linesize[i] will contain the linesize of the plane i,
- * and will be zero for all the unused planes. All linesize values are
- * equal.
- *
- * @param pointers array to be filled with the pointer for each plane, may be NULL
- * @param linesizes array to be filled with the linesize, may be NULL
- * @param buf the pointer to a buffer containing the samples
- * @param nb_samples the number of samples in a single channel
- * @param planar 1 if the samples layout is planar, 0 if it is packed
- * @param nb_channels the number of channels
- * @return the total size of the buffer, a negative
- * error code in case of failure
- */
-int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8],
-                           uint8_t *buf, int nb_channels, int nb_samples,
-                           enum AVSampleFormat sample_fmt, int planar, int align);
-
-/**
- * Allocate a samples buffer for nb_samples samples, and
- * fill pointers and linesizes accordingly.
- * The allocated samples buffer has to be freed by using
- * av_freep(&pointers[0]).
- *
- * @param nb_channels number of audio channels
- * @param nb_samples number of samples per channel
- * @param planar 1 if the samples layout is planar, 0 if packed,
- * @param align the value to use for buffer size alignment
- * @return the size in bytes required for the samples buffer, a negative
- * error code in case of failure
- * @see av_samples_fill_arrays()
- */
-int av_samples_alloc(uint8_t *pointers[8], int linesizes[8],
-                     int nb_channels, int nb_samples,
-                     enum AVSampleFormat sample_fmt, int planar,
-                     int align);
-
-#endif /* AVCORE_SAMPLEFMT_H */
diff --git a/ffmpeg 0.7/include/libavutil/sha.h b/ffmpeg 0.7/include/libavutil/sha.h
deleted file mode 100644 (file)
index 543f5a1..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_SHA_H
-#define AVUTIL_SHA_H
-
-#include <stdint.h>
-
-extern const int av_sha_size;
-
-struct AVSHA;
-
-/**
- * Initialize SHA-1 or SHA-2 hashing.
- *
- * @param context pointer to the function context (of size av_sha_size)
- * @param bits    number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
- * @return        zero if initialization succeeded, -1 otherwise
- */
-int av_sha_init(struct AVSHA* context, int bits);
-
-/**
- * Update hash value.
- *
- * @param context hash function context
- * @param data    input data to update hash with
- * @param len     input data length
- */
-void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
-
-/**
- * Finish hashing and output digest value.
- *
- * @param context hash function context
- * @param digest  buffer where output digest value is stored
- */
-void av_sha_final(struct AVSHA* context, uint8_t *digest);
-
-#endif /* AVUTIL_SHA_H */
diff --git a/ffmpeg 0.7/include/libpostproc/postprocess.h b/ffmpeg 0.7/include/libpostproc/postprocess.h
deleted file mode 100644 (file)
index 0713c47..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef POSTPROC_POSTPROCESS_H
-#define POSTPROC_POSTPROCESS_H
-
-/**
- * @file
- * @brief
- *     external postprocessing API
- */
-
-#include "libavutil/avutil.h"
-
-#define LIBPOSTPROC_VERSION_MAJOR 51
-#define LIBPOSTPROC_VERSION_MINOR  2
-#define LIBPOSTPROC_VERSION_MICRO  0
-
-#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
-                                               LIBPOSTPROC_VERSION_MINOR, \
-                                               LIBPOSTPROC_VERSION_MICRO)
-#define LIBPOSTPROC_VERSION     AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
-                                           LIBPOSTPROC_VERSION_MINOR, \
-                                           LIBPOSTPROC_VERSION_MICRO)
-#define LIBPOSTPROC_BUILD       LIBPOSTPROC_VERSION_INT
-
-#define LIBPOSTPROC_IDENT       "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
-
-/**
- * Return the LIBPOSTPROC_VERSION_INT constant.
- */
-unsigned postproc_version(void);
-
-/**
- * Return the libpostproc build-time configuration.
- */
-const char *postproc_configuration(void);
-
-/**
- * Return the libpostproc license.
- */
-const char *postproc_license(void);
-
-#define PP_QUALITY_MAX 6
-
-#define QP_STORE_T int8_t
-
-#include <inttypes.h>
-
-typedef void pp_context;
-typedef void pp_mode;
-
-#if LIBPOSTPROC_VERSION_INT < (52<<16)
-typedef pp_context pp_context_t;
-typedef pp_mode pp_mode_t;
-extern const char *const pp_help; ///< a simple help text
-#else
-extern const char pp_help[]; ///< a simple help text
-#endif
-
-void  pp_postprocess(const uint8_t * src[3], const int srcStride[3],
-                     uint8_t * dst[3], const int dstStride[3],
-                     int horizontalSize, int verticalSize,
-                     const QP_STORE_T *QP_store,  int QP_stride,
-                     pp_mode *mode, pp_context *ppContext, int pict_type);
-
-
-/**
- * returns a pp_mode or NULL if an error occurred
- * name is the string after "-pp" on the command line
- * quality is a number from 0 to PP_QUALITY_MAX
- */
-pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality);
-void pp_free_mode(pp_mode *mode);
-
-pp_context *pp_get_context(int width, int height, int flags);
-void pp_free_context(pp_context *ppContext);
-
-#define PP_CPU_CAPS_MMX   0x80000000
-#define PP_CPU_CAPS_MMX2  0x20000000
-#define PP_CPU_CAPS_3DNOW 0x40000000
-#define PP_CPU_CAPS_ALTIVEC 0x10000000
-
-#define PP_FORMAT         0x00000008
-#define PP_FORMAT_420    (0x00000011|PP_FORMAT)
-#define PP_FORMAT_422    (0x00000001|PP_FORMAT)
-#define PP_FORMAT_411    (0x00000002|PP_FORMAT)
-#define PP_FORMAT_444    (0x00000000|PP_FORMAT)
-
-#define PP_PICT_TYPE_QP2  0x00000010 ///< MPEG2 style QScale
-
-#endif /* POSTPROC_POSTPROCESS_H */
diff --git a/ffmpeg 0.7/include/libswscale/swscale.h b/ffmpeg 0.7/include/libswscale/swscale.h
deleted file mode 100644 (file)
index e798773..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_SWSCALE_H
-#define SWSCALE_SWSCALE_H
-
-/**
- * @file
- * @brief
- *     external api for the swscale stuff
- */
-
-#include "libavutil/avutil.h"
-
-#define LIBSWSCALE_VERSION_MAJOR 0
-#define LIBSWSCALE_VERSION_MINOR 14
-#define LIBSWSCALE_VERSION_MICRO 1
-
-#define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
-                                               LIBSWSCALE_VERSION_MINOR, \
-                                               LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_VERSION      AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
-                                           LIBSWSCALE_VERSION_MINOR, \
-                                           LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_BUILD        LIBSWSCALE_VERSION_INT
-
-#define LIBSWSCALE_IDENT        "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
-
-/**
- * Those FF_API_* defines are not part of public API.
- * They may change, break or disappear at any time.
- */
-#ifndef FF_API_SWS_GETCONTEXT
-#define FF_API_SWS_GETCONTEXT  (LIBSWSCALE_VERSION_MAJOR < 2)
-#endif
-#ifndef FF_API_SWS_CPU_CAPS
-#define FF_API_SWS_CPU_CAPS    (LIBSWSCALE_VERSION_MAJOR < 2)
-#endif
-#ifndef FF_API_SWS_FORMAT_NAME
-#define FF_API_SWS_FORMAT_NAME  (LIBSWSCALE_VERSION_MAJOR < 2)
-#endif
-
-/**
- * Returns the LIBSWSCALE_VERSION_INT constant.
- */
-unsigned swscale_version(void);
-
-/**
- * Returns the libswscale build-time configuration.
- */
-const char *swscale_configuration(void);
-
-/**
- * Returns the libswscale license.
- */
-const char *swscale_license(void);
-
-/* values for the flags, the stuff on the command line is different */
-#define SWS_FAST_BILINEAR     1
-#define SWS_BILINEAR          2
-#define SWS_BICUBIC           4
-#define SWS_X                 8
-#define SWS_POINT          0x10
-#define SWS_AREA           0x20
-#define SWS_BICUBLIN       0x40
-#define SWS_GAUSS          0x80
-#define SWS_SINC          0x100
-#define SWS_LANCZOS       0x200
-#define SWS_SPLINE        0x400
-
-#define SWS_SRC_V_CHR_DROP_MASK     0x30000
-#define SWS_SRC_V_CHR_DROP_SHIFT    16
-
-#define SWS_PARAM_DEFAULT           123456
-
-#define SWS_PRINT_INFO              0x1000
-
-//the following 3 flags are not completely implemented
-//internal chrominace subsampling info
-#define SWS_FULL_CHR_H_INT    0x2000
-//input subsampling info
-#define SWS_FULL_CHR_H_INP    0x4000
-#define SWS_DIRECT_BGR        0x8000
-#define SWS_ACCURATE_RND      0x40000
-#define SWS_BITEXACT          0x80000
-
-#if FF_API_SWS_CPU_CAPS
-/**
- * CPU caps are autodetected now, those flags
- * are only provided for API compatibility.
- */
-#define SWS_CPU_CAPS_MMX      0x80000000
-#define SWS_CPU_CAPS_MMX2     0x20000000
-#define SWS_CPU_CAPS_3DNOW    0x40000000
-#define SWS_CPU_CAPS_ALTIVEC  0x10000000
-#define SWS_CPU_CAPS_BFIN     0x01000000
-#define SWS_CPU_CAPS_SSE2     0x02000000
-#endif
-
-#define SWS_MAX_REDUCE_CUTOFF 0.002
-
-#define SWS_CS_ITU709         1
-#define SWS_CS_FCC            4
-#define SWS_CS_ITU601         5
-#define SWS_CS_ITU624         5
-#define SWS_CS_SMPTE170M      5
-#define SWS_CS_SMPTE240M      7
-#define SWS_CS_DEFAULT        5
-
-/**
- * Returns a pointer to yuv<->rgb coefficients for the given colorspace
- * suitable for sws_setColorspaceDetails().
- *
- * @param colorspace One of the SWS_CS_* macros. If invalid,
- * SWS_CS_DEFAULT is used.
- */
-const int *sws_getCoefficients(int colorspace);
-
-
-// when used for filters they must have an odd number of elements
-// coeffs cannot be shared between vectors
-typedef struct {
-    double *coeff;              ///< pointer to the list of coefficients
-    int length;                 ///< number of coefficients in the vector
-} SwsVector;
-
-// vectors can be shared
-typedef struct {
-    SwsVector *lumH;
-    SwsVector *lumV;
-    SwsVector *chrH;
-    SwsVector *chrV;
-} SwsFilter;
-
-struct SwsContext;
-
-/**
- * Returns a positive value if pix_fmt is a supported input format, 0
- * otherwise.
- */
-int sws_isSupportedInput(enum PixelFormat pix_fmt);
-
-/**
- * Returns a positive value if pix_fmt is a supported output format, 0
- * otherwise.
- */
-int sws_isSupportedOutput(enum PixelFormat pix_fmt);
-
-/**
- * Allocates an empty SwsContext. This must be filled and passed to
- * sws_init_context(). For filling see AVOptions, options.c and
- * sws_setColorspaceDetails().
- */
-struct SwsContext *sws_alloc_context(void);
-
-/**
- * Initializes the swscaler context sws_context.
- *
- * @return zero or positive value on success, a negative value on
- * error
- */
-int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
-
-/**
- * Frees the swscaler context swsContext.
- * If swsContext is NULL, then does nothing.
- */
-void sws_freeContext(struct SwsContext *swsContext);
-
-#if FF_API_SWS_GETCONTEXT
-/**
- * Allocates and returns a SwsContext. You need it to perform
- * scaling/conversion operations using sws_scale().
- *
- * @param srcW the width of the source image
- * @param srcH the height of the source image
- * @param srcFormat the source image format
- * @param dstW the width of the destination image
- * @param dstH the height of the destination image
- * @param dstFormat the destination image format
- * @param flags specify which algorithm and options to use for rescaling
- * @return a pointer to an allocated context, or NULL in case of error
- * @note this function is to be removed after a saner alternative is
- *       written
- * @deprecated Use sws_getCachedContext() instead.
- */
-struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
-                                  int dstW, int dstH, enum PixelFormat dstFormat,
-                                  int flags, SwsFilter *srcFilter,
-                                  SwsFilter *dstFilter, const double *param);
-#endif
-
-/**
- * Scales the image slice in srcSlice and puts the resulting scaled
- * slice in the image in dst. A slice is a sequence of consecutive
- * rows in an image.
- *
- * Slices have to be provided in sequential order, either in
- * top-bottom or bottom-top order. If slices are provided in
- * non-sequential order the behavior of the function is undefined.
- *
- * @param context   the scaling context previously created with
- *                  sws_getContext()
- * @param srcSlice  the array containing the pointers to the planes of
- *                  the source slice
- * @param srcStride the array containing the strides for each plane of
- *                  the source image
- * @param srcSliceY the position in the source image of the slice to
- *                  process, that is the number (counted starting from
- *                  zero) in the image of the first row of the slice
- * @param srcSliceH the height of the source slice, that is the number
- *                  of rows in the slice
- * @param dst       the array containing the pointers to the planes of
- *                  the destination image
- * @param dstStride the array containing the strides for each plane of
- *                  the destination image
- * @return          the height of the output slice
- */
-int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[],
-              int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);
-
-#if LIBSWSCALE_VERSION_MAJOR < 1
-/**
- * @deprecated Use sws_scale() instead.
- */
-int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[],
-                      int srcStride[], int srcSliceY, int srcSliceH,
-                      uint8_t* dst[], int dstStride[]) attribute_deprecated;
-#endif
-
-/**
- * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
- * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
- * @return -1 if not supported
- */
-int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
-                             int srcRange, const int table[4], int dstRange,
-                             int brightness, int contrast, int saturation);
-
-/**
- * @return -1 if not supported
- */
-int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
-                             int *srcRange, int **table, int *dstRange,
-                             int *brightness, int *contrast, int *saturation);
-
-/**
- * Allocates and returns an uninitialized vector with length coefficients.
- */
-SwsVector *sws_allocVec(int length);
-
-/**
- * Returns a normalized Gaussian curve used to filter stuff
- * quality=3 is high quality, lower is lower quality.
- */
-SwsVector *sws_getGaussianVec(double variance, double quality);
-
-/**
- * Allocates and returns a vector with length coefficients, all
- * with the same value c.
- */
-SwsVector *sws_getConstVec(double c, int length);
-
-/**
- * Allocates and returns a vector with just one coefficient, with
- * value 1.0.
- */
-SwsVector *sws_getIdentityVec(void);
-
-/**
- * Scales all the coefficients of a by the scalar value.
- */
-void sws_scaleVec(SwsVector *a, double scalar);
-
-/**
- * Scales all the coefficients of a so that their sum equals height.
- */
-void sws_normalizeVec(SwsVector *a, double height);
-void sws_convVec(SwsVector *a, SwsVector *b);
-void sws_addVec(SwsVector *a, SwsVector *b);
-void sws_subVec(SwsVector *a, SwsVector *b);
-void sws_shiftVec(SwsVector *a, int shift);
-
-/**
- * Allocates and returns a clone of the vector a, that is a vector
- * with the same coefficients as a.
- */
-SwsVector *sws_cloneVec(SwsVector *a);
-
-#if LIBSWSCALE_VERSION_MAJOR < 1
-/**
- * @deprecated Use sws_printVec2() instead.
- */
-attribute_deprecated void sws_printVec(SwsVector *a);
-#endif
-
-/**
- * Prints with av_log() a textual representation of the vector a
- * if log_level <= av_log_level.
- */
-void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
-
-void sws_freeVec(SwsVector *a);
-
-SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
-                                float lumaSharpen, float chromaSharpen,
-                                float chromaHShift, float chromaVShift,
-                                int verbose);
-void sws_freeFilter(SwsFilter *filter);
-
-/**
- * Checks if context can be reused, otherwise reallocates a new
- * one.
- *
- * If context is NULL, just calls sws_getContext() to get a new
- * context. Otherwise, checks if the parameters are the ones already
- * saved in context. If that is the case, returns the current
- * context. Otherwise, frees context and gets a new context with
- * the new parameters.
- *
- * Be warned that srcFilter and dstFilter are not checked, they
- * are assumed to remain the same.
- */
-struct SwsContext *sws_getCachedContext(struct SwsContext *context,
-                                        int srcW, int srcH, enum PixelFormat srcFormat,
-                                        int dstW, int dstH, enum PixelFormat dstFormat,
-                                        int flags, SwsFilter *srcFilter,
-                                        SwsFilter *dstFilter, const double *param);
-
-/**
- * Converts an 8bit paletted frame into a frame with a color depth of 32-bits.
- *
- * The output frame will have the same packed format as the palette.
- *
- * @param src        source frame buffer
- * @param dst        destination frame buffer
- * @param num_pixels number of pixels to convert
- * @param palette    array with [256] entries, which must match color arrangement (RGB or BGR) of src
- */
-void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
-
-/**
- * Converts an 8bit paletted frame into a frame with a color depth of 24 bits.
- *
- * With the palette format "ABCD", the destination frame ends up with the format "ABC".
- *
- * @param src        source frame buffer
- * @param dst        destination frame buffer
- * @param num_pixels number of pixels to convert
- * @param palette    array with [256] entries, which must match color arrangement (RGB or BGR) of src
- */
-void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
-
-
-#endif /* SWSCALE_SWSCALE_H */
diff --git a/ffmpeg 0.7/lib/avcodec-53.dll b/ffmpeg 0.7/lib/avcodec-53.dll
deleted file mode 100644 (file)
index 5f9fbfe..0000000
Binary files a/ffmpeg 0.7/lib/avcodec-53.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avcodec.lib b/ffmpeg 0.7/lib/avcodec.lib
deleted file mode 100644 (file)
index 716dc44..0000000
Binary files a/ffmpeg 0.7/lib/avcodec.lib and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avdevice-53.dll b/ffmpeg 0.7/lib/avdevice-53.dll
deleted file mode 100644 (file)
index 5368e76..0000000
Binary files a/ffmpeg 0.7/lib/avdevice-53.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avdevice.lib b/ffmpeg 0.7/lib/avdevice.lib
deleted file mode 100644 (file)
index 9ef3413..0000000
Binary files a/ffmpeg 0.7/lib/avdevice.lib and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avfilter-2.dll b/ffmpeg 0.7/lib/avfilter-2.dll
deleted file mode 100644 (file)
index eda8798..0000000
Binary files a/ffmpeg 0.7/lib/avfilter-2.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avfilter.lib b/ffmpeg 0.7/lib/avfilter.lib
deleted file mode 100644 (file)
index 82fe966..0000000
Binary files a/ffmpeg 0.7/lib/avfilter.lib and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avformat-53.dll b/ffmpeg 0.7/lib/avformat-53.dll
deleted file mode 100644 (file)
index cb79f16..0000000
Binary files a/ffmpeg 0.7/lib/avformat-53.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avformat.lib b/ffmpeg 0.7/lib/avformat.lib
deleted file mode 100644 (file)
index 091a0e5..0000000
Binary files a/ffmpeg 0.7/lib/avformat.lib and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avutil-51.dll b/ffmpeg 0.7/lib/avutil-51.dll
deleted file mode 100644 (file)
index 17e4980..0000000
Binary files a/ffmpeg 0.7/lib/avutil-51.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/avutil.lib b/ffmpeg 0.7/lib/avutil.lib
deleted file mode 100644 (file)
index ced8b38..0000000
Binary files a/ffmpeg 0.7/lib/avutil.lib and /dev/null differ
diff --git a/ffmpeg 0.7/lib/postproc-51.dll b/ffmpeg 0.7/lib/postproc-51.dll
deleted file mode 100644 (file)
index 68ac4cf..0000000
Binary files a/ffmpeg 0.7/lib/postproc-51.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/postproc.lib b/ffmpeg 0.7/lib/postproc.lib
deleted file mode 100644 (file)
index f8c0244..0000000
Binary files a/ffmpeg 0.7/lib/postproc.lib and /dev/null differ
diff --git a/ffmpeg 0.7/lib/swscale-0.dll b/ffmpeg 0.7/lib/swscale-0.dll
deleted file mode 100644 (file)
index a987f5f..0000000
Binary files a/ffmpeg 0.7/lib/swscale-0.dll and /dev/null differ
diff --git a/ffmpeg 0.7/lib/swscale.lib b/ffmpeg 0.7/lib/swscale.lib
deleted file mode 100644 (file)
index df48f54..0000000
Binary files a/ffmpeg 0.7/lib/swscale.lib and /dev/null differ
diff --git a/ffmpeg 0.7/licenses/bzip2.txt b/ffmpeg 0.7/licenses/bzip2.txt
deleted file mode 100644 (file)
index af3a130..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-\r
---------------------------------------------------------------------------\r
-\r
-This program, "bzip2", the associated library "libbzip2", and all\r
-documentation, are copyright (C) 1996-2010 Julian R Seward.  All\r
-rights reserved.\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions\r
-are met:\r
-\r
-1. Redistributions of source code must retain the above copyright\r
-   notice, this list of conditions and the following disclaimer.\r
-\r
-2. The origin of this software must not be misrepresented; you must \r
-   not claim that you wrote the original software.  If you use this \r
-   software in a product, an acknowledgment in the product \r
-   documentation would be appreciated but is not required.\r
-\r
-3. Altered source versions must be plainly marked as such, and must\r
-   not be misrepresented as being the original software.\r
-\r
-4. The name of the author may not be used to endorse or promote \r
-   products derived from this software without specific prior written \r
-   permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS\r
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\r
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\r
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-Julian Seward, jseward@bzip.org\r
-bzip2/libbzip2 version 1.0.6 of 6 September 2010\r
-\r
---------------------------------------------------------------------------\r
diff --git a/ffmpeg 0.7/licenses/ffmpeg.txt b/ffmpeg 0.7/licenses/ffmpeg.txt
deleted file mode 100644 (file)
index 818433e..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE\r
-                       Version 3, 29 June 2007\r
-\r
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                            Preamble\r
-\r
-  The GNU General Public License is a free, copyleft license for\r
-software and other kinds of works.\r
-\r
-  The licenses for most software and other practical works are designed\r
-to take away your freedom to share and change the works.  By contrast,\r
-the GNU General Public License is intended to guarantee your freedom to\r
-share and change all versions of a program--to make sure it remains free\r
-software for all its users.  We, the Free Software Foundation, use the\r
-GNU General Public License for most of our software; it applies also to\r
-any other work released this way by its authors.  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-them if you wish), that you receive source code or can get it if you\r
-want it, that you can change the software or use pieces of it in new\r
-free programs, and that you know you can do these things.\r
-\r
-  To protect your rights, we need to prevent others from denying you\r
-these rights or asking you to surrender the rights.  Therefore, you have\r
-certain responsibilities if you distribute copies of the software, or if\r
-you modify it: responsibilities to respect the freedom of others.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must pass on to the recipients the same\r
-freedoms that you received.  You must make sure that they, too, receive\r
-or can get the source code.  And you must show them these terms so they\r
-know their rights.\r
-\r
-  Developers that use the GNU GPL protect your rights with two steps:\r
-(1) assert copyright on the software, and (2) offer you this License\r
-giving you legal permission to copy, distribute and/or modify it.\r
-\r
-  For the developers' and authors' protection, the GPL clearly explains\r
-that there is no warranty for this free software.  For both users' and\r
-authors' sake, the GPL requires that modified versions be marked as\r
-changed, so that their problems will not be attributed erroneously to\r
-authors of previous versions.\r
-\r
-  Some devices are designed to deny users access to install or run\r
-modified versions of the software inside them, although the manufacturer\r
-can do so.  This is fundamentally incompatible with the aim of\r
-protecting users' freedom to change the software.  The systematic\r
-pattern of such abuse occurs in the area of products for individuals to\r
-use, which is precisely where it is most unacceptable.  Therefore, we\r
-have designed this version of the GPL to prohibit the practice for those\r
-products.  If such problems arise substantially in other domains, we\r
-stand ready to extend this provision to those domains in future versions\r
-of the GPL, as needed to protect the freedom of users.\r
-\r
-  Finally, every program is threatened constantly by software patents.\r
-States should not allow patents to restrict development and use of\r
-software on general-purpose computers, but in those that do, we wish to\r
-avoid the special danger that patents applied to a free program could\r
-make it effectively proprietary.  To prevent this, the GPL assures that\r
-patents cannot be used to render the program non-free.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\r
-                       TERMS AND CONDITIONS\r
-\r
-  0. Definitions.\r
-\r
-  "This License" refers to version 3 of the GNU General Public License.\r
-\r
-  "Copyright" also means copyright-like laws that apply to other kinds of\r
-works, such as semiconductor masks.\r
-\r
-  "The Program" refers to any copyrightable work licensed under this\r
-License.  Each licensee is addressed as "you".  "Licensees" and\r
-"recipients" may be individuals or organizations.\r
-\r
-  To "modify" a work means to copy from or adapt all or part of the work\r
-in a fashion requiring copyright permission, other than the making of an\r
-exact copy.  The resulting work is called a "modified version" of the\r
-earlier work or a work "based on" the earlier work.\r
-\r
-  A "covered work" means either the unmodified Program or a work based\r
-on the Program.\r
-\r
-  To "propagate" a work means to do anything with it that, without\r
-permission, would make you directly or secondarily liable for\r
-infringement under applicable copyright law, except executing it on a\r
-computer or modifying a private copy.  Propagation includes copying,\r
-distribution (with or without modification), making available to the\r
-public, and in some countries other activities as well.\r
-\r
-  To "convey" a work means any kind of propagation that enables other\r
-parties to make or receive copies.  Mere interaction with a user through\r
-a computer network, with no transfer of a copy, is not conveying.\r
-\r
-  An interactive user interface displays "Appropriate Legal Notices"\r
-to the extent that it includes a convenient and prominently visible\r
-feature that (1) displays an appropriate copyright notice, and (2)\r
-tells the user that there is no warranty for the work (except to the\r
-extent that warranties are provided), that licensees may convey the\r
-work under this License, and how to view a copy of this License.  If\r
-the interface presents a list of user commands or options, such as a\r
-menu, a prominent item in the list meets this criterion.\r
-\r
-  1. Source Code.\r
-\r
-  The "source code" for a work means the preferred form of the work\r
-for making modifications to it.  "Object code" means any non-source\r
-form of a work.\r
-\r
-  A "Standard Interface" means an interface that either is an official\r
-standard defined by a recognized standards body, or, in the case of\r
-interfaces specified for a particular programming language, one that\r
-is widely used among developers working in that language.\r
-\r
-  The "System Libraries" of an executable work include anything, other\r
-than the work as a whole, that (a) is included in the normal form of\r
-packaging a Major Component, but which is not part of that Major\r
-Component, and (b) serves only to enable use of the work with that\r
-Major Component, or to implement a Standard Interface for which an\r
-implementation is available to the public in source code form.  A\r
-"Major Component", in this context, means a major essential component\r
-(kernel, window system, and so on) of the specific operating system\r
-(if any) on which the executable work runs, or a compiler used to\r
-produce the work, or an object code interpreter used to run it.\r
-\r
-  The "Corresponding Source" for a work in object code form means all\r
-the source code needed to generate, install, and (for an executable\r
-work) run the object code and to modify the work, including scripts to\r
-control those activities.  However, it does not include the work's\r
-System Libraries, or general-purpose tools or generally available free\r
-programs which are used unmodified in performing those activities but\r
-which are not part of the work.  For example, Corresponding Source\r
-includes interface definition files associated with source files for\r
-the work, and the source code for shared libraries and dynamically\r
-linked subprograms that the work is specifically designed to require,\r
-such as by intimate data communication or control flow between those\r
-subprograms and other parts of the work.\r
-\r
-  The Corresponding Source need not include anything that users\r
-can regenerate automatically from other parts of the Corresponding\r
-Source.\r
-\r
-  The Corresponding Source for a work in source code form is that\r
-same work.\r
-\r
-  2. Basic Permissions.\r
-\r
-  All rights granted under this License are granted for the term of\r
-copyright on the Program, and are irrevocable provided the stated\r
-conditions are met.  This License explicitly affirms your unlimited\r
-permission to run the unmodified Program.  The output from running a\r
-covered work is covered by this License only if the output, given its\r
-content, constitutes a covered work.  This License acknowledges your\r
-rights of fair use or other equivalent, as provided by copyright law.\r
-\r
-  You may make, run and propagate covered works that you do not\r
-convey, without conditions so long as your license otherwise remains\r
-in force.  You may convey covered works to others for the sole purpose\r
-of having them make modifications exclusively for you, or provide you\r
-with facilities for running those works, provided that you comply with\r
-the terms of this License in conveying all material for which you do\r
-not control copyright.  Those thus making or running the covered works\r
-for you must do so exclusively on your behalf, under your direction\r
-and control, on terms that prohibit them from making any copies of\r
-your copyrighted material outside their relationship with you.\r
-\r
-  Conveying under any other circumstances is permitted solely under\r
-the conditions stated below.  Sublicensing is not allowed; section 10\r
-makes it unnecessary.\r
-\r
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r
-\r
-  No covered work shall be deemed part of an effective technological\r
-measure under any applicable law fulfilling obligations under article\r
-11 of the WIPO copyright treaty adopted on 20 December 1996, or\r
-similar laws prohibiting or restricting circumvention of such\r
-measures.\r
-\r
-  When you convey a covered work, you waive any legal power to forbid\r
-circumvention of technological measures to the extent such circumvention\r
-is effected by exercising rights under this License with respect to\r
-the covered work, and you disclaim any intention to limit operation or\r
-modification of the work as a means of enforcing, against the work's\r
-users, your or third parties' legal rights to forbid circumvention of\r
-technological measures.\r
-\r
-  4. Conveying Verbatim Copies.\r
-\r
-  You may convey verbatim copies of the Program's source code as you\r
-receive it, in any medium, provided that you conspicuously and\r
-appropriately publish on each copy an appropriate copyright notice;\r
-keep intact all notices stating that this License and any\r
-non-permissive terms added in accord with section 7 apply to the code;\r
-keep intact all notices of the absence of any warranty; and give all\r
-recipients a copy of this License along with the Program.\r
-\r
-  You may charge any price or no price for each copy that you convey,\r
-and you may offer support or warranty protection for a fee.\r
-\r
-  5. Conveying Modified Source Versions.\r
-\r
-  You may convey a work based on the Program, or the modifications to\r
-produce it from the Program, in the form of source code under the\r
-terms of section 4, provided that you also meet all of these conditions:\r
-\r
-    a) The work must carry prominent notices stating that you modified\r
-    it, and giving a relevant date.\r
-\r
-    b) The work must carry prominent notices stating that it is\r
-    released under this License and any conditions added under section\r
-    7.  This requirement modifies the requirement in section 4 to\r
-    "keep intact all notices".\r
-\r
-    c) You must license the entire work, as a whole, under this\r
-    License to anyone who comes into possession of a copy.  This\r
-    License will therefore apply, along with any applicable section 7\r
-    additional terms, to the whole of the work, and all its parts,\r
-    regardless of how they are packaged.  This License gives no\r
-    permission to license the work in any other way, but it does not\r
-    invalidate such permission if you have separately received it.\r
-\r
-    d) If the work has interactive user interfaces, each must display\r
-    Appropriate Legal Notices; however, if the Program has interactive\r
-    interfaces that do not display Appropriate Legal Notices, your\r
-    work need not make them do so.\r
-\r
-  A compilation of a covered work with other separate and independent\r
-works, which are not by their nature extensions of the covered work,\r
-and which are not combined with it such as to form a larger program,\r
-in or on a volume of a storage or distribution medium, is called an\r
-"aggregate" if the compilation and its resulting copyright are not\r
-used to limit the access or legal rights of the compilation's users\r
-beyond what the individual works permit.  Inclusion of a covered work\r
-in an aggregate does not cause this License to apply to the other\r
-parts of the aggregate.\r
-\r
-  6. Conveying Non-Source Forms.\r
-\r
-  You may convey a covered work in object code form under the terms\r
-of sections 4 and 5, provided that you also convey the\r
-machine-readable Corresponding Source under the terms of this License,\r
-in one of these ways:\r
-\r
-    a) Convey the object code in, or embodied in, a physical product\r
-    (including a physical distribution medium), accompanied by the\r
-    Corresponding Source fixed on a durable physical medium\r
-    customarily used for software interchange.\r
-\r
-    b) Convey the object code in, or embodied in, a physical product\r
-    (including a physical distribution medium), accompanied by a\r
-    written offer, valid for at least three years and valid for as\r
-    long as you offer spare parts or customer support for that product\r
-    model, to give anyone who possesses the object code either (1) a\r
-    copy of the Corresponding Source for all the software in the\r
-    product that is covered by this License, on a durable physical\r
-    medium customarily used for software interchange, for a price no\r
-    more than your reasonable cost of physically performing this\r
-    conveying of source, or (2) access to copy the\r
-    Corresponding Source from a network server at no charge.\r
-\r
-    c) Convey individual copies of the object code with a copy of the\r
-    written offer to provide the Corresponding Source.  This\r
-    alternative is allowed only occasionally and noncommercially, and\r
-    only if you received the object code with such an offer, in accord\r
-    with subsection 6b.\r
-\r
-    d) Convey the object code by offering access from a designated\r
-    place (gratis or for a charge), and offer equivalent access to the\r
-    Corresponding Source in the same way through the same place at no\r
-    further charge.  You need not require recipients to copy the\r
-    Corresponding Source along with the object code.  If the place to\r
-    copy the object code is a network server, the Corresponding Source\r
-    may be on a different server (operated by you or a third party)\r
-    that supports equivalent copying facilities, provided you maintain\r
-    clear directions next to the object code saying where to find the\r
-    Corresponding Source.  Regardless of what server hosts the\r
-    Corresponding Source, you remain obligated to ensure that it is\r
-    available for as long as needed to satisfy these requirements.\r
-\r
-    e) Convey the object code using peer-to-peer transmission, provided\r
-    you inform other peers where the object code and Corresponding\r
-    Source of the work are being offered to the general public at no\r
-    charge under subsection 6d.\r
-\r
-  A separable portion of the object code, whose source code is excluded\r
-from the Corresponding Source as a System Library, need not be\r
-included in conveying the object code work.\r
-\r
-  A "User Product" is either (1) a "consumer product", which means any\r
-tangible personal property which is normally used for personal, family,\r
-or household purposes, or (2) anything designed or sold for incorporation\r
-into a dwelling.  In determining whether a product is a consumer product,\r
-doubtful cases shall be resolved in favor of coverage.  For a particular\r
-product received by a particular user, "normally used" refers to a\r
-typical or common use of that class of product, regardless of the status\r
-of the particular user or of the way in which the particular user\r
-actually uses, or expects or is expected to use, the product.  A product\r
-is a consumer product regardless of whether the product has substantial\r
-commercial, industrial or non-consumer uses, unless such uses represent\r
-the only significant mode of use of the product.\r
-\r
-  "Installation Information" for a User Product means any methods,\r
-procedures, authorization keys, or other information required to install\r
-and execute modified versions of a covered work in that User Product from\r
-a modified version of its Corresponding Source.  The information must\r
-suffice to ensure that the continued functioning of the modified object\r
-code is in no case prevented or interfered with solely because\r
-modification has been made.\r
-\r
-  If you convey an object code work under this section in, or with, or\r
-specifically for use in, a User Product, and the conveying occurs as\r
-part of a transaction in which the right of possession and use of the\r
-User Product is transferred to the recipient in perpetuity or for a\r
-fixed term (regardless of how the transaction is characterized), the\r
-Corresponding Source conveyed under this section must be accompanied\r
-by the Installation Information.  But this requirement does not apply\r
-if neither you nor any third party retains the ability to install\r
-modified object code on the User Product (for example, the work has\r
-been installed in ROM).\r
-\r
-  The requirement to provide Installation Information does not include a\r
-requirement to continue to provide support service, warranty, or updates\r
-for a work that has been modified or installed by the recipient, or for\r
-the User Product in which it has been modified or installed.  Access to a\r
-network may be denied when the modification itself materially and\r
-adversely affects the operation of the network or violates the rules and\r
-protocols for communication across the network.\r
-\r
-  Corresponding Source conveyed, and Installation Information provided,\r
-in accord with this section must be in a format that is publicly\r
-documented (and with an implementation available to the public in\r
-source code form), and must require no special password or key for\r
-unpacking, reading or copying.\r
-\r
-  7. Additional Terms.\r
-\r
-  "Additional permissions" are terms that supplement the terms of this\r
-License by making exceptions from one or more of its conditions.\r
-Additional permissions that are applicable to the entire Program shall\r
-be treated as though they were included in this License, to the extent\r
-that they are valid under applicable law.  If additional permissions\r
-apply only to part of the Program, that part may be used separately\r
-under those permissions, but the entire Program remains governed by\r
-this License without regard to the additional permissions.\r
-\r
-  When you convey a copy of a covered work, you may at your option\r
-remove any additional permissions from that copy, or from any part of\r
-it.  (Additional permissions may be written to require their own\r
-removal in certain cases when you modify the work.)  You may place\r
-additional permissions on material, added by you to a covered work,\r
-for which you have or can give appropriate copyright permission.\r
-\r
-  Notwithstanding any other provision of this License, for material you\r
-add to a covered work, you may (if authorized by the copyright holders of\r
-that material) supplement the terms of this License with terms:\r
-\r
-    a) Disclaiming warranty or limiting liability differently from the\r
-    terms of sections 15 and 16 of this License; or\r
-\r
-    b) Requiring preservation of specified reasonable legal notices or\r
-    author attributions in that material or in the Appropriate Legal\r
-    Notices displayed by works containing it; or\r
-\r
-    c) Prohibiting misrepresentation of the origin of that material, or\r
-    requiring that modified versions of such material be marked in\r
-    reasonable ways as different from the original version; or\r
-\r
-    d) Limiting the use for publicity purposes of names of licensors or\r
-    authors of the material; or\r
-\r
-    e) Declining to grant rights under trademark law for use of some\r
-    trade names, trademarks, or service marks; or\r
-\r
-    f) Requiring indemnification of licensors and authors of that\r
-    material by anyone who conveys the material (or modified versions of\r
-    it) with contractual assumptions of liability to the recipient, for\r
-    any liability that these contractual assumptions directly impose on\r
-    those licensors and authors.\r
-\r
-  All other non-permissive additional terms are considered "further\r
-restrictions" within the meaning of section 10.  If the Program as you\r
-received it, or any part of it, contains a notice stating that it is\r
-governed by this License along with a term that is a further\r
-restriction, you may remove that term.  If a license document contains\r
-a further restriction but permits relicensing or conveying under this\r
-License, you may add to a covered work material governed by the terms\r
-of that license document, provided that the further restriction does\r
-not survive such relicensing or conveying.\r
-\r
-  If you add terms to a covered work in accord with this section, you\r
-must place, in the relevant source files, a statement of the\r
-additional terms that apply to those files, or a notice indicating\r
-where to find the applicable terms.\r
-\r
-  Additional terms, permissive or non-permissive, may be stated in the\r
-form of a separately written license, or stated as exceptions;\r
-the above requirements apply either way.\r
-\r
-  8. Termination.\r
-\r
-  You may not propagate or modify a covered work except as expressly\r
-provided under this License.  Any attempt otherwise to propagate or\r
-modify it is void, and will automatically terminate your rights under\r
-this License (including any patent licenses granted under the third\r
-paragraph of section 11).\r
-\r
-  However, if you cease all violation of this License, then your\r
-license from a particular copyright holder is reinstated (a)\r
-provisionally, unless and until the copyright holder explicitly and\r
-finally terminates your license, and (b) permanently, if the copyright\r
-holder fails to notify you of the violation by some reasonable means\r
-prior to 60 days after the cessation.\r
-\r
-  Moreover, your license from a particular copyright holder is\r
-reinstated permanently if the copyright holder notifies you of the\r
-violation by some reasonable means, this is the first time you have\r
-received notice of violation of this License (for any work) from that\r
-copyright holder, and you cure the violation prior to 30 days after\r
-your receipt of the notice.\r
-\r
-  Termination of your rights under this section does not terminate the\r
-licenses of parties who have received copies or rights from you under\r
-this License.  If your rights have been terminated and not permanently\r
-reinstated, you do not qualify to receive new licenses for the same\r
-material under section 10.\r
-\r
-  9. Acceptance Not Required for Having Copies.\r
-\r
-  You are not required to accept this License in order to receive or\r
-run a copy of the Program.  Ancillary propagation of a covered work\r
-occurring solely as a consequence of using peer-to-peer transmission\r
-to receive a copy likewise does not require acceptance.  However,\r
-nothing other than this License grants you permission to propagate or\r
-modify any covered work.  These actions infringe copyright if you do\r
-not accept this License.  Therefore, by modifying or propagating a\r
-covered work, you indicate your acceptance of this License to do so.\r
-\r
-  10. Automatic Licensing of Downstream Recipients.\r
-\r
-  Each time you convey a covered work, the recipient automatically\r
-receives a license from the original licensors, to run, modify and\r
-propagate that work, subject to this License.  You are not responsible\r
-for enforcing compliance by third parties with this License.\r
-\r
-  An "entity transaction" is a transaction transferring control of an\r
-organization, or substantially all assets of one, or subdividing an\r
-organization, or merging organizations.  If propagation of a covered\r
-work results from an entity transaction, each party to that\r
-transaction who receives a copy of the work also receives whatever\r
-licenses to the work the party's predecessor in interest had or could\r
-give under the previous paragraph, plus a right to possession of the\r
-Corresponding Source of the work from the predecessor in interest, if\r
-the predecessor has it or can get it with reasonable efforts.\r
-\r
-  You may not impose any further restrictions on the exercise of the\r
-rights granted or affirmed under this License.  For example, you may\r
-not impose a license fee, royalty, or other charge for exercise of\r
-rights granted under this License, and you may not initiate litigation\r
-(including a cross-claim or counterclaim in a lawsuit) alleging that\r
-any patent claim is infringed by making, using, selling, offering for\r
-sale, or importing the Program or any portion of it.\r
-\r
-  11. Patents.\r
-\r
-  A "contributor" is a copyright holder who authorizes use under this\r
-License of the Program or a work on which the Program is based.  The\r
-work thus licensed is called the contributor's "contributor version".\r
-\r
-  A contributor's "essential patent claims" are all patent claims\r
-owned or controlled by the contributor, whether already acquired or\r
-hereafter acquired, that would be infringed by some manner, permitted\r
-by this License, of making, using, or selling its contributor version,\r
-but do not include claims that would be infringed only as a\r
-consequence of further modification of the contributor version.  For\r
-purposes of this definition, "control" includes the right to grant\r
-patent sublicenses in a manner consistent with the requirements of\r
-this License.\r
-\r
-  Each contributor grants you a non-exclusive, worldwide, royalty-free\r
-patent license under the contributor's essential patent claims, to\r
-make, use, sell, offer for sale, import and otherwise run, modify and\r
-propagate the contents of its contributor version.\r
-\r
-  In the following three paragraphs, a "patent license" is any express\r
-agreement or commitment, however denominated, not to enforce a patent\r
-(such as an express permission to practice a patent or covenant not to\r
-sue for patent infringement).  To "grant" such a patent license to a\r
-party means to make such an agreement or commitment not to enforce a\r
-patent against the party.\r
-\r
-  If you convey a covered work, knowingly relying on a patent license,\r
-and the Corresponding Source of the work is not available for anyone\r
-to copy, free of charge and under the terms of this License, through a\r
-publicly available network server or other readily accessible means,\r
-then you must either (1) cause the Corresponding Source to be so\r
-available, or (2) arrange to deprive yourself of the benefit of the\r
-patent license for this particular work, or (3) arrange, in a manner\r
-consistent with the requirements of this License, to extend the patent\r
-license to downstream recipients.  "Knowingly relying" means you have\r
-actual knowledge that, but for the patent license, your conveying the\r
-covered work in a country, or your recipient's use of the covered work\r
-in a country, would infringe one or more identifiable patents in that\r
-country that you have reason to believe are valid.\r
-\r
-  If, pursuant to or in connection with a single transaction or\r
-arrangement, you convey, or propagate by procuring conveyance of, a\r
-covered work, and grant a patent license to some of the parties\r
-receiving the covered work authorizing them to use, propagate, modify\r
-or convey a specific copy of the covered work, then the patent license\r
-you grant is automatically extended to all recipients of the covered\r
-work and works based on it.\r
-\r
-  A patent license is "discriminatory" if it does not include within\r
-the scope of its coverage, prohibits the exercise of, or is\r
-conditioned on the non-exercise of one or more of the rights that are\r
-specifically granted under this License.  You may not convey a covered\r
-work if you are a party to an arrangement with a third party that is\r
-in the business of distributing software, under which you make payment\r
-to the third party based on the extent of your activity of conveying\r
-the work, and under which the third party grants, to any of the\r
-parties who would receive the covered work from you, a discriminatory\r
-patent license (a) in connection with copies of the covered work\r
-conveyed by you (or copies made from those copies), or (b) primarily\r
-for and in connection with specific products or compilations that\r
-contain the covered work, unless you entered into that arrangement,\r
-or that patent license was granted, prior to 28 March 2007.\r
-\r
-  Nothing in this License shall be construed as excluding or limiting\r
-any implied license or other defenses to infringement that may\r
-otherwise be available to you under applicable patent law.\r
-\r
-  12. No Surrender of Others' Freedom.\r
-\r
-  If conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot convey a\r
-covered work so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you may\r
-not convey it at all.  For example, if you agree to terms that obligate you\r
-to collect a royalty for further conveying from those to whom you convey\r
-the Program, the only way you could satisfy both those terms and this\r
-License would be to refrain entirely from conveying the Program.\r
-\r
-  13. Use with the GNU Affero General Public License.\r
-\r
-  Notwithstanding any other provision of this License, you have\r
-permission to link or combine any covered work with a work licensed\r
-under version 3 of the GNU Affero General Public License into a single\r
-combined work, and to convey the resulting work.  The terms of this\r
-License will continue to apply to the part which is the covered work,\r
-but the special requirements of the GNU Affero General Public License,\r
-section 13, concerning interaction through a network will apply to the\r
-combination as such.\r
-\r
-  14. Revised Versions of this License.\r
-\r
-  The Free Software Foundation may publish revised and/or new versions of\r
-the GNU General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-  Each version is given a distinguishing version number.  If the\r
-Program specifies that a certain numbered version of the GNU General\r
-Public License "or any later version" applies to it, you have the\r
-option of following the terms and conditions either of that numbered\r
-version or of any later version published by the Free Software\r
-Foundation.  If the Program does not specify a version number of the\r
-GNU General Public License, you may choose any version ever published\r
-by the Free Software Foundation.\r
-\r
-  If the Program specifies that a proxy can decide which future\r
-versions of the GNU General Public License can be used, that proxy's\r
-public statement of acceptance of a version permanently authorizes you\r
-to choose that version for the Program.\r
-\r
-  Later license versions may give you additional or different\r
-permissions.  However, no additional obligations are imposed on any\r
-author or copyright holder as a result of your choosing to follow a\r
-later version.\r
-\r
-  15. Disclaimer of Warranty.\r
-\r
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\r
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
-  16. Limitation of Liability.\r
-\r
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r
-SUCH DAMAGES.\r
-\r
-  17. Interpretation of Sections 15 and 16.\r
-\r
-  If the disclaimer of warranty and limitation of liability provided\r
-above cannot be given local legal effect according to their terms,\r
-reviewing courts shall apply local law that most closely approximates\r
-an absolute waiver of all civil liability in connection with the\r
-Program, unless a warranty or assumption of liability accompanies a\r
-copy of the Program in return for a fee.\r
-\r
-                     END OF TERMS AND CONDITIONS\r
-\r
-            How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-state the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software: you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation, either version 3 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-  If the program does terminal interaction, make it output a short\r
-notice like this when it starts in an interactive mode:\r
-\r
-    <program>  Copyright (C) <year>  <name of author>\r
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, your program's commands\r
-might be different; for a GUI interface, you would use an "about box".\r
-\r
-  You should also get your employer (if you work as a programmer) or school,\r
-if any, to sign a "copyright disclaimer" for the program, if necessary.\r
-For more information on this, and how to apply and follow the GNU GPL, see\r
-<http://www.gnu.org/licenses/>.\r
-\r
-  The GNU General Public License does not permit incorporating your program\r
-into proprietary programs.  If your program is a subroutine library, you\r
-may consider it more useful to permit linking proprietary applications with\r
-the library.  If this is what you want to do, use the GNU Lesser General\r
-Public License instead of this License.  But first, please read\r
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.\r
diff --git a/ffmpeg 0.7/licenses/freetype.txt b/ffmpeg 0.7/licenses/freetype.txt
deleted file mode 100644 (file)
index b6ee268..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
-     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-License is intended to guarantee your freedom to share and change free\r
-software--to make sure the software is free for all its users.  This\r
-General Public License applies to most of the Free Software\r
-Foundation's software and to any other program whose authors commit to\r
-using it.  (Some other Free Software Foundation software is covered by\r
-the GNU Library General Public License instead.)  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if you\r
-distribute copies of the software, or if you modify it.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must give the recipients all the rights that\r
-you have.  You must make sure that they, too, receive or can get the\r
-source code.  And you must show them these terms so they know their\r
-rights.\r
-\r
-  We protect your rights with two steps: (1) copyright the software, and\r
-(2) offer you this license which gives you legal permission to copy,\r
-distribute and/or modify the software.\r
-\r
-  Also, for each author's protection and ours, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-software.  If the software is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original, so\r
-that any problems introduced by others will not reflect on the original\r
-authors' reputations.\r
-\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that redistributors of a free\r
-program will individually obtain patent licenses, in effect making the\r
-program proprietary.  To prevent this, we have made it clear that any\r
-patent must be licensed for everyone's free use or not licensed at all.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\f\r
-                   GNU GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License applies to any program or other work which contains\r
-a notice placed by the copyright holder saying it may be distributed\r
-under the terms of this General Public License.  The "Program", below,\r
-refers to any such program or work, and a "work based on the Program"\r
-means either the Program or any derivative work under copyright law:\r
-that is to say, a work containing the Program or a portion of it,\r
-either verbatim or with modifications and/or translated into another\r
-language.  (Hereinafter, translation is included without limitation in\r
-the term "modification".)  Each licensee is addressed as "you".\r
-\r
-Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running the Program is not restricted, and the output from the Program\r
-is covered only if its contents constitute a work based on the\r
-Program (independent of having been made by running the Program).\r
-Whether that is true depends on what the Program does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Program's\r
-source code as you receive it, in any medium, provided that you\r
-conspicuously and appropriately publish on each copy an appropriate\r
-copyright notice and disclaimer of warranty; keep intact all the\r
-notices that refer to this License and to the absence of any warranty;\r
-and give any other recipients of the Program a copy of this License\r
-along with the Program.\r
-\r
-You may charge a fee for the physical act of transferring a copy, and\r
-you may at your option offer warranty protection in exchange for a fee.\r
-\r
-  2. You may modify your copy or copies of the Program or any portion\r
-of it, thus forming a work based on the Program, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) You must cause the modified files to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    b) You must cause any work that you distribute or publish, that in\r
-    whole or in part contains or is derived from the Program or any\r
-    part thereof, to be licensed as a whole at no charge to all third\r
-    parties under the terms of this License.\r
-\r
-    c) If the modified program normally reads commands interactively\r
-    when run, you must cause it, when started running for such\r
-    interactive use in the most ordinary way, to print or display an\r
-    announcement including an appropriate copyright notice and a\r
-    notice that there is no warranty (or else, saying that you provide\r
-    a warranty) and that users may redistribute the program under\r
-    these conditions, and telling the user how to view a copy of this\r
-    License.  (Exception: if the Program itself is interactive but\r
-    does not normally print such an announcement, your work based on\r
-    the Program is not required to print an announcement.)\r
-\f\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Program,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Program, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Program.\r
-\r
-In addition, mere aggregation of another work not based on the Program\r
-with the Program (or with a work based on the Program) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may copy and distribute the Program (or a work based on it,\r
-under Section 2) in object code or executable form under the terms of\r
-Sections 1 and 2 above provided that you also do one of the following:\r
-\r
-    a) Accompany it with the complete corresponding machine-readable\r
-    source code, which must be distributed under the terms of Sections\r
-    1 and 2 above on a medium customarily used for software interchange; or,\r
-\r
-    b) Accompany it with a written offer, valid for at least three\r
-    years, to give any third party, for a charge no more than your\r
-    cost of physically performing source distribution, a complete\r
-    machine-readable copy of the corresponding source code, to be\r
-    distributed under the terms of Sections 1 and 2 above on a medium\r
-    customarily used for software interchange; or,\r
-\r
-    c) Accompany it with the information you received as to the offer\r
-    to distribute corresponding source code.  (This alternative is\r
-    allowed only for noncommercial distribution and only if you\r
-    received the program in object code or executable form with such\r
-    an offer, in accord with Subsection b above.)\r
-\r
-The source code for a work means the preferred form of the work for\r
-making modifications to it.  For an executable work, complete source\r
-code means all the source code for all modules it contains, plus any\r
-associated interface definition files, plus the scripts used to\r
-control compilation and installation of the executable.  However, as a\r
-special exception, the source code distributed need not include\r
-anything that is normally distributed (in either source or binary\r
-form) with the major components (compiler, kernel, and so on) of the\r
-operating system on which the executable runs, unless that component\r
-itself accompanies the executable.\r
-\r
-If distribution of executable or object code is made by offering\r
-access to copy from a designated place, then offering equivalent\r
-access to copy the source code from the same place counts as\r
-distribution of the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\f\r
-  4. You may not copy, modify, sublicense, or distribute the Program\r
-except as expressly provided under this License.  Any attempt\r
-otherwise to copy, modify, sublicense or distribute the Program is\r
-void, and will automatically terminate your rights under this License.\r
-However, parties who have received copies, or rights, from you under\r
-this License will not have their licenses terminated so long as such\r
-parties remain in full compliance.\r
-\r
-  5. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Program or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Program (or any work based on the\r
-Program), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Program or works based on it.\r
-\r
-  6. Each time you redistribute the Program (or any work based on the\r
-Program), the recipient automatically receives a license from the\r
-original licensor to copy, distribute or modify the Program subject to\r
-these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\r
-  7. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Program at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Program by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Program.\r
-\r
-If any portion of this section is held invalid or unenforceable under\r
-any particular circumstance, the balance of the section is intended to\r
-apply and the section as a whole is intended to apply in other\r
-circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system, which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\f\r
-  8. If the distribution and/or use of the Program is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Program under this License\r
-may add an explicit geographical distribution limitation excluding\r
-those countries, so that distribution is permitted only in or among\r
-countries not thus excluded.  In such case, this License incorporates\r
-the limitation as if written in the body of this License.\r
-\r
-  9. The Free Software Foundation may publish revised and/or new versions\r
-of the General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Program\r
-specifies a version number of this License which applies to it and "any\r
-later version", you have the option of following the terms and conditions\r
-either of that version or of any later version published by the Free\r
-Software Foundation.  If the Program does not specify a version number of\r
-this License, you may choose any version ever published by the Free Software\r
-Foundation.\r
-\r
-  10. If you wish to incorporate parts of the Program into other free\r
-programs whose distribution conditions are different, write to the author\r
-to ask for permission.  For software which is copyrighted by the Free\r
-Software Foundation, write to the Free Software Foundation; we sometimes\r
-make exceptions for this.  Our decision will be guided by the two goals\r
-of preserving the free status of all derivatives of our free software and\r
-of promoting the sharing and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
-REPAIR OR CORRECTION.\r
-\r
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\f\r
-           How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software; you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation; either version 2 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program; if not, write to the Free Software\r
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-If the program is interactive, make it output a short notice like this\r
-when it starts in an interactive mode:\r
-\r
-    Gnomovision version 69, Copyright (C) year  name of author\r
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, the commands you use may\r
-be called something other than `show w' and `show c'; they could even be\r
-mouse-clicks or menu items--whatever suits your program.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the program, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1989\r
-  Ty Coon, President of Vice\r
-\r
-This General Public License does not permit incorporating your program into\r
-proprietary programs.  If your program is a subroutine library, you may\r
-consider it more useful to permit linking proprietary applications with the\r
-library.  If this is what you want to do, use the GNU Library General\r
-Public License instead of this License.\r
diff --git a/ffmpeg 0.7/licenses/frei0r.txt b/ffmpeg 0.7/licenses/frei0r.txt
deleted file mode 100644 (file)
index 0f3bd3d..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
-     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-License is intended to guarantee your freedom to share and change free\r
-software--to make sure the software is free for all its users.  This\r
-General Public License applies to most of the Free Software\r
-Foundation's software and to any other program whose authors commit to\r
-using it.  (Some other Free Software Foundation software is covered by\r
-the GNU Library General Public License instead.)  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if you\r
-distribute copies of the software, or if you modify it.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must give the recipients all the rights that\r
-you have.  You must make sure that they, too, receive or can get the\r
-source code.  And you must show them these terms so they know their\r
-rights.\r
-\r
-  We protect your rights with two steps: (1) copyright the software, and\r
-(2) offer you this license which gives you legal permission to copy,\r
-distribute and/or modify the software.\r
-\r
-  Also, for each author's protection and ours, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-software.  If the software is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original, so\r
-that any problems introduced by others will not reflect on the original\r
-authors' reputations.\r
-\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that redistributors of a free\r
-program will individually obtain patent licenses, in effect making the\r
-program proprietary.  To prevent this, we have made it clear that any\r
-patent must be licensed for everyone's free use or not licensed at all.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\f\r
-                   GNU GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License applies to any program or other work which contains\r
-a notice placed by the copyright holder saying it may be distributed\r
-under the terms of this General Public License.  The "Program", below,\r
-refers to any such program or work, and a "work based on the Program"\r
-means either the Program or any derivative work under copyright law:\r
-that is to say, a work containing the Program or a portion of it,\r
-either verbatim or with modifications and/or translated into another\r
-language.  (Hereinafter, translation is included without limitation in\r
-the term "modification".)  Each licensee is addressed as "you".\r
-\r
-Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running the Program is not restricted, and the output from the Program\r
-is covered only if its contents constitute a work based on the\r
-Program (independent of having been made by running the Program).\r
-Whether that is true depends on what the Program does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Program's\r
-source code as you receive it, in any medium, provided that you\r
-conspicuously and appropriately publish on each copy an appropriate\r
-copyright notice and disclaimer of warranty; keep intact all the\r
-notices that refer to this License and to the absence of any warranty;\r
-and give any other recipients of the Program a copy of this License\r
-along with the Program.\r
-\r
-You may charge a fee for the physical act of transferring a copy, and\r
-you may at your option offer warranty protection in exchange for a fee.\r
-\r
-  2. You may modify your copy or copies of the Program or any portion\r
-of it, thus forming a work based on the Program, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) You must cause the modified files to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    b) You must cause any work that you distribute or publish, that in\r
-    whole or in part contains or is derived from the Program or any\r
-    part thereof, to be licensed as a whole at no charge to all third\r
-    parties under the terms of this License.\r
-\r
-    c) If the modified program normally reads commands interactively\r
-    when run, you must cause it, when started running for such\r
-    interactive use in the most ordinary way, to print or display an\r
-    announcement including an appropriate copyright notice and a\r
-    notice that there is no warranty (or else, saying that you provide\r
-    a warranty) and that users may redistribute the program under\r
-    these conditions, and telling the user how to view a copy of this\r
-    License.  (Exception: if the Program itself is interactive but\r
-    does not normally print such an announcement, your work based on\r
-    the Program is not required to print an announcement.)\r
-\f\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Program,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Program, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Program.\r
-\r
-In addition, mere aggregation of another work not based on the Program\r
-with the Program (or with a work based on the Program) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may copy and distribute the Program (or a work based on it,\r
-under Section 2) in object code or executable form under the terms of\r
-Sections 1 and 2 above provided that you also do one of the following:\r
-\r
-    a) Accompany it with the complete corresponding machine-readable\r
-    source code, which must be distributed under the terms of Sections\r
-    1 and 2 above on a medium customarily used for software interchange; or,\r
-\r
-    b) Accompany it with a written offer, valid for at least three\r
-    years, to give any third party, for a charge no more than your\r
-    cost of physically performing source distribution, a complete\r
-    machine-readable copy of the corresponding source code, to be\r
-    distributed under the terms of Sections 1 and 2 above on a medium\r
-    customarily used for software interchange; or,\r
-\r
-    c) Accompany it with the information you received as to the offer\r
-    to distribute corresponding source code.  (This alternative is\r
-    allowed only for noncommercial distribution and only if you\r
-    received the program in object code or executable form with such\r
-    an offer, in accord with Subsection b above.)\r
-\r
-The source code for a work means the preferred form of the work for\r
-making modifications to it.  For an executable work, complete source\r
-code means all the source code for all modules it contains, plus any\r
-associated interface definition files, plus the scripts used to\r
-control compilation and installation of the executable.  However, as a\r
-special exception, the source code distributed need not include\r
-anything that is normally distributed (in either source or binary\r
-form) with the major components (compiler, kernel, and so on) of the\r
-operating system on which the executable runs, unless that component\r
-itself accompanies the executable.\r
-\r
-If distribution of executable or object code is made by offering\r
-access to copy from a designated place, then offering equivalent\r
-access to copy the source code from the same place counts as\r
-distribution of the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\f\r
-  4. You may not copy, modify, sublicense, or distribute the Program\r
-except as expressly provided under this License.  Any attempt\r
-otherwise to copy, modify, sublicense or distribute the Program is\r
-void, and will automatically terminate your rights under this License.\r
-However, parties who have received copies, or rights, from you under\r
-this License will not have their licenses terminated so long as such\r
-parties remain in full compliance.\r
-\r
-  5. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Program or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Program (or any work based on the\r
-Program), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Program or works based on it.\r
-\r
-  6. Each time you redistribute the Program (or any work based on the\r
-Program), the recipient automatically receives a license from the\r
-original licensor to copy, distribute or modify the Program subject to\r
-these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\r
-  7. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Program at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Program by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Program.\r
-\r
-If any portion of this section is held invalid or unenforceable under\r
-any particular circumstance, the balance of the section is intended to\r
-apply and the section as a whole is intended to apply in other\r
-circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system, which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\f\r
-  8. If the distribution and/or use of the Program is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Program under this License\r
-may add an explicit geographical distribution limitation excluding\r
-those countries, so that distribution is permitted only in or among\r
-countries not thus excluded.  In such case, this License incorporates\r
-the limitation as if written in the body of this License.\r
-\r
-  9. The Free Software Foundation may publish revised and/or new versions\r
-of the General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Program\r
-specifies a version number of this License which applies to it and "any\r
-later version", you have the option of following the terms and conditions\r
-either of that version or of any later version published by the Free\r
-Software Foundation.  If the Program does not specify a version number of\r
-this License, you may choose any version ever published by the Free Software\r
-Foundation.\r
-\r
-  10. If you wish to incorporate parts of the Program into other free\r
-programs whose distribution conditions are different, write to the author\r
-to ask for permission.  For software which is copyrighted by the Free\r
-Software Foundation, write to the Free Software Foundation; we sometimes\r
-make exceptions for this.  Our decision will be guided by the two goals\r
-of preserving the free status of all derivatives of our free software and\r
-of promoting the sharing and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
-REPAIR OR CORRECTION.\r
-\r
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\f\r
-           How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software; you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation; either version 2 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program; if not, write to the Free Software\r
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
-\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-If the program is interactive, make it output a short notice like this\r
-when it starts in an interactive mode:\r
-\r
-    Gnomovision version 69, Copyright (C) year  name of author\r
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, the commands you use may\r
-be called something other than `show w' and `show c'; they could even be\r
-mouse-clicks or menu items--whatever suits your program.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the program, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1989\r
-  Ty Coon, President of Vice\r
-\r
-This General Public License does not permit incorporating your program into\r
-proprietary programs.  If your program is a subroutine library, you may\r
-consider it more useful to permit linking proprietary applications with the\r
-library.  If this is what you want to do, use the GNU Library General\r
-Public License instead of this License.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/gsm.txt b/ffmpeg 0.7/licenses/gsm.txt
deleted file mode 100644 (file)
index 8aec8e1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,\r
-Technische Universitaet Berlin\r
-\r
-Any use of this software is permitted provided that this notice is not\r
-removed and that neither the authors nor the Technische Universitaet Berlin\r
-are deemed to have made any representations as to the suitability of this\r
-software for any purpose nor are held responsible for any defects of\r
-this software.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.\r
-\r
-As a matter of courtesy, the authors request to be informed about uses\r
-this software has found, about bugs in this software, and about any\r
-improvements that may be of general interest.\r
-\r
-Berlin, 28.11.1994\r
-Jutta Degener\r
-Carsten Bormann\r
-\r
-                                 oOo\r
-\r
-Since the original terms of 15 years ago maybe do not make our\r
-intentions completely clear given today's refined usage of the legal\r
-terms, we append this additional permission:\r
-\r
-      Permission to use, copy, modify, and distribute this software\r
-      for any purpose with or without fee is hereby granted,\r
-      provided that this notice is not removed and that neither\r
-      the authors nor the Technische Universitaet Berlin are\r
-      deemed to have made any representations as to the suitability\r
-      of this software for any purpose nor are held responsible\r
-      for any defects of this software.  THERE IS ABSOLUTELY NO\r
-      WARRANTY FOR THIS SOFTWARE.\r
-\r
-Berkeley/Bremen, 05.04.2009\r
-Jutta Degener\r
-Carsten Bormann
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/lame.txt b/ffmpeg 0.7/licenses/lame.txt
deleted file mode 100644 (file)
index b240210..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-                 GNU LIBRARY GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1991 Free Software Foundation, Inc.\r
-                   59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-[This is the first released version of the library GPL.  It is\r
- numbered 2 because it goes with version 2 of the ordinary GPL.]\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-Licenses are intended to guarantee your freedom to share and change\r
-free software--to make sure the software is free for all its users.\r
-\r
-  This license, the Library General Public License, applies to some\r
-specially designated Free Software Foundation software, and to any\r
-other libraries whose authors decide to use it.  You can use it for\r
-your libraries, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if\r
-you distribute copies of the library, or if you modify it.\r
-\r
-  For example, if you distribute copies of the library, whether gratis\r
-or for a fee, you must give the recipients all the rights that we gave\r
-you.  You must make sure that they, too, receive or can get the source\r
-code.  If you link a program with the library, you must provide\r
-complete object files to the recipients so that they can relink them\r
-with the library, after making changes to the library and recompiling\r
-it.  And you must show them these terms so they know their rights.\r
-\r
-  Our method of protecting your rights has two steps: (1) copyright\r
-the library, and (2) offer you this license which gives you legal\r
-permission to copy, distribute and/or modify the library.\r
-\r
-  Also, for each distributor's protection, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-library.  If the library is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original\r
-version, so that any problems introduced by others will not reflect on\r
-the original authors' reputations.\r
-\f\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that companies distributing free\r
-software will individually obtain patent licenses, thus in effect\r
-transforming the program into proprietary software.  To prevent this,\r
-we have made it clear that any patent must be licensed for everyone's\r
-free use or not licensed at all.\r
-\r
-  Most GNU software, including some libraries, is covered by the ordinary\r
-GNU General Public License, which was designed for utility programs.  This\r
-license, the GNU Library General Public License, applies to certain\r
-designated libraries.  This license is quite different from the ordinary\r
-one; be sure to read it in full, and don't assume that anything in it is\r
-the same as in the ordinary license.\r
-\r
-  The reason we have a separate public license for some libraries is that\r
-they blur the distinction we usually make between modifying or adding to a\r
-program and simply using it.  Linking a program with a library, without\r
-changing the library, is in some sense simply using the library, and is\r
-analogous to running a utility program or application program.  However, in\r
-a textual and legal sense, the linked executable is a combined work, a\r
-derivative of the original library, and the ordinary General Public License\r
-treats it as such.\r
-\r
-  Because of this blurred distinction, using the ordinary General\r
-Public License for libraries did not effectively promote software\r
-sharing, because most developers did not use the libraries.  We\r
-concluded that weaker conditions might promote sharing better.\r
-\r
-  However, unrestricted linking of non-free programs would deprive the\r
-users of those programs of all benefit from the free status of the\r
-libraries themselves.  This Library General Public License is intended to\r
-permit developers of non-free programs to use free libraries, while\r
-preserving your freedom as a user of such programs to change the free\r
-libraries that are incorporated in them.  (We have not seen how to achieve\r
-this as regards changes in header files, but we have achieved it as regards\r
-changes in the actual functions of the Library.)  The hope is that this\r
-will lead to faster development of free libraries.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.  Pay close attention to the difference between a\r
-"work based on the library" and a "work that uses the library".  The\r
-former contains code derived from the library, while the latter only\r
-works together with the library.\r
-\r
-  Note that it is possible for a library to be covered by the ordinary\r
-General Public License rather than by this special one.\r
-\f\r
-                 GNU LIBRARY GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License Agreement applies to any software library which\r
-contains a notice placed by the copyright holder or other authorized\r
-party saying it may be distributed under the terms of this Library\r
-General Public License (also called "this License").  Each licensee is\r
-addressed as "you".\r
-\r
-  A "library" means a collection of software functions and/or data\r
-prepared so as to be conveniently linked with application programs\r
-(which use some of those functions and data) to form executables.\r
-\r
-  The "Library", below, refers to any such software library or work\r
-which has been distributed under these terms.  A "work based on the\r
-Library" means either the Library or any derivative work under\r
-copyright law: that is to say, a work containing the Library or a\r
-portion of it, either verbatim or with modifications and/or translated\r
-straightforwardly into another language.  (Hereinafter, translation is\r
-included without limitation in the term "modification".)\r
-\r
-  "Source code" for a work means the preferred form of the work for\r
-making modifications to it.  For a library, complete source code means\r
-all the source code for all modules it contains, plus any associated\r
-interface definition files, plus the scripts used to control compilation\r
-and installation of the library.\r
-\r
-  Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running a program using the Library is not restricted, and output from\r
-such a program is covered only if its contents constitute a work based\r
-on the Library (independent of the use of the Library in a tool for\r
-writing it).  Whether that is true depends on what the Library does\r
-and what the program that uses the Library does.\r
-  \r
-  1. You may copy and distribute verbatim copies of the Library's\r
-complete source code as you receive it, in any medium, provided that\r
-you conspicuously and appropriately publish on each copy an\r
-appropriate copyright notice and disclaimer of warranty; keep intact\r
-all the notices that refer to this License and to the absence of any\r
-warranty; and distribute a copy of this License along with the\r
-Library.\r
-\r
-  You may charge a fee for the physical act of transferring a copy,\r
-and you may at your option offer warranty protection in exchange for a\r
-fee.\r
-\f\r
-  2. You may modify your copy or copies of the Library or any portion\r
-of it, thus forming a work based on the Library, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) The modified work must itself be a software library.\r
-\r
-    b) You must cause the files modified to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    c) You must cause the whole of the work to be licensed at no\r
-    charge to all third parties under the terms of this License.\r
-\r
-    d) If a facility in the modified Library refers to a function or a\r
-    table of data to be supplied by an application program that uses\r
-    the facility, other than as an argument passed when the facility\r
-    is invoked, then you must make a good faith effort to ensure that,\r
-    in the event an application does not supply such function or\r
-    table, the facility still operates, and performs whatever part of\r
-    its purpose remains meaningful.\r
-\r
-    (For example, a function in a library to compute square roots has\r
-    a purpose that is entirely well-defined independent of the\r
-    application.  Therefore, Subsection 2d requires that any\r
-    application-supplied function or table used by this function must\r
-    be optional: if the application does not supply it, the square\r
-    root function must still compute square roots.)\r
-\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Library,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Library, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote\r
-it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Library.\r
-\r
-In addition, mere aggregation of another work not based on the Library\r
-with the Library (or with a work based on the Library) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may opt to apply the terms of the ordinary GNU General Public\r
-License instead of this License to a given copy of the Library.  To do\r
-this, you must alter all the notices that refer to this License, so\r
-that they refer to the ordinary GNU General Public License, version 2,\r
-instead of to this License.  (If a newer version than version 2 of the\r
-ordinary GNU General Public License has appeared, then you can specify\r
-that version instead if you wish.)  Do not make any other change in\r
-these notices.\r
-\f\r
-  Once this change is made in a given copy, it is irreversible for\r
-that copy, so the ordinary GNU General Public License applies to all\r
-subsequent copies and derivative works made from that copy.\r
-\r
-  This option is useful when you wish to copy part of the code of\r
-the Library into a program that is not a library.\r
-\r
-  4. You may copy and distribute the Library (or a portion or\r
-derivative of it, under Section 2) in object code or executable form\r
-under the terms of Sections 1 and 2 above provided that you accompany\r
-it with the complete corresponding machine-readable source code, which\r
-must be distributed under the terms of Sections 1 and 2 above on a\r
-medium customarily used for software interchange.\r
-\r
-  If distribution of object code is made by offering access to copy\r
-from a designated place, then offering equivalent access to copy the\r
-source code from the same place satisfies the requirement to\r
-distribute the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
-  5. A program that contains no derivative of any portion of the\r
-Library, but is designed to work with the Library by being compiled or\r
-linked with it, is called a "work that uses the Library".  Such a\r
-work, in isolation, is not a derivative work of the Library, and\r
-therefore falls outside the scope of this License.\r
-\r
-  However, linking a "work that uses the Library" with the Library\r
-creates an executable that is a derivative of the Library (because it\r
-contains portions of the Library), rather than a "work that uses the\r
-library".  The executable is therefore covered by this License.\r
-Section 6 states terms for distribution of such executables.\r
-\r
-  When a "work that uses the Library" uses material from a header file\r
-that is part of the Library, the object code for the work may be a\r
-derivative work of the Library even though the source code is not.\r
-Whether this is true is especially significant if the work can be\r
-linked without the Library, or if the work is itself a library.  The\r
-threshold for this to be true is not precisely defined by law.\r
-\r
-  If such an object file uses only numerical parameters, data\r
-structure layouts and accessors, and small macros and small inline\r
-functions (ten lines or less in length), then the use of the object\r
-file is unrestricted, regardless of whether it is legally a derivative\r
-work.  (Executables containing this object code plus portions of the\r
-Library will still fall under Section 6.)\r
-\r
-  Otherwise, if the work is a derivative of the Library, you may\r
-distribute the object code for the work under the terms of Section 6.\r
-Any executables containing that work also fall under Section 6,\r
-whether or not they are linked directly with the Library itself.\r
-\f\r
-  6. As an exception to the Sections above, you may also compile or\r
-link a "work that uses the Library" with the Library to produce a\r
-work containing portions of the Library, and distribute that work\r
-under terms of your choice, provided that the terms permit\r
-modification of the work for the customer's own use and reverse\r
-engineering for debugging such modifications.\r
-\r
-  You must give prominent notice with each copy of the work that the\r
-Library is used in it and that the Library and its use are covered by\r
-this License.  You must supply a copy of this License.  If the work\r
-during execution displays copyright notices, you must include the\r
-copyright notice for the Library among them, as well as a reference\r
-directing the user to the copy of this License.  Also, you must do one\r
-of these things:\r
-\r
-    a) Accompany the work with the complete corresponding\r
-    machine-readable source code for the Library including whatever\r
-    changes were used in the work (which must be distributed under\r
-    Sections 1 and 2 above); and, if the work is an executable linked\r
-    with the Library, with the complete machine-readable "work that\r
-    uses the Library", as object code and/or source code, so that the\r
-    user can modify the Library and then relink to produce a modified\r
-    executable containing the modified Library.  (It is understood\r
-    that the user who changes the contents of definitions files in the\r
-    Library will not necessarily be able to recompile the application\r
-    to use the modified definitions.)\r
-\r
-    b) Accompany the work with a written offer, valid for at\r
-    least three years, to give the same user the materials\r
-    specified in Subsection 6a, above, for a charge no more\r
-    than the cost of performing this distribution.\r
-\r
-    c) If distribution of the work is made by offering access to copy\r
-    from a designated place, offer equivalent access to copy the above\r
-    specified materials from the same place.\r
-\r
-    d) Verify that the user has already received a copy of these\r
-    materials or that you have already sent this user a copy.\r
-\r
-  For an executable, the required form of the "work that uses the\r
-Library" must include any data and utility programs needed for\r
-reproducing the executable from it.  However, as a special exception,\r
-the source code distributed need not include anything that is normally\r
-distributed (in either source or binary form) with the major\r
-components (compiler, kernel, and so on) of the operating system on\r
-which the executable runs, unless that component itself accompanies\r
-the executable.\r
-\r
-  It may happen that this requirement contradicts the license\r
-restrictions of other proprietary libraries that do not normally\r
-accompany the operating system.  Such a contradiction means you cannot\r
-use both them and the Library together in an executable that you\r
-distribute.\r
-\f\r
-  7. You may place library facilities that are a work based on the\r
-Library side-by-side in a single library together with other library\r
-facilities not covered by this License, and distribute such a combined\r
-library, provided that the separate distribution of the work based on\r
-the Library and of the other library facilities is otherwise\r
-permitted, and provided that you do these two things:\r
-\r
-    a) Accompany the combined library with a copy of the same work\r
-    based on the Library, uncombined with any other library\r
-    facilities.  This must be distributed under the terms of the\r
-    Sections above.\r
-\r
-    b) Give prominent notice with the combined library of the fact\r
-    that part of it is a work based on the Library, and explaining\r
-    where to find the accompanying uncombined form of the same work.\r
-\r
-  8. You may not copy, modify, sublicense, link with, or distribute\r
-the Library except as expressly provided under this License.  Any\r
-attempt otherwise to copy, modify, sublicense, link with, or\r
-distribute the Library is void, and will automatically terminate your\r
-rights under this License.  However, parties who have received copies,\r
-or rights, from you under this License will not have their licenses\r
-terminated so long as such parties remain in full compliance.\r
-\r
-  9. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Library or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Library (or any work based on the\r
-Library), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Library or works based on it.\r
-\r
-  10. Each time you redistribute the Library (or any work based on the\r
-Library), the recipient automatically receives a license from the\r
-original licensor to copy, distribute, link with or modify the Library\r
-subject to these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\f\r
-  11. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Library at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Library by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Library.\r
-\r
-If any portion of this section is held invalid or unenforceable under any\r
-particular circumstance, the balance of the section is intended to apply,\r
-and the section as a whole is intended to apply in other circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
-  12. If the distribution and/or use of the Library is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Library under this License may add\r
-an explicit geographical distribution limitation excluding those countries,\r
-so that distribution is permitted only in or among countries not thus\r
-excluded.  In such case, this License incorporates the limitation as if\r
-written in the body of this License.\r
-\r
-  13. The Free Software Foundation may publish revised and/or new\r
-versions of the Library General Public License from time to time.\r
-Such new versions will be similar in spirit to the present version,\r
-but may differ in detail to address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Library\r
-specifies a version number of this License which applies to it and\r
-"any later version", you have the option of following the terms and\r
-conditions either of that version or of any later version published by\r
-the Free Software Foundation.  If the Library does not specify a\r
-license version number, you may choose any version ever published by\r
-the Free Software Foundation.\r
-\f\r
-  14. If you wish to incorporate parts of the Library into other free\r
-programs whose distribution conditions are incompatible with these,\r
-write to the author to ask for permission.  For software which is\r
-copyrighted by the Free Software Foundation, write to the Free\r
-Software Foundation; we sometimes make exceptions for this.  Our\r
-decision will be guided by the two goals of preserving the free status\r
-of all derivatives of our free software and of promoting the sharing\r
-and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
-DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\f\r
-           How to Apply These Terms to Your New Libraries\r
-\r
-  If you develop a new library, and you want it to be of the greatest\r
-possible use to the public, we recommend making it free software that\r
-everyone can redistribute and change.  You can do so by permitting\r
-redistribution under these terms (or, alternatively, under the terms of the\r
-ordinary General Public License).\r
-\r
-  To apply these terms, attach the following notices to the library.  It is\r
-safest to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least the\r
-"copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the library's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This library is free software; you can redistribute it and/or\r
-    modify it under the terms of the GNU Library General Public\r
-    License as published by the Free Software Foundation; either\r
-    version 2 of the License, or (at your option) any later version.\r
-\r
-    This library is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-    Library General Public License for more details.\r
-\r
-    You should have received a copy of the GNU Library General Public\r
-    License along with this library; if not, write to the Free Software\r
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the library, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1990\r
-  Ty Coon, President of Vice\r
-\r
-That's all there is to it!
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/libvpx.txt b/ffmpeg 0.7/licenses/libvpx.txt
deleted file mode 100644 (file)
index 872c1f1..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Copyright (c) 2010, Google Inc. All rights reserved.\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions are\r
-met:\r
-\r
-  * Redistributions of source code must retain the above copyright\r
-    notice, this list of conditions and the following disclaimer.\r
-\r
-  * Redistributions in binary form must reproduce the above copyright\r
-    notice, this list of conditions and the following disclaimer in\r
-    the documentation and/or other materials provided with the\r
-    distribution.\r
-\r
-  * Neither the name of Google nor the names of its contributors may\r
-    be used to endorse or promote products derived from this software\r
-    without specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/ffmpeg 0.7/licenses/opencore-amr.txt b/ffmpeg 0.7/licenses/opencore-amr.txt
deleted file mode 100644 (file)
index 6c40ca5..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-Apache License\r
-Version 2.0, January 2004\r
-http://www.apache.org/licenses/\r
-\r
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
-1. Definitions.\r
-\r
-"License" shall mean the terms and conditions for use, reproduction, and\r
-distribution as defined by Sections 1 through 9 of this document.\r
-\r
-"Licensor" shall mean the copyright owner or entity authorized by the\r
-copyright owner that is granting the License.\r
-\r
-"Legal Entity" shall mean the union of the acting entity and all other\r
-entities that control, are controlled by, or are under common control with\r
-that entity. For the purposes of this definition, "control" means (i) the\r
-power, direct or indirect, to cause the direction or management of such\r
-entity, whether by contract or otherwise, or (ii) ownership of fifty\r
-percent (50%) or more of the outstanding shares, or (iii) beneficial\r
-ownership of such entity.\r
-\r
-"You" (or "Your") shall mean an individual or Legal Entity exercising\r
-permissions granted by this License.\r
-\r
-"Source" form shall mean the preferred form for making modifications,\r
-including but not limited to software source code, documentation source,\r
-and configuration files.\r
-\r
-"Object" form shall mean any form resulting from mechanical transformation\r
-or translation of a Source form, including but not limited to compiled\r
-object code, generated documentation, and conversions to other media types.\r
-\r
-"Work" shall mean the work of authorship, whether in Source or Object form,\r
-made available under the License, as indicated by a copyright notice that\r
-is included in or attached to the work (an example is provided in the\r
-Appendix below).\r
-\r
-"Derivative Works" shall mean any work, whether in Source or Object form,\r
-that is based on (or derived from) the Work and for which the editorial\r
-revisions, annotations, elaborations, or other modifications represent, as\r
-a whole, an original work of authorship. For the purposes of this License,\r
-Derivative Works shall not include works that remain separable from, or\r
-merely link (or bind by name) to the interfaces of, the Work and Derivative\r
-Works thereof.\r
-\r
-"Contribution" shall mean any work of authorship, including the original\r
-version of the Work and any modifications or additions to that Work or\r
-Derivative Works thereof, that is intentionally submitted to Licensor for\r
-inclusion in the Work by the copyright owner or by an individual or Legal\r
-Entity authorized to submit on behalf of the copyright owner. For the\r
-purposes of this definition, "submitted" means any form of electronic,\r
-verbal, or written communication sent to the Licensor or its\r
-representatives, including but not limited to communication on electronic\r
-mailing lists, source code control systems, and issue tracking systems that\r
-are managed by, or on behalf of, the Licensor for the purpose of discussing\r
-and improving the Work, but excluding communication that is conspicuously\r
-marked or otherwise designated in writing by the copyright owner as "Not a\r
-Contribution."\r
-\r
-"Contributor" shall mean Licensor and any individual or Legal Entity on\r
-behalf of whom a Contribution has been received by Licensor and\r
-subsequently incorporated within the Work.\r
-\r
-2. Grant of Copyright License. Subject to the terms and conditions of this\r
-License, each Contributor hereby grants to You a perpetual, worldwide,\r
-non-exclusive, no-charge, royalty-free, irrevocable copyright license to\r
-reproduce, prepare Derivative Works of, publicly display, publicly perform,\r
-sublicense, and distribute the Work and such Derivative Works in Source or\r
-Object form.\r
-\r
-3. Grant of Patent License. Subject to the terms and conditions of this\r
-License, each Contributor hereby grants to You a perpetual, worldwide,\r
-non-exclusive, no-charge, royalty-free, irrevocable (except as stated in\r
-this section) patent license to make, have made, use, offer to sell, sell,\r
-import, and otherwise transfer the Work, where such license applies only to\r
-those patent claims licensable by such Contributor that are necessarily\r
-infringed by their Contribution(s) alone or by combination of their\r
-Contribution(s) with the Work to which such Contribution(s) was submitted.\r
-If You institute patent litigation against any entity (including a\r
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a\r
-Contribution incorporated within the Work constitutes direct or\r
-contributory patent infringement, then any patent licenses granted to You\r
-under this License for that Work shall terminate as of the date such\r
-litigation is filed.\r
-\r
-4. Redistribution. You may reproduce and distribute copies of the Work or\r
-Derivative Works thereof in any medium, with or without modifications, and\r
-in Source or Object form, provided that You meet the following conditions:\r
-\r
-   1. You must give any other recipients of the Work or Derivative Works a\r
-copy of this License; and\r
-\r
-   2. You must cause any modified files to carry prominent notices stating\r
-that You changed the files; and\r
-\r
-   3. You must retain, in the Source form of any Derivative Works that You\r
-distribute, all copyright, patent, trademark, and attribution notices from\r
-the Source form of the Work, excluding those notices that do not pertain to\r
-any part of the Derivative Works; and\r
-\r
-   4. If the Work includes a "NOTICE" text file as part of its\r
-distribution, then any Derivative Works that You distribute must include a\r
-readable copy of the attribution notices contained within such NOTICE file,\r
-excluding those notices that do not pertain to any part of the Derivative\r
-Works, in at least one of the following places: within a NOTICE text file\r
-distributed as part of the Derivative Works; within the Source form or\r
-documentation, if provided along with the Derivative Works; or, within a\r
-display generated by the Derivative Works, if and wherever such third-party\r
-notices normally appear. The contents of the NOTICE file are for\r
-informational purposes only and do not modify the License. You may add Your\r
-own attribution notices within Derivative Works that You distribute,\r
-alongside or as an addendum to the NOTICE text from the Work, provided that\r
-such additional attribution notices cannot be construed as modifying the\r
-License.\r
-\r
-You may add Your own copyright statement to Your modifications and may\r
-provide additional or different license terms and conditions for use,\r
-reproduction, or distribution of Your modifications, or for any such\r
-Derivative Works as a whole, provided Your use, reproduction, and\r
-distribution of the Work otherwise complies with the conditions stated in\r
-this License.\r
-\r
-5. Submission of Contributions. Unless You explicitly state otherwise, any\r
-Contribution intentionally submitted for inclusion in the Work by You to\r
-the Licensor shall be under the terms and conditions of this License,\r
-without any additional terms or conditions. Notwithstanding the above,\r
-nothing herein shall supersede or modify the terms of any separate license\r
-agreement you may have executed with Licensor regarding such Contributions.\r
-\r
-6. Trademarks. This License does not grant permission to use the trade\r
-names, trademarks, service marks, or product names of the Licensor, except\r
-as required for reasonable and customary use in describing the origin of\r
-the Work and reproducing the content of the NOTICE file.\r
-\r
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to\r
-in writing, Licensor provides the Work (and each Contributor provides its\r
-Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
-KIND, either express or implied, including, without limitation, any\r
-warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or\r
-FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for\r
-determining the appropriateness of using or redistributing the Work and\r
-assume any risks associated with Your exercise of permissions under this\r
-License.\r
-\r
-8. Limitation of Liability. In no event and under no legal theory, whether\r
-in tort (including negligence), contract, or otherwise, unless required by\r
-applicable law (such as deliberate and grossly negligent acts) or agreed to\r
-in writing, shall any Contributor be liable to You for damages, including\r
-any direct, indirect, special, incidental, or consequential damages of any\r
-character arising as a result of this License or out of the use or\r
-inability to use the Work (including but not limited to damages for loss of\r
-goodwill, work stoppage, computer failure or malfunction, or any and all\r
-other commercial damages or losses), even if such Contributor has been\r
-advised of the possibility of such damages.\r
-\r
-9. Accepting Warranty or Additional Liability. While redistributing the\r
-Work or Derivative Works thereof, You may choose to offer, and charge a fee\r
-for, acceptance of support, warranty, indemnity, or other liability\r
-obligations and/or rights consistent with this License. However, in\r
-accepting such obligations, You may act only on Your own behalf and on Your\r
-sole responsibility, not on behalf of any other Contributor, and only if\r
-You agree to indemnify, defend, and hold each Contributor harmless for any\r
-liability incurred by, or claims asserted against, such Contributor by\r
-reason of your accepting any such warranty or additional liability.\r
-\r
-END OF TERMS AND CONDITIONS\r
-\r
-APPENDIX: How to apply the Apache License to your work\r
-\r
-To apply the Apache License to your work, attach the following boilerplate\r
-notice, with the fields enclosed by brackets "[]" replaced with your own\r
-identifying information. (Don't include the brackets!) The text should be\r
-enclosed in the appropriate comment syntax for the file format. We also\r
-recommend that a file or class name and description of purpose be included\r
-on the same "printed page" as the copyright notice for easier\r
-identification within third-party archives.\r
-\r
- Copyright [yyyy] [name of copyright owner]\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License"); you may\r
- not use this file except in compliance with the License. You may obtain a\r
- copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable\r
- law or agreed to in writing, software distributed under the License is\r
- distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- KIND, either express or implied. See the License for the specific language\r
- governing permissions and limitations under the License.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/openjpeg.txt b/ffmpeg 0.7/licenses/openjpeg.txt
deleted file mode 100644 (file)
index 0ad4488..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*\r
- * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium\r
- * Copyright (c) 2002-2007, Professor Benoit Macq\r
- * Copyright (c) 2001-2003, David Janssens\r
- * Copyright (c) 2002-2003, Yannick Verschueren\r
- * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe\r
- * Copyright (c) 2005, Herve Drolon, FreeImage Team\r
- * All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- *    notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- *    notice, this list of conditions and the following disclaimer in the\r
- *    documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/rtmp.txt b/ffmpeg 0.7/licenses/rtmp.txt
deleted file mode 100644 (file)
index 7ba5aff..0000000
+++ /dev/null
@@ -1,503 +0,0 @@
-                  GNU LESSER GENERAL PUBLIC LICENSE\r
-                       Version 2.1, February 1999\r
-\r
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-[This is the first released version of the Lesser GPL.  It also counts\r
- as the successor of the GNU Library Public License, version 2, hence\r
- the version number 2.1.]\r
-\r
-                            Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-Licenses are intended to guarantee your freedom to share and change\r
-free software--to make sure the software is free for all its users.\r
-\r
-  This license, the Lesser General Public License, applies to some\r
-specially designated software packages--typically libraries--of the\r
-Free Software Foundation and other authors who decide to use it.  You\r
-can use it too, but we suggest you first think carefully about whether\r
-this license or the ordinary General Public License is the better\r
-strategy to use in any particular case, based on the explanations below.\r
-\r
-  When we speak of free software, we are referring to freedom of use,\r
-not price.  Our General Public Licenses are designed to make sure that\r
-you have the freedom to distribute copies of free software (and charge\r
-for this service if you wish); that you receive source code or can get\r
-it if you want it; that you can change the software and use pieces of\r
-it in new free programs; and that you are informed that you can do\r
-these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-distributors to deny you these rights or to ask you to surrender these\r
-rights.  These restrictions translate to certain responsibilities for\r
-you if you distribute copies of the library or if you modify it.\r
-\r
-  For example, if you distribute copies of the library, whether gratis\r
-or for a fee, you must give the recipients all the rights that we gave\r
-you.  You must make sure that they, too, receive or can get the source\r
-code.  If you link other code with the library, you must provide\r
-complete object files to the recipients, so that they can relink them\r
-with the library after making changes to the library and recompiling\r
-it.  And you must show them these terms so they know their rights.\r
-\r
-  We protect your rights with a two-step method: (1) we copyright the\r
-library, and (2) we offer you this license, which gives you legal\r
-permission to copy, distribute and/or modify the library.\r
-\r
-  To protect each distributor, we want to make it very clear that\r
-there is no warranty for the free library.  Also, if the library is\r
-modified by someone else and passed on, the recipients should know\r
-that what they have is not the original version, so that the original\r
-author's reputation will not be affected by problems that might be\r
-introduced by others.\r
-\r
-  Finally, software patents pose a constant threat to the existence of\r
-any free program.  We wish to make sure that a company cannot\r
-effectively restrict the users of a free program by obtaining a\r
-restrictive license from a patent holder.  Therefore, we insist that\r
-any patent license obtained for a version of the library must be\r
-consistent with the full freedom of use specified in this license.\r
-\r
-  Most GNU software, including some libraries, is covered by the\r
-ordinary GNU General Public License.  This license, the GNU Lesser\r
-General Public License, applies to certain designated libraries, and\r
-is quite different from the ordinary General Public License.  We use\r
-this license for certain libraries in order to permit linking those\r
-libraries into non-free programs.\r
-\r
-  When a program is linked with a library, whether statically or using\r
-a shared library, the combination of the two is legally speaking a\r
-combined work, a derivative of the original library.  The ordinary\r
-General Public License therefore permits such linking only if the\r
-entire combination fits its criteria of freedom.  The Lesser General\r
-Public License permits more lax criteria for linking other code with\r
-the library.\r
-\r
-  We call this license the "Lesser" General Public License because it\r
-does Less to protect the user's freedom than the ordinary General\r
-Public License.  It also provides other free software developers Less\r
-of an advantage over competing non-free programs.  These disadvantages\r
-are the reason we use the ordinary General Public License for many\r
-libraries.  However, the Lesser license provides advantages in certain\r
-special circumstances.\r
-\r
-  For example, on rare occasions, there may be a special need to\r
-encourage the widest possible use of a certain library, so that it becomes\r
-a de-facto standard.  To achieve this, non-free programs must be\r
-allowed to use the library.  A more frequent case is that a free\r
-library does the same job as widely used non-free libraries.  In this\r
-case, there is little to gain by limiting the free library to free\r
-software only, so we use the Lesser General Public License.\r
-\r
-  In other cases, permission to use a particular library in non-free\r
-programs enables a greater number of people to use a large body of\r
-free software.  For example, permission to use the GNU C Library in\r
-non-free programs enables many more people to use the whole GNU\r
-operating system, as well as its variant, the GNU/Linux operating\r
-system.\r
-\r
-  Although the Lesser General Public License is Less protective of the\r
-users' freedom, it does ensure that the user of a program that is\r
-linked with the Library has the freedom and the wherewithal to run\r
-that program using a modified version of the Library.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.  Pay close attention to the difference between a\r
-"work based on the library" and a "work that uses the library".  The\r
-former contains code derived from the library, whereas the latter must\r
-be combined with the library in order to run.\r
-\r
-                  GNU LESSER GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License Agreement applies to any software library or other\r
-program which contains a notice placed by the copyright holder or\r
-other authorized party saying it may be distributed under the terms of\r
-this Lesser General Public License (also called "this License").\r
-Each licensee is addressed as "you".\r
-\r
-  A "library" means a collection of software functions and/or data\r
-prepared so as to be conveniently linked with application programs\r
-(which use some of those functions and data) to form executables.\r
-\r
-  The "Library", below, refers to any such software library or work\r
-which has been distributed under these terms.  A "work based on the\r
-Library" means either the Library or any derivative work under\r
-copyright law: that is to say, a work containing the Library or a\r
-portion of it, either verbatim or with modifications and/or translated\r
-straightforwardly into another language.  (Hereinafter, translation is\r
-included without limitation in the term "modification".)\r
-\r
-  "Source code" for a work means the preferred form of the work for\r
-making modifications to it.  For a library, complete source code means\r
-all the source code for all modules it contains, plus any associated\r
-interface definition files, plus the scripts used to control compilation\r
-and installation of the library.\r
-\r
-  Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running a program using the Library is not restricted, and output from\r
-such a program is covered only if its contents constitute a work based\r
-on the Library (independent of the use of the Library in a tool for\r
-writing it).  Whether that is true depends on what the Library does\r
-and what the program that uses the Library does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Library's\r
-complete source code as you receive it, in any medium, provided that\r
-you conspicuously and appropriately publish on each copy an\r
-appropriate copyright notice and disclaimer of warranty; keep intact\r
-all the notices that refer to this License and to the absence of any\r
-warranty; and distribute a copy of this License along with the\r
-Library.\r
-\r
-  You may charge a fee for the physical act of transferring a copy,\r
-and you may at your option offer warranty protection in exchange for a\r
-fee.\r
-\r
-  2. You may modify your copy or copies of the Library or any portion\r
-of it, thus forming a work based on the Library, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) The modified work must itself be a software library.\r
-\r
-    b) You must cause the files modified to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    c) You must cause the whole of the work to be licensed at no\r
-    charge to all third parties under the terms of this License.\r
-\r
-    d) If a facility in the modified Library refers to a function or a\r
-    table of data to be supplied by an application program that uses\r
-    the facility, other than as an argument passed when the facility\r
-    is invoked, then you must make a good faith effort to ensure that,\r
-    in the event an application does not supply such function or\r
-    table, the facility still operates, and performs whatever part of\r
-    its purpose remains meaningful.\r
-\r
-    (For example, a function in a library to compute square roots has\r
-    a purpose that is entirely well-defined independent of the\r
-    application.  Therefore, Subsection 2d requires that any\r
-    application-supplied function or table used by this function must\r
-    be optional: if the application does not supply it, the square\r
-    root function must still compute square roots.)\r
-\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Library,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Library, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote\r
-it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Library.\r
-\r
-In addition, mere aggregation of another work not based on the Library\r
-with the Library (or with a work based on the Library) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may opt to apply the terms of the ordinary GNU General Public\r
-License instead of this License to a given copy of the Library.  To do\r
-this, you must alter all the notices that refer to this License, so\r
-that they refer to the ordinary GNU General Public License, version 2,\r
-instead of to this License.  (If a newer version than version 2 of the\r
-ordinary GNU General Public License has appeared, then you can specify\r
-that version instead if you wish.)  Do not make any other change in\r
-these notices.\r
-\r
-  Once this change is made in a given copy, it is irreversible for\r
-that copy, so the ordinary GNU General Public License applies to all\r
-subsequent copies and derivative works made from that copy.\r
-\r
-  This option is useful when you wish to copy part of the code of\r
-the Library into a program that is not a library.\r
-\r
-  4. You may copy and distribute the Library (or a portion or\r
-derivative of it, under Section 2) in object code or executable form\r
-under the terms of Sections 1 and 2 above provided that you accompany\r
-it with the complete corresponding machine-readable source code, which\r
-must be distributed under the terms of Sections 1 and 2 above on a\r
-medium customarily used for software interchange.\r
-\r
-  If distribution of object code is made by offering access to copy\r
-from a designated place, then offering equivalent access to copy the\r
-source code from the same place satisfies the requirement to\r
-distribute the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
-  5. A program that contains no derivative of any portion of the\r
-Library, but is designed to work with the Library by being compiled or\r
-linked with it, is called a "work that uses the Library".  Such a\r
-work, in isolation, is not a derivative work of the Library, and\r
-therefore falls outside the scope of this License.\r
-\r
-  However, linking a "work that uses the Library" with the Library\r
-creates an executable that is a derivative of the Library (because it\r
-contains portions of the Library), rather than a "work that uses the\r
-library".  The executable is therefore covered by this License.\r
-Section 6 states terms for distribution of such executables.\r
-\r
-  When a "work that uses the Library" uses material from a header file\r
-that is part of the Library, the object code for the work may be a\r
-derivative work of the Library even though the source code is not.\r
-Whether this is true is especially significant if the work can be\r
-linked without the Library, or if the work is itself a library.  The\r
-threshold for this to be true is not precisely defined by law.\r
-\r
-  If such an object file uses only numerical parameters, data\r
-structure layouts and accessors, and small macros and small inline\r
-functions (ten lines or less in length), then the use of the object\r
-file is unrestricted, regardless of whether it is legally a derivative\r
-work.  (Executables containing this object code plus portions of the\r
-Library will still fall under Section 6.)\r
-\r
-  Otherwise, if the work is a derivative of the Library, you may\r
-distribute the object code for the work under the terms of Section 6.\r
-Any executables containing that work also fall under Section 6,\r
-whether or not they are linked directly with the Library itself.\r
-\r
-  6. As an exception to the Sections above, you may also combine or\r
-link a "work that uses the Library" with the Library to produce a\r
-work containing portions of the Library, and distribute that work\r
-under terms of your choice, provided that the terms permit\r
-modification of the work for the customer's own use and reverse\r
-engineering for debugging such modifications.\r
-\r
-  You must give prominent notice with each copy of the work that the\r
-Library is used in it and that the Library and its use are covered by\r
-this License.  You must supply a copy of this License.  If the work\r
-during execution displays copyright notices, you must include the\r
-copyright notice for the Library among them, as well as a reference\r
-directing the user to the copy of this License.  Also, you must do one\r
-of these things:\r
-\r
-    a) Accompany the work with the complete corresponding\r
-    machine-readable source code for the Library including whatever\r
-    changes were used in the work (which must be distributed under\r
-    Sections 1 and 2 above); and, if the work is an executable linked\r
-    with the Library, with the complete machine-readable "work that\r
-    uses the Library", as object code and/or source code, so that the\r
-    user can modify the Library and then relink to produce a modified\r
-    executable containing the modified Library.  (It is understood\r
-    that the user who changes the contents of definitions files in the\r
-    Library will not necessarily be able to recompile the application\r
-    to use the modified definitions.)\r
-\r
-    b) Use a suitable shared library mechanism for linking with the\r
-    Library.  A suitable mechanism is one that (1) uses at run time a\r
-    copy of the library already present on the user's computer system,\r
-    rather than copying library functions into the executable, and (2)\r
-    will operate properly with a modified version of the library, if\r
-    the user installs one, as long as the modified version is\r
-    interface-compatible with the version that the work was made with.\r
-\r
-    c) Accompany the work with a written offer, valid for at\r
-    least three years, to give the same user the materials\r
-    specified in Subsection 6a, above, for a charge no more\r
-    than the cost of performing this distribution.\r
-\r
-    d) If distribution of the work is made by offering access to copy\r
-    from a designated place, offer equivalent access to copy the above\r
-    specified materials from the same place.\r
-\r
-    e) Verify that the user has already received a copy of these\r
-    materials or that you have already sent this user a copy.\r
-\r
-  For an executable, the required form of the "work that uses the\r
-Library" must include any data and utility programs needed for\r
-reproducing the executable from it.  However, as a special exception,\r
-the materials to be distributed need not include anything that is\r
-normally distributed (in either source or binary form) with the major\r
-components (compiler, kernel, and so on) of the operating system on\r
-which the executable runs, unless that component itself accompanies\r
-the executable.\r
-\r
-  It may happen that this requirement contradicts the license\r
-restrictions of other proprietary libraries that do not normally\r
-accompany the operating system.  Such a contradiction means you cannot\r
-use both them and the Library together in an executable that you\r
-distribute.\r
-\r
-  7. You may place library facilities that are a work based on the\r
-Library side-by-side in a single library together with other library\r
-facilities not covered by this License, and distribute such a combined\r
-library, provided that the separate distribution of the work based on\r
-the Library and of the other library facilities is otherwise\r
-permitted, and provided that you do these two things:\r
-\r
-    a) Accompany the combined library with a copy of the same work\r
-    based on the Library, uncombined with any other library\r
-    facilities.  This must be distributed under the terms of the\r
-    Sections above.\r
-\r
-    b) Give prominent notice with the combined library of the fact\r
-    that part of it is a work based on the Library, and explaining\r
-    where to find the accompanying uncombined form of the same work.\r
-\r
-  8. You may not copy, modify, sublicense, link with, or distribute\r
-the Library except as expressly provided under this License.  Any\r
-attempt otherwise to copy, modify, sublicense, link with, or\r
-distribute the Library is void, and will automatically terminate your\r
-rights under this License.  However, parties who have received copies,\r
-or rights, from you under this License will not have their licenses\r
-terminated so long as such parties remain in full compliance.\r
-\r
-  9. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Library or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Library (or any work based on the\r
-Library), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Library or works based on it.\r
-\r
-  10. Each time you redistribute the Library (or any work based on the\r
-Library), the recipient automatically receives a license from the\r
-original licensor to copy, distribute, link with or modify the Library\r
-subject to these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties with\r
-this License.\r
-\r
-  11. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Library at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Library by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Library.\r
-\r
-If any portion of this section is held invalid or unenforceable under any\r
-particular circumstance, the balance of the section is intended to apply,\r
-and the section as a whole is intended to apply in other circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
-  12. If the distribution and/or use of the Library is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Library under this License may add\r
-an explicit geographical distribution limitation excluding those countries,\r
-so that distribution is permitted only in or among countries not thus\r
-excluded.  In such case, this License incorporates the limitation as if\r
-written in the body of this License.\r
-\r
-  13. The Free Software Foundation may publish revised and/or new\r
-versions of the Lesser General Public License from time to time.\r
-Such new versions will be similar in spirit to the present version,\r
-but may differ in detail to address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Library\r
-specifies a version number of this License which applies to it and\r
-"any later version", you have the option of following the terms and\r
-conditions either of that version or of any later version published by\r
-the Free Software Foundation.  If the Library does not specify a\r
-license version number, you may choose any version ever published by\r
-the Free Software Foundation.\r
-\r
-  14. If you wish to incorporate parts of the Library into other free\r
-programs whose distribution conditions are incompatible with these,\r
-write to the author to ask for permission.  For software which is\r
-copyrighted by the Free Software Foundation, write to the Free\r
-Software Foundation; we sometimes make exceptions for this.  Our\r
-decision will be guided by the two goals of preserving the free status\r
-of all derivatives of our free software and of promoting the sharing\r
-and reuse of software generally.\r
-\r
-                            NO WARRANTY\r
-\r
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
-DAMAGES.\r
-\r
-                     END OF TERMS AND CONDITIONS\r
-\r
-           How to Apply These Terms to Your New Libraries\r
-\r
-  If you develop a new library, and you want it to be of the greatest\r
-possible use to the public, we recommend making it free software that\r
-everyone can redistribute and change.  You can do so by permitting\r
-redistribution under these terms (or, alternatively, under the terms of the\r
-ordinary General Public License).\r
-\r
-  To apply these terms, attach the following notices to the library.  It is\r
-safest to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least the\r
-"copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the library's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This library is free software; you can redistribute it and/or\r
-    modify it under the terms of the GNU Lesser General Public\r
-    License as published by the Free Software Foundation; either\r
-    version 2.1 of the License, or (at your option) any later version.\r
-\r
-    This library is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-    Lesser General Public License for more details.\r
-\r
-    You should have received a copy of the GNU Lesser General Public\r
-    License along with this library; if not, write to the Free Software\r
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the library, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1990\r
-  Ty Coon, President of Vice\r
-\r
-That's all there is to it!\r
-\r
diff --git a/ffmpeg 0.7/licenses/schroedinger.txt b/ffmpeg 0.7/licenses/schroedinger.txt
deleted file mode 100644 (file)
index 2b79e5a..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-License is intended to guarantee your freedom to share and change free\r
-software--to make sure the software is free for all its users.  This\r
-General Public License applies to most of the Free Software\r
-Foundation's software and to any other program whose authors commit to\r
-using it.  (Some other Free Software Foundation software is covered by\r
-the GNU Library General Public License instead.)  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if you\r
-distribute copies of the software, or if you modify it.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must give the recipients all the rights that\r
-you have.  You must make sure that they, too, receive or can get the\r
-source code.  And you must show them these terms so they know their\r
-rights.\r
-\r
-  We protect your rights with two steps: (1) copyright the software, and\r
-(2) offer you this license which gives you legal permission to copy,\r
-distribute and/or modify the software.\r
-\r
-  Also, for each author's protection and ours, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-software.  If the software is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original, so\r
-that any problems introduced by others will not reflect on the original\r
-authors' reputations.\r
-\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that redistributors of a free\r
-program will individually obtain patent licenses, in effect making the\r
-program proprietary.  To prevent this, we have made it clear that any\r
-patent must be licensed for everyone's free use or not licensed at all.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\f\r
-                   GNU GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License applies to any program or other work which contains\r
-a notice placed by the copyright holder saying it may be distributed\r
-under the terms of this General Public License.  The "Program", below,\r
-refers to any such program or work, and a "work based on the Program"\r
-means either the Program or any derivative work under copyright law:\r
-that is to say, a work containing the Program or a portion of it,\r
-either verbatim or with modifications and/or translated into another\r
-language.  (Hereinafter, translation is included without limitation in\r
-the term "modification".)  Each licensee is addressed as "you".\r
-\r
-Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running the Program is not restricted, and the output from the Program\r
-is covered only if its contents constitute a work based on the\r
-Program (independent of having been made by running the Program).\r
-Whether that is true depends on what the Program does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Program's\r
-source code as you receive it, in any medium, provided that you\r
-conspicuously and appropriately publish on each copy an appropriate\r
-copyright notice and disclaimer of warranty; keep intact all the\r
-notices that refer to this License and to the absence of any warranty;\r
-and give any other recipients of the Program a copy of this License\r
-along with the Program.\r
-\r
-You may charge a fee for the physical act of transferring a copy, and\r
-you may at your option offer warranty protection in exchange for a fee.\r
-\r
-  2. You may modify your copy or copies of the Program or any portion\r
-of it, thus forming a work based on the Program, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) You must cause the modified files to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    b) You must cause any work that you distribute or publish, that in\r
-    whole or in part contains or is derived from the Program or any\r
-    part thereof, to be licensed as a whole at no charge to all third\r
-    parties under the terms of this License.\r
-\r
-    c) If the modified program normally reads commands interactively\r
-    when run, you must cause it, when started running for such\r
-    interactive use in the most ordinary way, to print or display an\r
-    announcement including an appropriate copyright notice and a\r
-    notice that there is no warranty (or else, saying that you provide\r
-    a warranty) and that users may redistribute the program under\r
-    these conditions, and telling the user how to view a copy of this\r
-    License.  (Exception: if the Program itself is interactive but\r
-    does not normally print such an announcement, your work based on\r
-    the Program is not required to print an announcement.)\r
-\f\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Program,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Program, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Program.\r
-\r
-In addition, mere aggregation of another work not based on the Program\r
-with the Program (or with a work based on the Program) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may copy and distribute the Program (or a work based on it,\r
-under Section 2) in object code or executable form under the terms of\r
-Sections 1 and 2 above provided that you also do one of the following:\r
-\r
-    a) Accompany it with the complete corresponding machine-readable\r
-    source code, which must be distributed under the terms of Sections\r
-    1 and 2 above on a medium customarily used for software interchange; or,\r
-\r
-    b) Accompany it with a written offer, valid for at least three\r
-    years, to give any third party, for a charge no more than your\r
-    cost of physically performing source distribution, a complete\r
-    machine-readable copy of the corresponding source code, to be\r
-    distributed under the terms of Sections 1 and 2 above on a medium\r
-    customarily used for software interchange; or,\r
-\r
-    c) Accompany it with the information you received as to the offer\r
-    to distribute corresponding source code.  (This alternative is\r
-    allowed only for noncommercial distribution and only if you\r
-    received the program in object code or executable form with such\r
-    an offer, in accord with Subsection b above.)\r
-\r
-The source code for a work means the preferred form of the work for\r
-making modifications to it.  For an executable work, complete source\r
-code means all the source code for all modules it contains, plus any\r
-associated interface definition files, plus the scripts used to\r
-control compilation and installation of the executable.  However, as a\r
-special exception, the source code distributed need not include\r
-anything that is normally distributed (in either source or binary\r
-form) with the major components (compiler, kernel, and so on) of the\r
-operating system on which the executable runs, unless that component\r
-itself accompanies the executable.\r
-\r
-If distribution of executable or object code is made by offering\r
-access to copy from a designated place, then offering equivalent\r
-access to copy the source code from the same place counts as\r
-distribution of the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\f\r
-  4. You may not copy, modify, sublicense, or distribute the Program\r
-except as expressly provided under this License.  Any attempt\r
-otherwise to copy, modify, sublicense or distribute the Program is\r
-void, and will automatically terminate your rights under this License.\r
-However, parties who have received copies, or rights, from you under\r
-this License will not have their licenses terminated so long as such\r
-parties remain in full compliance.\r
-\r
-  5. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Program or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Program (or any work based on the\r
-Program), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Program or works based on it.\r
-\r
-  6. Each time you redistribute the Program (or any work based on the\r
-Program), the recipient automatically receives a license from the\r
-original licensor to copy, distribute or modify the Program subject to\r
-these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\r
-  7. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Program at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Program by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Program.\r
-\r
-If any portion of this section is held invalid or unenforceable under\r
-any particular circumstance, the balance of the section is intended to\r
-apply and the section as a whole is intended to apply in other\r
-circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system, which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\f\r
-  8. If the distribution and/or use of the Program is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Program under this License\r
-may add an explicit geographical distribution limitation excluding\r
-those countries, so that distribution is permitted only in or among\r
-countries not thus excluded.  In such case, this License incorporates\r
-the limitation as if written in the body of this License.\r
-\r
-  9. The Free Software Foundation may publish revised and/or new versions\r
-of the General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Program\r
-specifies a version number of this License which applies to it and "any\r
-later version", you have the option of following the terms and conditions\r
-either of that version or of any later version published by the Free\r
-Software Foundation.  If the Program does not specify a version number of\r
-this License, you may choose any version ever published by the Free Software\r
-Foundation.\r
-\r
-  10. If you wish to incorporate parts of the Program into other free\r
-programs whose distribution conditions are different, write to the author\r
-to ask for permission.  For software which is copyrighted by the Free\r
-Software Foundation, write to the Free Software Foundation; we sometimes\r
-make exceptions for this.  Our decision will be guided by the two goals\r
-of preserving the free status of all derivatives of our free software and\r
-of promoting the sharing and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
-REPAIR OR CORRECTION.\r
-\r
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGES.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/speex.txt b/ffmpeg 0.7/licenses/speex.txt
deleted file mode 100644 (file)
index e7a3ac7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Copyright 2002-2008    Xiph.org Foundation\r
-Copyright 2002-2008    Jean-Marc Valin\r
-Copyright 2005-2007    Analog Devices Inc.\r
-Copyright 2005-2008    Commonwealth Scientific and Industrial Research \r
-                        Organisation (CSIRO)\r
-Copyright 1993, 2002, 2006 David Rowe\r
-Copyright 2003                 EpicGames\r
-Copyright 1992-1994    Jutta Degener, Carsten Bormann\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions\r
-are met:\r
-\r
-- Redistributions of source code must retain the above copyright\r
-notice, this list of conditions and the following disclaimer.\r
-\r
-- Redistributions in binary form must reproduce the above copyright\r
-notice, this list of conditions and the following disclaimer in the\r
-documentation and/or other materials provided with the distribution.\r
-\r
-- Neither the name of the Xiph.org Foundation nor the names of its\r
-contributors may be used to endorse or promote products derived from\r
-this software without specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR\r
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/theora.txt b/ffmpeg 0.7/licenses/theora.txt
deleted file mode 100644 (file)
index 0914cca..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (C) 2002-2009 Xiph.org Foundation\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions\r
-are met:\r
-\r
-- Redistributions of source code must retain the above copyright\r
-notice, this list of conditions and the following disclaimer.\r
-\r
-- Redistributions in binary form must reproduce the above copyright\r
-notice, this list of conditions and the following disclaimer in the\r
-documentation and/or other materials provided with the distribution.\r
-\r
-- Neither the name of the Xiph.org Foundation nor the names of its\r
-contributors may be used to endorse or promote products derived from\r
-this software without specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION\r
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/vorbis.txt b/ffmpeg 0.7/licenses/vorbis.txt
deleted file mode 100644 (file)
index 9ce60f8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2002-2008 Xiph.org Foundation\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions\r
-are met:\r
-\r
-- Redistributions of source code must retain the above copyright\r
-notice, this list of conditions and the following disclaimer.\r
-\r
-- Redistributions in binary form must reproduce the above copyright\r
-notice, this list of conditions and the following disclaimer in the\r
-documentation and/or other materials provided with the distribution.\r
-\r
-- Neither the name of the Xiph.org Foundation nor the names of its\r
-contributors may be used to endorse or promote products derived from\r
-this software without specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION\r
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/x264.txt b/ffmpeg 0.7/licenses/x264.txt
deleted file mode 100644 (file)
index 1e51ded..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-License is intended to guarantee your freedom to share and change free\r
-software--to make sure the software is free for all its users.  This\r
-General Public License applies to most of the Free Software\r
-Foundation's software and to any other program whose authors commit to\r
-using it.  (Some other Free Software Foundation software is covered by\r
-the GNU Library General Public License instead.)  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if you\r
-distribute copies of the software, or if you modify it.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must give the recipients all the rights that\r
-you have.  You must make sure that they, too, receive or can get the\r
-source code.  And you must show them these terms so they know their\r
-rights.\r
-\r
-  We protect your rights with two steps: (1) copyright the software, and\r
-(2) offer you this license which gives you legal permission to copy,\r
-distribute and/or modify the software.\r
-\r
-  Also, for each author's protection and ours, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-software.  If the software is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original, so\r
-that any problems introduced by others will not reflect on the original\r
-authors' reputations.\r
-\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that redistributors of a free\r
-program will individually obtain patent licenses, in effect making the\r
-program proprietary.  To prevent this, we have made it clear that any\r
-patent must be licensed for everyone's free use or not licensed at all.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\r
-                   GNU GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License applies to any program or other work which contains\r
-a notice placed by the copyright holder saying it may be distributed\r
-under the terms of this General Public License.  The "Program", below,\r
-refers to any such program or work, and a "work based on the Program"\r
-means either the Program or any derivative work under copyright law:\r
-that is to say, a work containing the Program or a portion of it,\r
-either verbatim or with modifications and/or translated into another\r
-language.  (Hereinafter, translation is included without limitation in\r
-the term "modification".)  Each licensee is addressed as "you".\r
-\r
-Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running the Program is not restricted, and the output from the Program\r
-is covered only if its contents constitute a work based on the\r
-Program (independent of having been made by running the Program).\r
-Whether that is true depends on what the Program does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Program's\r
-source code as you receive it, in any medium, provided that you\r
-conspicuously and appropriately publish on each copy an appropriate\r
-copyright notice and disclaimer of warranty; keep intact all the\r
-notices that refer to this License and to the absence of any warranty;\r
-and give any other recipients of the Program a copy of this License\r
-along with the Program.\r
-\r
-You may charge a fee for the physical act of transferring a copy, and\r
-you may at your option offer warranty protection in exchange for a fee.\r
-\r
-  2. You may modify your copy or copies of the Program or any portion\r
-of it, thus forming a work based on the Program, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) You must cause the modified files to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    b) You must cause any work that you distribute or publish, that in\r
-    whole or in part contains or is derived from the Program or any\r
-    part thereof, to be licensed as a whole at no charge to all third\r
-    parties under the terms of this License.\r
-\r
-    c) If the modified program normally reads commands interactively\r
-    when run, you must cause it, when started running for such\r
-    interactive use in the most ordinary way, to print or display an\r
-    announcement including an appropriate copyright notice and a\r
-    notice that there is no warranty (or else, saying that you provide\r
-    a warranty) and that users may redistribute the program under\r
-    these conditions, and telling the user how to view a copy of this\r
-    License.  (Exception: if the Program itself is interactive but\r
-    does not normally print such an announcement, your work based on\r
-    the Program is not required to print an announcement.)\r
-\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Program,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Program, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Program.\r
-\r
-In addition, mere aggregation of another work not based on the Program\r
-with the Program (or with a work based on the Program) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may copy and distribute the Program (or a work based on it,\r
-under Section 2) in object code or executable form under the terms of\r
-Sections 1 and 2 above provided that you also do one of the following:\r
-\r
-    a) Accompany it with the complete corresponding machine-readable\r
-    source code, which must be distributed under the terms of Sections\r
-    1 and 2 above on a medium customarily used for software interchange; or,\r
-\r
-    b) Accompany it with a written offer, valid for at least three\r
-    years, to give any third party, for a charge no more than your\r
-    cost of physically performing source distribution, a complete\r
-    machine-readable copy of the corresponding source code, to be\r
-    distributed under the terms of Sections 1 and 2 above on a medium\r
-    customarily used for software interchange; or,\r
-\r
-    c) Accompany it with the information you received as to the offer\r
-    to distribute corresponding source code.  (This alternative is\r
-    allowed only for noncommercial distribution and only if you\r
-    received the program in object code or executable form with such\r
-    an offer, in accord with Subsection b above.)\r
-\r
-The source code for a work means the preferred form of the work for\r
-making modifications to it.  For an executable work, complete source\r
-code means all the source code for all modules it contains, plus any\r
-associated interface definition files, plus the scripts used to\r
-control compilation and installation of the executable.  However, as a\r
-special exception, the source code distributed need not include\r
-anything that is normally distributed (in either source or binary\r
-form) with the major components (compiler, kernel, and so on) of the\r
-operating system on which the executable runs, unless that component\r
-itself accompanies the executable.\r
-\r
-If distribution of executable or object code is made by offering\r
-access to copy from a designated place, then offering equivalent\r
-access to copy the source code from the same place counts as\r
-distribution of the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
-  4. You may not copy, modify, sublicense, or distribute the Program\r
-except as expressly provided under this License.  Any attempt\r
-otherwise to copy, modify, sublicense or distribute the Program is\r
-void, and will automatically terminate your rights under this License.\r
-However, parties who have received copies, or rights, from you under\r
-this License will not have their licenses terminated so long as such\r
-parties remain in full compliance.\r
-\r
-  5. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Program or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Program (or any work based on the\r
-Program), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Program or works based on it.\r
-\r
-  6. Each time you redistribute the Program (or any work based on the\r
-Program), the recipient automatically receives a license from the\r
-original licensor to copy, distribute or modify the Program subject to\r
-these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\r
-  7. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Program at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Program by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Program.\r
-\r
-If any portion of this section is held invalid or unenforceable under\r
-any particular circumstance, the balance of the section is intended to\r
-apply and the section as a whole is intended to apply in other\r
-circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system, which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
-  8. If the distribution and/or use of the Program is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Program under this License\r
-may add an explicit geographical distribution limitation excluding\r
-those countries, so that distribution is permitted only in or among\r
-countries not thus excluded.  In such case, this License incorporates\r
-the limitation as if written in the body of this License.\r
-\r
-  9. The Free Software Foundation may publish revised and/or new versions\r
-of the General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Program\r
-specifies a version number of this License which applies to it and "any\r
-later version", you have the option of following the terms and conditions\r
-either of that version or of any later version published by the Free\r
-Software Foundation.  If the Program does not specify a version number of\r
-this License, you may choose any version ever published by the Free Software\r
-Foundation.\r
-\r
-  10. If you wish to incorporate parts of the Program into other free\r
-programs whose distribution conditions are different, write to the author\r
-to ask for permission.  For software which is copyrighted by the Free\r
-Software Foundation, write to the Free Software Foundation; we sometimes\r
-make exceptions for this.  Our decision will be guided by the two goals\r
-of preserving the free status of all derivatives of our free software and\r
-of promoting the sharing and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
-REPAIR OR CORRECTION.\r
-\r
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\r
-           How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software; you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation; either version 2 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program; if not, write to the Free Software\r
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-If the program is interactive, make it output a short notice like this\r
-when it starts in an interactive mode:\r
-\r
-    Gnomovision version 69, Copyright (C) year  name of author\r
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, the commands you use may\r
-be called something other than `show w' and `show c'; they could even be\r
-mouse-clicks or menu items--whatever suits your program.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the program, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1989\r
-  Ty Coon, President of Vice\r
-\r
-This General Public License does not permit incorporating your program into\r
-proprietary programs.  If your program is a subroutine library, you may\r
-consider it more useful to permit linking proprietary applications with the\r
-library.  If this is what you want to do, use the GNU Library General\r
-Public License instead of this License.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/xavs.txt b/ffmpeg 0.7/licenses/xavs.txt
deleted file mode 100644 (file)
index 818433e..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE\r
-                       Version 3, 29 June 2007\r
-\r
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                            Preamble\r
-\r
-  The GNU General Public License is a free, copyleft license for\r
-software and other kinds of works.\r
-\r
-  The licenses for most software and other practical works are designed\r
-to take away your freedom to share and change the works.  By contrast,\r
-the GNU General Public License is intended to guarantee your freedom to\r
-share and change all versions of a program--to make sure it remains free\r
-software for all its users.  We, the Free Software Foundation, use the\r
-GNU General Public License for most of our software; it applies also to\r
-any other work released this way by its authors.  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-them if you wish), that you receive source code or can get it if you\r
-want it, that you can change the software or use pieces of it in new\r
-free programs, and that you know you can do these things.\r
-\r
-  To protect your rights, we need to prevent others from denying you\r
-these rights or asking you to surrender the rights.  Therefore, you have\r
-certain responsibilities if you distribute copies of the software, or if\r
-you modify it: responsibilities to respect the freedom of others.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must pass on to the recipients the same\r
-freedoms that you received.  You must make sure that they, too, receive\r
-or can get the source code.  And you must show them these terms so they\r
-know their rights.\r
-\r
-  Developers that use the GNU GPL protect your rights with two steps:\r
-(1) assert copyright on the software, and (2) offer you this License\r
-giving you legal permission to copy, distribute and/or modify it.\r
-\r
-  For the developers' and authors' protection, the GPL clearly explains\r
-that there is no warranty for this free software.  For both users' and\r
-authors' sake, the GPL requires that modified versions be marked as\r
-changed, so that their problems will not be attributed erroneously to\r
-authors of previous versions.\r
-\r
-  Some devices are designed to deny users access to install or run\r
-modified versions of the software inside them, although the manufacturer\r
-can do so.  This is fundamentally incompatible with the aim of\r
-protecting users' freedom to change the software.  The systematic\r
-pattern of such abuse occurs in the area of products for individuals to\r
-use, which is precisely where it is most unacceptable.  Therefore, we\r
-have designed this version of the GPL to prohibit the practice for those\r
-products.  If such problems arise substantially in other domains, we\r
-stand ready to extend this provision to those domains in future versions\r
-of the GPL, as needed to protect the freedom of users.\r
-\r
-  Finally, every program is threatened constantly by software patents.\r
-States should not allow patents to restrict development and use of\r
-software on general-purpose computers, but in those that do, we wish to\r
-avoid the special danger that patents applied to a free program could\r
-make it effectively proprietary.  To prevent this, the GPL assures that\r
-patents cannot be used to render the program non-free.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\r
-                       TERMS AND CONDITIONS\r
-\r
-  0. Definitions.\r
-\r
-  "This License" refers to version 3 of the GNU General Public License.\r
-\r
-  "Copyright" also means copyright-like laws that apply to other kinds of\r
-works, such as semiconductor masks.\r
-\r
-  "The Program" refers to any copyrightable work licensed under this\r
-License.  Each licensee is addressed as "you".  "Licensees" and\r
-"recipients" may be individuals or organizations.\r
-\r
-  To "modify" a work means to copy from or adapt all or part of the work\r
-in a fashion requiring copyright permission, other than the making of an\r
-exact copy.  The resulting work is called a "modified version" of the\r
-earlier work or a work "based on" the earlier work.\r
-\r
-  A "covered work" means either the unmodified Program or a work based\r
-on the Program.\r
-\r
-  To "propagate" a work means to do anything with it that, without\r
-permission, would make you directly or secondarily liable for\r
-infringement under applicable copyright law, except executing it on a\r
-computer or modifying a private copy.  Propagation includes copying,\r
-distribution (with or without modification), making available to the\r
-public, and in some countries other activities as well.\r
-\r
-  To "convey" a work means any kind of propagation that enables other\r
-parties to make or receive copies.  Mere interaction with a user through\r
-a computer network, with no transfer of a copy, is not conveying.\r
-\r
-  An interactive user interface displays "Appropriate Legal Notices"\r
-to the extent that it includes a convenient and prominently visible\r
-feature that (1) displays an appropriate copyright notice, and (2)\r
-tells the user that there is no warranty for the work (except to the\r
-extent that warranties are provided), that licensees may convey the\r
-work under this License, and how to view a copy of this License.  If\r
-the interface presents a list of user commands or options, such as a\r
-menu, a prominent item in the list meets this criterion.\r
-\r
-  1. Source Code.\r
-\r
-  The "source code" for a work means the preferred form of the work\r
-for making modifications to it.  "Object code" means any non-source\r
-form of a work.\r
-\r
-  A "Standard Interface" means an interface that either is an official\r
-standard defined by a recognized standards body, or, in the case of\r
-interfaces specified for a particular programming language, one that\r
-is widely used among developers working in that language.\r
-\r
-  The "System Libraries" of an executable work include anything, other\r
-than the work as a whole, that (a) is included in the normal form of\r
-packaging a Major Component, but which is not part of that Major\r
-Component, and (b) serves only to enable use of the work with that\r
-Major Component, or to implement a Standard Interface for which an\r
-implementation is available to the public in source code form.  A\r
-"Major Component", in this context, means a major essential component\r
-(kernel, window system, and so on) of the specific operating system\r
-(if any) on which the executable work runs, or a compiler used to\r
-produce the work, or an object code interpreter used to run it.\r
-\r
-  The "Corresponding Source" for a work in object code form means all\r
-the source code needed to generate, install, and (for an executable\r
-work) run the object code and to modify the work, including scripts to\r
-control those activities.  However, it does not include the work's\r
-System Libraries, or general-purpose tools or generally available free\r
-programs which are used unmodified in performing those activities but\r
-which are not part of the work.  For example, Corresponding Source\r
-includes interface definition files associated with source files for\r
-the work, and the source code for shared libraries and dynamically\r
-linked subprograms that the work is specifically designed to require,\r
-such as by intimate data communication or control flow between those\r
-subprograms and other parts of the work.\r
-\r
-  The Corresponding Source need not include anything that users\r
-can regenerate automatically from other parts of the Corresponding\r
-Source.\r
-\r
-  The Corresponding Source for a work in source code form is that\r
-same work.\r
-\r
-  2. Basic Permissions.\r
-\r
-  All rights granted under this License are granted for the term of\r
-copyright on the Program, and are irrevocable provided the stated\r
-conditions are met.  This License explicitly affirms your unlimited\r
-permission to run the unmodified Program.  The output from running a\r
-covered work is covered by this License only if the output, given its\r
-content, constitutes a covered work.  This License acknowledges your\r
-rights of fair use or other equivalent, as provided by copyright law.\r
-\r
-  You may make, run and propagate covered works that you do not\r
-convey, without conditions so long as your license otherwise remains\r
-in force.  You may convey covered works to others for the sole purpose\r
-of having them make modifications exclusively for you, or provide you\r
-with facilities for running those works, provided that you comply with\r
-the terms of this License in conveying all material for which you do\r
-not control copyright.  Those thus making or running the covered works\r
-for you must do so exclusively on your behalf, under your direction\r
-and control, on terms that prohibit them from making any copies of\r
-your copyrighted material outside their relationship with you.\r
-\r
-  Conveying under any other circumstances is permitted solely under\r
-the conditions stated below.  Sublicensing is not allowed; section 10\r
-makes it unnecessary.\r
-\r
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r
-\r
-  No covered work shall be deemed part of an effective technological\r
-measure under any applicable law fulfilling obligations under article\r
-11 of the WIPO copyright treaty adopted on 20 December 1996, or\r
-similar laws prohibiting or restricting circumvention of such\r
-measures.\r
-\r
-  When you convey a covered work, you waive any legal power to forbid\r
-circumvention of technological measures to the extent such circumvention\r
-is effected by exercising rights under this License with respect to\r
-the covered work, and you disclaim any intention to limit operation or\r
-modification of the work as a means of enforcing, against the work's\r
-users, your or third parties' legal rights to forbid circumvention of\r
-technological measures.\r
-\r
-  4. Conveying Verbatim Copies.\r
-\r
-  You may convey verbatim copies of the Program's source code as you\r
-receive it, in any medium, provided that you conspicuously and\r
-appropriately publish on each copy an appropriate copyright notice;\r
-keep intact all notices stating that this License and any\r
-non-permissive terms added in accord with section 7 apply to the code;\r
-keep intact all notices of the absence of any warranty; and give all\r
-recipients a copy of this License along with the Program.\r
-\r
-  You may charge any price or no price for each copy that you convey,\r
-and you may offer support or warranty protection for a fee.\r
-\r
-  5. Conveying Modified Source Versions.\r
-\r
-  You may convey a work based on the Program, or the modifications to\r
-produce it from the Program, in the form of source code under the\r
-terms of section 4, provided that you also meet all of these conditions:\r
-\r
-    a) The work must carry prominent notices stating that you modified\r
-    it, and giving a relevant date.\r
-\r
-    b) The work must carry prominent notices stating that it is\r
-    released under this License and any conditions added under section\r
-    7.  This requirement modifies the requirement in section 4 to\r
-    "keep intact all notices".\r
-\r
-    c) You must license the entire work, as a whole, under this\r
-    License to anyone who comes into possession of a copy.  This\r
-    License will therefore apply, along with any applicable section 7\r
-    additional terms, to the whole of the work, and all its parts,\r
-    regardless of how they are packaged.  This License gives no\r
-    permission to license the work in any other way, but it does not\r
-    invalidate such permission if you have separately received it.\r
-\r
-    d) If the work has interactive user interfaces, each must display\r
-    Appropriate Legal Notices; however, if the Program has interactive\r
-    interfaces that do not display Appropriate Legal Notices, your\r
-    work need not make them do so.\r
-\r
-  A compilation of a covered work with other separate and independent\r
-works, which are not by their nature extensions of the covered work,\r
-and which are not combined with it such as to form a larger program,\r
-in or on a volume of a storage or distribution medium, is called an\r
-"aggregate" if the compilation and its resulting copyright are not\r
-used to limit the access or legal rights of the compilation's users\r
-beyond what the individual works permit.  Inclusion of a covered work\r
-in an aggregate does not cause this License to apply to the other\r
-parts of the aggregate.\r
-\r
-  6. Conveying Non-Source Forms.\r
-\r
-  You may convey a covered work in object code form under the terms\r
-of sections 4 and 5, provided that you also convey the\r
-machine-readable Corresponding Source under the terms of this License,\r
-in one of these ways:\r
-\r
-    a) Convey the object code in, or embodied in, a physical product\r
-    (including a physical distribution medium), accompanied by the\r
-    Corresponding Source fixed on a durable physical medium\r
-    customarily used for software interchange.\r
-\r
-    b) Convey the object code in, or embodied in, a physical product\r
-    (including a physical distribution medium), accompanied by a\r
-    written offer, valid for at least three years and valid for as\r
-    long as you offer spare parts or customer support for that product\r
-    model, to give anyone who possesses the object code either (1) a\r
-    copy of the Corresponding Source for all the software in the\r
-    product that is covered by this License, on a durable physical\r
-    medium customarily used for software interchange, for a price no\r
-    more than your reasonable cost of physically performing this\r
-    conveying of source, or (2) access to copy the\r
-    Corresponding Source from a network server at no charge.\r
-\r
-    c) Convey individual copies of the object code with a copy of the\r
-    written offer to provide the Corresponding Source.  This\r
-    alternative is allowed only occasionally and noncommercially, and\r
-    only if you received the object code with such an offer, in accord\r
-    with subsection 6b.\r
-\r
-    d) Convey the object code by offering access from a designated\r
-    place (gratis or for a charge), and offer equivalent access to the\r
-    Corresponding Source in the same way through the same place at no\r
-    further charge.  You need not require recipients to copy the\r
-    Corresponding Source along with the object code.  If the place to\r
-    copy the object code is a network server, the Corresponding Source\r
-    may be on a different server (operated by you or a third party)\r
-    that supports equivalent copying facilities, provided you maintain\r
-    clear directions next to the object code saying where to find the\r
-    Corresponding Source.  Regardless of what server hosts the\r
-    Corresponding Source, you remain obligated to ensure that it is\r
-    available for as long as needed to satisfy these requirements.\r
-\r
-    e) Convey the object code using peer-to-peer transmission, provided\r
-    you inform other peers where the object code and Corresponding\r
-    Source of the work are being offered to the general public at no\r
-    charge under subsection 6d.\r
-\r
-  A separable portion of the object code, whose source code is excluded\r
-from the Corresponding Source as a System Library, need not be\r
-included in conveying the object code work.\r
-\r
-  A "User Product" is either (1) a "consumer product", which means any\r
-tangible personal property which is normally used for personal, family,\r
-or household purposes, or (2) anything designed or sold for incorporation\r
-into a dwelling.  In determining whether a product is a consumer product,\r
-doubtful cases shall be resolved in favor of coverage.  For a particular\r
-product received by a particular user, "normally used" refers to a\r
-typical or common use of that class of product, regardless of the status\r
-of the particular user or of the way in which the particular user\r
-actually uses, or expects or is expected to use, the product.  A product\r
-is a consumer product regardless of whether the product has substantial\r
-commercial, industrial or non-consumer uses, unless such uses represent\r
-the only significant mode of use of the product.\r
-\r
-  "Installation Information" for a User Product means any methods,\r
-procedures, authorization keys, or other information required to install\r
-and execute modified versions of a covered work in that User Product from\r
-a modified version of its Corresponding Source.  The information must\r
-suffice to ensure that the continued functioning of the modified object\r
-code is in no case prevented or interfered with solely because\r
-modification has been made.\r
-\r
-  If you convey an object code work under this section in, or with, or\r
-specifically for use in, a User Product, and the conveying occurs as\r
-part of a transaction in which the right of possession and use of the\r
-User Product is transferred to the recipient in perpetuity or for a\r
-fixed term (regardless of how the transaction is characterized), the\r
-Corresponding Source conveyed under this section must be accompanied\r
-by the Installation Information.  But this requirement does not apply\r
-if neither you nor any third party retains the ability to install\r
-modified object code on the User Product (for example, the work has\r
-been installed in ROM).\r
-\r
-  The requirement to provide Installation Information does not include a\r
-requirement to continue to provide support service, warranty, or updates\r
-for a work that has been modified or installed by the recipient, or for\r
-the User Product in which it has been modified or installed.  Access to a\r
-network may be denied when the modification itself materially and\r
-adversely affects the operation of the network or violates the rules and\r
-protocols for communication across the network.\r
-\r
-  Corresponding Source conveyed, and Installation Information provided,\r
-in accord with this section must be in a format that is publicly\r
-documented (and with an implementation available to the public in\r
-source code form), and must require no special password or key for\r
-unpacking, reading or copying.\r
-\r
-  7. Additional Terms.\r
-\r
-  "Additional permissions" are terms that supplement the terms of this\r
-License by making exceptions from one or more of its conditions.\r
-Additional permissions that are applicable to the entire Program shall\r
-be treated as though they were included in this License, to the extent\r
-that they are valid under applicable law.  If additional permissions\r
-apply only to part of the Program, that part may be used separately\r
-under those permissions, but the entire Program remains governed by\r
-this License without regard to the additional permissions.\r
-\r
-  When you convey a copy of a covered work, you may at your option\r
-remove any additional permissions from that copy, or from any part of\r
-it.  (Additional permissions may be written to require their own\r
-removal in certain cases when you modify the work.)  You may place\r
-additional permissions on material, added by you to a covered work,\r
-for which you have or can give appropriate copyright permission.\r
-\r
-  Notwithstanding any other provision of this License, for material you\r
-add to a covered work, you may (if authorized by the copyright holders of\r
-that material) supplement the terms of this License with terms:\r
-\r
-    a) Disclaiming warranty or limiting liability differently from the\r
-    terms of sections 15 and 16 of this License; or\r
-\r
-    b) Requiring preservation of specified reasonable legal notices or\r
-    author attributions in that material or in the Appropriate Legal\r
-    Notices displayed by works containing it; or\r
-\r
-    c) Prohibiting misrepresentation of the origin of that material, or\r
-    requiring that modified versions of such material be marked in\r
-    reasonable ways as different from the original version; or\r
-\r
-    d) Limiting the use for publicity purposes of names of licensors or\r
-    authors of the material; or\r
-\r
-    e) Declining to grant rights under trademark law for use of some\r
-    trade names, trademarks, or service marks; or\r
-\r
-    f) Requiring indemnification of licensors and authors of that\r
-    material by anyone who conveys the material (or modified versions of\r
-    it) with contractual assumptions of liability to the recipient, for\r
-    any liability that these contractual assumptions directly impose on\r
-    those licensors and authors.\r
-\r
-  All other non-permissive additional terms are considered "further\r
-restrictions" within the meaning of section 10.  If the Program as you\r
-received it, or any part of it, contains a notice stating that it is\r
-governed by this License along with a term that is a further\r
-restriction, you may remove that term.  If a license document contains\r
-a further restriction but permits relicensing or conveying under this\r
-License, you may add to a covered work material governed by the terms\r
-of that license document, provided that the further restriction does\r
-not survive such relicensing or conveying.\r
-\r
-  If you add terms to a covered work in accord with this section, you\r
-must place, in the relevant source files, a statement of the\r
-additional terms that apply to those files, or a notice indicating\r
-where to find the applicable terms.\r
-\r
-  Additional terms, permissive or non-permissive, may be stated in the\r
-form of a separately written license, or stated as exceptions;\r
-the above requirements apply either way.\r
-\r
-  8. Termination.\r
-\r
-  You may not propagate or modify a covered work except as expressly\r
-provided under this License.  Any attempt otherwise to propagate or\r
-modify it is void, and will automatically terminate your rights under\r
-this License (including any patent licenses granted under the third\r
-paragraph of section 11).\r
-\r
-  However, if you cease all violation of this License, then your\r
-license from a particular copyright holder is reinstated (a)\r
-provisionally, unless and until the copyright holder explicitly and\r
-finally terminates your license, and (b) permanently, if the copyright\r
-holder fails to notify you of the violation by some reasonable means\r
-prior to 60 days after the cessation.\r
-\r
-  Moreover, your license from a particular copyright holder is\r
-reinstated permanently if the copyright holder notifies you of the\r
-violation by some reasonable means, this is the first time you have\r
-received notice of violation of this License (for any work) from that\r
-copyright holder, and you cure the violation prior to 30 days after\r
-your receipt of the notice.\r
-\r
-  Termination of your rights under this section does not terminate the\r
-licenses of parties who have received copies or rights from you under\r
-this License.  If your rights have been terminated and not permanently\r
-reinstated, you do not qualify to receive new licenses for the same\r
-material under section 10.\r
-\r
-  9. Acceptance Not Required for Having Copies.\r
-\r
-  You are not required to accept this License in order to receive or\r
-run a copy of the Program.  Ancillary propagation of a covered work\r
-occurring solely as a consequence of using peer-to-peer transmission\r
-to receive a copy likewise does not require acceptance.  However,\r
-nothing other than this License grants you permission to propagate or\r
-modify any covered work.  These actions infringe copyright if you do\r
-not accept this License.  Therefore, by modifying or propagating a\r
-covered work, you indicate your acceptance of this License to do so.\r
-\r
-  10. Automatic Licensing of Downstream Recipients.\r
-\r
-  Each time you convey a covered work, the recipient automatically\r
-receives a license from the original licensors, to run, modify and\r
-propagate that work, subject to this License.  You are not responsible\r
-for enforcing compliance by third parties with this License.\r
-\r
-  An "entity transaction" is a transaction transferring control of an\r
-organization, or substantially all assets of one, or subdividing an\r
-organization, or merging organizations.  If propagation of a covered\r
-work results from an entity transaction, each party to that\r
-transaction who receives a copy of the work also receives whatever\r
-licenses to the work the party's predecessor in interest had or could\r
-give under the previous paragraph, plus a right to possession of the\r
-Corresponding Source of the work from the predecessor in interest, if\r
-the predecessor has it or can get it with reasonable efforts.\r
-\r
-  You may not impose any further restrictions on the exercise of the\r
-rights granted or affirmed under this License.  For example, you may\r
-not impose a license fee, royalty, or other charge for exercise of\r
-rights granted under this License, and you may not initiate litigation\r
-(including a cross-claim or counterclaim in a lawsuit) alleging that\r
-any patent claim is infringed by making, using, selling, offering for\r
-sale, or importing the Program or any portion of it.\r
-\r
-  11. Patents.\r
-\r
-  A "contributor" is a copyright holder who authorizes use under this\r
-License of the Program or a work on which the Program is based.  The\r
-work thus licensed is called the contributor's "contributor version".\r
-\r
-  A contributor's "essential patent claims" are all patent claims\r
-owned or controlled by the contributor, whether already acquired or\r
-hereafter acquired, that would be infringed by some manner, permitted\r
-by this License, of making, using, or selling its contributor version,\r
-but do not include claims that would be infringed only as a\r
-consequence of further modification of the contributor version.  For\r
-purposes of this definition, "control" includes the right to grant\r
-patent sublicenses in a manner consistent with the requirements of\r
-this License.\r
-\r
-  Each contributor grants you a non-exclusive, worldwide, royalty-free\r
-patent license under the contributor's essential patent claims, to\r
-make, use, sell, offer for sale, import and otherwise run, modify and\r
-propagate the contents of its contributor version.\r
-\r
-  In the following three paragraphs, a "patent license" is any express\r
-agreement or commitment, however denominated, not to enforce a patent\r
-(such as an express permission to practice a patent or covenant not to\r
-sue for patent infringement).  To "grant" such a patent license to a\r
-party means to make such an agreement or commitment not to enforce a\r
-patent against the party.\r
-\r
-  If you convey a covered work, knowingly relying on a patent license,\r
-and the Corresponding Source of the work is not available for anyone\r
-to copy, free of charge and under the terms of this License, through a\r
-publicly available network server or other readily accessible means,\r
-then you must either (1) cause the Corresponding Source to be so\r
-available, or (2) arrange to deprive yourself of the benefit of the\r
-patent license for this particular work, or (3) arrange, in a manner\r
-consistent with the requirements of this License, to extend the patent\r
-license to downstream recipients.  "Knowingly relying" means you have\r
-actual knowledge that, but for the patent license, your conveying the\r
-covered work in a country, or your recipient's use of the covered work\r
-in a country, would infringe one or more identifiable patents in that\r
-country that you have reason to believe are valid.\r
-\r
-  If, pursuant to or in connection with a single transaction or\r
-arrangement, you convey, or propagate by procuring conveyance of, a\r
-covered work, and grant a patent license to some of the parties\r
-receiving the covered work authorizing them to use, propagate, modify\r
-or convey a specific copy of the covered work, then the patent license\r
-you grant is automatically extended to all recipients of the covered\r
-work and works based on it.\r
-\r
-  A patent license is "discriminatory" if it does not include within\r
-the scope of its coverage, prohibits the exercise of, or is\r
-conditioned on the non-exercise of one or more of the rights that are\r
-specifically granted under this License.  You may not convey a covered\r
-work if you are a party to an arrangement with a third party that is\r
-in the business of distributing software, under which you make payment\r
-to the third party based on the extent of your activity of conveying\r
-the work, and under which the third party grants, to any of the\r
-parties who would receive the covered work from you, a discriminatory\r
-patent license (a) in connection with copies of the covered work\r
-conveyed by you (or copies made from those copies), or (b) primarily\r
-for and in connection with specific products or compilations that\r
-contain the covered work, unless you entered into that arrangement,\r
-or that patent license was granted, prior to 28 March 2007.\r
-\r
-  Nothing in this License shall be construed as excluding or limiting\r
-any implied license or other defenses to infringement that may\r
-otherwise be available to you under applicable patent law.\r
-\r
-  12. No Surrender of Others' Freedom.\r
-\r
-  If conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot convey a\r
-covered work so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you may\r
-not convey it at all.  For example, if you agree to terms that obligate you\r
-to collect a royalty for further conveying from those to whom you convey\r
-the Program, the only way you could satisfy both those terms and this\r
-License would be to refrain entirely from conveying the Program.\r
-\r
-  13. Use with the GNU Affero General Public License.\r
-\r
-  Notwithstanding any other provision of this License, you have\r
-permission to link or combine any covered work with a work licensed\r
-under version 3 of the GNU Affero General Public License into a single\r
-combined work, and to convey the resulting work.  The terms of this\r
-License will continue to apply to the part which is the covered work,\r
-but the special requirements of the GNU Affero General Public License,\r
-section 13, concerning interaction through a network will apply to the\r
-combination as such.\r
-\r
-  14. Revised Versions of this License.\r
-\r
-  The Free Software Foundation may publish revised and/or new versions of\r
-the GNU General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-  Each version is given a distinguishing version number.  If the\r
-Program specifies that a certain numbered version of the GNU General\r
-Public License "or any later version" applies to it, you have the\r
-option of following the terms and conditions either of that numbered\r
-version or of any later version published by the Free Software\r
-Foundation.  If the Program does not specify a version number of the\r
-GNU General Public License, you may choose any version ever published\r
-by the Free Software Foundation.\r
-\r
-  If the Program specifies that a proxy can decide which future\r
-versions of the GNU General Public License can be used, that proxy's\r
-public statement of acceptance of a version permanently authorizes you\r
-to choose that version for the Program.\r
-\r
-  Later license versions may give you additional or different\r
-permissions.  However, no additional obligations are imposed on any\r
-author or copyright holder as a result of your choosing to follow a\r
-later version.\r
-\r
-  15. Disclaimer of Warranty.\r
-\r
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\r
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
-  16. Limitation of Liability.\r
-\r
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r
-SUCH DAMAGES.\r
-\r
-  17. Interpretation of Sections 15 and 16.\r
-\r
-  If the disclaimer of warranty and limitation of liability provided\r
-above cannot be given local legal effect according to their terms,\r
-reviewing courts shall apply local law that most closely approximates\r
-an absolute waiver of all civil liability in connection with the\r
-Program, unless a warranty or assumption of liability accompanies a\r
-copy of the Program in return for a fee.\r
-\r
-                     END OF TERMS AND CONDITIONS\r
-\r
-            How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-state the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software: you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation, either version 3 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-  If the program does terminal interaction, make it output a short\r
-notice like this when it starts in an interactive mode:\r
-\r
-    <program>  Copyright (C) <year>  <name of author>\r
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, your program's commands\r
-might be different; for a GUI interface, you would use an "about box".\r
-\r
-  You should also get your employer (if you work as a programmer) or school,\r
-if any, to sign a "copyright disclaimer" for the program, if necessary.\r
-For more information on this, and how to apply and follow the GNU GPL, see\r
-<http://www.gnu.org/licenses/>.\r
-\r
-  The GNU General Public License does not permit incorporating your program\r
-into proprietary programs.  If your program is a subroutine library, you\r
-may consider it more useful to permit linking proprietary applications with\r
-the library.  If this is what you want to do, use the GNU Lesser General\r
-Public License instead of this License.  But first, please read\r
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.\r
diff --git a/ffmpeg 0.7/licenses/xvid.txt b/ffmpeg 0.7/licenses/xvid.txt
deleted file mode 100644 (file)
index ea9864d..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE\r
-                      Version 2, June 1991\r
-\r
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
- 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-License is intended to guarantee your freedom to share and change free\r
-software--to make sure the software is free for all its users.  This\r
-General Public License applies to most of the Free Software\r
-Foundation's software and to any other program whose authors commit to\r
-using it.  (Some other Free Software Foundation software is covered by\r
-the GNU Library General Public License instead.)  You can apply it to\r
-your programs, too.\r
-\r
-  When we speak of free software, we are referring to freedom, not\r
-price.  Our General Public Licenses are designed to make sure that you\r
-have the freedom to distribute copies of free software (and charge for\r
-this service if you wish), that you receive source code or can get it\r
-if you want it, that you can change the software or use pieces of it\r
-in new free programs; and that you know you can do these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-anyone to deny you these rights or to ask you to surrender the rights.\r
-These restrictions translate to certain responsibilities for you if you\r
-distribute copies of the software, or if you modify it.\r
-\r
-  For example, if you distribute copies of such a program, whether\r
-gratis or for a fee, you must give the recipients all the rights that\r
-you have.  You must make sure that they, too, receive or can get the\r
-source code.  And you must show them these terms so they know their\r
-rights.\r
-\r
-  We protect your rights with two steps: (1) copyright the software, and\r
-(2) offer you this license which gives you legal permission to copy,\r
-distribute and/or modify the software.\r
-\r
-  Also, for each author's protection and ours, we want to make certain\r
-that everyone understands that there is no warranty for this free\r
-software.  If the software is modified by someone else and passed on, we\r
-want its recipients to know that what they have is not the original, so\r
-that any problems introduced by others will not reflect on the original\r
-authors' reputations.\r
-\r
-  Finally, any free program is threatened constantly by software\r
-patents.  We wish to avoid the danger that redistributors of a free\r
-program will individually obtain patent licenses, in effect making the\r
-program proprietary.  To prevent this, we have made it clear that any\r
-patent must be licensed for everyone's free use or not licensed at all.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.\r
-\r
-                   GNU GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License applies to any program or other work which contains\r
-a notice placed by the copyright holder saying it may be distributed\r
-under the terms of this General Public License.  The "Program", below,\r
-refers to any such program or work, and a "work based on the Program"\r
-means either the Program or any derivative work under copyright law:\r
-that is to say, a work containing the Program or a portion of it,\r
-either verbatim or with modifications and/or translated into another\r
-language.  (Hereinafter, translation is included without limitation in\r
-the term "modification".)  Each licensee is addressed as "you".\r
-\r
-Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running the Program is not restricted, and the output from the Program\r
-is covered only if its contents constitute a work based on the\r
-Program (independent of having been made by running the Program).\r
-Whether that is true depends on what the Program does.\r
-\r
-  1. You may copy and distribute verbatim copies of the Program's\r
-source code as you receive it, in any medium, provided that you\r
-conspicuously and appropriately publish on each copy an appropriate\r
-copyright notice and disclaimer of warranty; keep intact all the\r
-notices that refer to this License and to the absence of any warranty;\r
-and give any other recipients of the Program a copy of this License\r
-along with the Program.\r
-\r
-You may charge a fee for the physical act of transferring a copy, and\r
-you may at your option offer warranty protection in exchange for a fee.\r
-\r
-  2. You may modify your copy or copies of the Program or any portion\r
-of it, thus forming a work based on the Program, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) You must cause the modified files to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    b) You must cause any work that you distribute or publish, that in\r
-    whole or in part contains or is derived from the Program or any\r
-    part thereof, to be licensed as a whole at no charge to all third\r
-    parties under the terms of this License.\r
-\r
-    c) If the modified program normally reads commands interactively\r
-    when run, you must cause it, when started running for such\r
-    interactive use in the most ordinary way, to print or display an\r
-    announcement including an appropriate copyright notice and a\r
-    notice that there is no warranty (or else, saying that you provide\r
-    a warranty) and that users may redistribute the program under\r
-    these conditions, and telling the user how to view a copy of this\r
-    License.  (Exception: if the Program itself is interactive but\r
-    does not normally print such an announcement, your work based on\r
-    the Program is not required to print an announcement.)\r
-\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Program,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Program, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Program.\r
-\r
-In addition, mere aggregation of another work not based on the Program\r
-with the Program (or with a work based on the Program) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may copy and distribute the Program (or a work based on it,\r
-under Section 2) in object code or executable form under the terms of\r
-Sections 1 and 2 above provided that you also do one of the following:\r
-\r
-    a) Accompany it with the complete corresponding machine-readable\r
-    source code, which must be distributed under the terms of Sections\r
-    1 and 2 above on a medium customarily used for software interchange; or,\r
-\r
-    b) Accompany it with a written offer, valid for at least three\r
-    years, to give any third party, for a charge no more than your\r
-    cost of physically performing source distribution, a complete\r
-    machine-readable copy of the corresponding source code, to be\r
-    distributed under the terms of Sections 1 and 2 above on a medium\r
-    customarily used for software interchange; or,\r
-\r
-    c) Accompany it with the information you received as to the offer\r
-    to distribute corresponding source code.  (This alternative is\r
-    allowed only for noncommercial distribution and only if you\r
-    received the program in object code or executable form with such\r
-    an offer, in accord with Subsection b above.)\r
-\r
-The source code for a work means the preferred form of the work for\r
-making modifications to it.  For an executable work, complete source\r
-code means all the source code for all modules it contains, plus any\r
-associated interface definition files, plus the scripts used to\r
-control compilation and installation of the executable.  However, as a\r
-special exception, the source code distributed need not include\r
-anything that is normally distributed (in either source or binary\r
-form) with the major components (compiler, kernel, and so on) of the\r
-operating system on which the executable runs, unless that component\r
-itself accompanies the executable.\r
-\r
-If distribution of executable or object code is made by offering\r
-access to copy from a designated place, then offering equivalent\r
-access to copy the source code from the same place counts as\r
-distribution of the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
-  4. You may not copy, modify, sublicense, or distribute the Program\r
-except as expressly provided under this License.  Any attempt\r
-otherwise to copy, modify, sublicense or distribute the Program is\r
-void, and will automatically terminate your rights under this License.\r
-However, parties who have received copies, or rights, from you under\r
-this License will not have their licenses terminated so long as such\r
-parties remain in full compliance.\r
-\r
-  5. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Program or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Program (or any work based on the\r
-Program), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Program or works based on it.\r
-\r
-  6. Each time you redistribute the Program (or any work based on the\r
-Program), the recipient automatically receives a license from the\r
-original licensor to copy, distribute or modify the Program subject to\r
-these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties to\r
-this License.\r
-\r
-  7. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Program at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Program by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Program.\r
-\r
-If any portion of this section is held invalid or unenforceable under\r
-any particular circumstance, the balance of the section is intended to\r
-apply and the section as a whole is intended to apply in other\r
-circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system, which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
-  8. If the distribution and/or use of the Program is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Program under this License\r
-may add an explicit geographical distribution limitation excluding\r
-those countries, so that distribution is permitted only in or among\r
-countries not thus excluded.  In such case, this License incorporates\r
-the limitation as if written in the body of this License.\r
-\r
-  9. The Free Software Foundation may publish revised and/or new versions\r
-of the General Public License from time to time.  Such new versions will\r
-be similar in spirit to the present version, but may differ in detail to\r
-address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Program\r
-specifies a version number of this License which applies to it and "any\r
-later version", you have the option of following the terms and conditions\r
-either of that version or of any later version published by the Free\r
-Software Foundation.  If the Program does not specify a version number of\r
-this License, you may choose any version ever published by the Free Software\r
-Foundation.\r
-\r
-  10. If you wish to incorporate parts of the Program into other free\r
-programs whose distribution conditions are different, write to the author\r
-to ask for permission.  For software which is copyrighted by the Free\r
-Software Foundation, write to the Free Software Foundation; we sometimes\r
-make exceptions for this.  Our decision will be guided by the two goals\r
-of preserving the free status of all derivatives of our free software and\r
-of promoting the sharing and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
-REPAIR OR CORRECTION.\r
-\r
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\r
-           How to Apply These Terms to Your New Programs\r
-\r
-  If you develop a new program, and you want it to be of the greatest\r
-possible use to the public, the best way to achieve this is to make it\r
-free software which everyone can redistribute and change under these terms.\r
-\r
-  To do so, attach the following notices to the program.  It is safest\r
-to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least\r
-the "copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the program's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This program is free software; you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation; either version 2 of the License, or\r
-    (at your option) any later version.\r
-\r
-    This program is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program; if not, write to the Free Software\r
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-If the program is interactive, make it output a short notice like this\r
-when it starts in an interactive mode:\r
-\r
-    Gnomovision version 69, Copyright (C) year name of author\r
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
-    This is free software, and you are welcome to redistribute it\r
-    under certain conditions; type `show c' for details.\r
-\r
-The hypothetical commands `show w' and `show c' should show the appropriate\r
-parts of the General Public License.  Of course, the commands you use may\r
-be called something other than `show w' and `show c'; they could even be\r
-mouse-clicks or menu items--whatever suits your program.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the program, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1989\r
-  Ty Coon, President of Vice\r
-\r
-This General Public License does not permit incorporating your program into\r
-proprietary programs.  If your program is a subroutine library, you may\r
-consider it more useful to permit linking proprietary applications with the\r
-library.  If this is what you want to do, use the GNU Library General\r
-Public License instead of this License.
\ No newline at end of file
diff --git a/ffmpeg 0.7/licenses/zlib.txt b/ffmpeg 0.7/licenses/zlib.txt
deleted file mode 100644 (file)
index eb9dc58..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-  zlib.h -- interface of the 'zlib' general purpose compression library\r
-  version 1.2.5, April 19th, 2010\r
-\r
-  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler\r
-\r
-  This software is provided 'as-is', without any express or implied\r
-  warranty.  In no event will the authors be held liable for any damages\r
-  arising from the use of this software.\r
-\r
-  Permission is granted to anyone to use this software for any purpose,\r
-  including commercial applications, and to alter it and redistribute it\r
-  freely, subject to the following restrictions:\r
-\r
-  1. The origin of this software must not be misrepresented; you must not\r
-     claim that you wrote the original software. If you use this software\r
-     in a product, an acknowledgment in the product documentation would be\r
-     appreciated but is not required.\r
-  2. Altered source versions must be plainly marked as such, and must not be\r
-     misrepresented as being the original software.\r
-  3. This notice may not be removed or altered from any source distribution.\r
-\r
-  Jean-loup Gailly\r
-  Mark Adler\r